1#!/bin/sh 2# 3# An example hook script to mail out commit update information. 4# Called by git-receive-pack with arguments: refname sha1-old sha1-new 5# 6# To enable this hook: 7# (1) change the recipient e-mail address 8# (2) make this file executable by "chmod +x update". 9# 10 11recipient="commit-list@mydomain.xz" 12 13ifexpr"$2":'0*$'>/dev/null 14then 15echo"Created a new ref, with the following commits:" 16 git-rev-list --pretty"$3" 17else 18$base=$(git-merge-base "$2" "$3") 19if[$base=="$2"];then 20echo"New commits:" 21else 22echo"Rebased ref, commits from common ancestor:" 23fi 24git-rev-list --pretty"$3""^$base" 25fi| 26mail-s"Changes to ref$1""$recipient" 27exit0