3 # Called by git-receive-pack with arguments: refname sha1-old sha1-new
7 recipient="sherlock-commits@host2.netcentrum.cz"
9 branch=${1#refs/heads/}
10 if [ "$branch" == "$1" ] ; then
11 # Not something we care about
14 if [ $branch == origin ] ; then
15 # We are not following the origin
19 out=`mktemp -t gitlog.XXXXXXX`
20 if [ $branch == master ] ; then
27 if expr "$2" : '0*$' >/dev/null ; then
28 echo "Created a new branch $branch, with the following commits:"
30 git-rev-list --pretty --max-count=20 "$3"
31 echo "(and possibly more)"
33 base=$(git-merge-base "$2" "$3")
36 echo "New commits to branch $branch:"
39 echo "Rebased branch $branch, commits from common ancestor:"
43 git-rev-list --pretty "$3" "^$base"
45 t=`mktemp -t gitlog.XXXXXXX`
46 git-diff --name-only -r "$base" "$3" >$t
48 if [ ${#subj} -lt 80 ] ; then
56 mutt -x -e 'set charset="utf-8"; set allow_8bit=no; set send_charset="utf-8"' -s "$subj" "$recipient" <$out