1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/script/commit_mark.sh
Stefan Metzmacher e9f9f37e86 script/commit_mark.sh: add the current branch name
This will be useful once we have autobuild for a v4-0-test
branch and want to cherry-pick commits from master

metze

Autobuild-User(master-autobuild): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master-autobuild): Mi 6. Jun 13:42:53 CEST 2012 on SERNOX11

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Jun  7 01:18:55 CEST 2012 on sn-devel-104
2012-06-07 01:18:55 +02:00

22 lines
524 B
Bash
Executable File

#!/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