summaryrefslogtreecommitdiffstats
path: root/script/commit_mark.sh
blob: 3de6ba7d47a57e9d0a79f597f481b15d4b9d0fe2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
# add a autobuild message to the HEAD commit

branch=$(git branch --contains HEAD | grep '^\* ' | sed -e 's/^\* //')

if grep -q "^Autobuild\-User($branch): " "$1"; then
	echo "Already marked as tested for $branch"
	exit 0
fi

fullname=$(getent passwd $USER | cut -d: -f5 | cut -d',' -f1)
mailaddr=$(git config user.email)
if test -z "$mailaddr"; then
	mailaddr="$USER@samba.org"
fi
cat <<EOF >>"$1"

Autobuild-User($branch): $fullname <$mailaddr>
Autobuild-Date($branch): $(date) on $(hostname)
EOF
exit 0