Merge with gitk.
[git.git] / templates / hooks--update
1 #!/bin/sh
2 #
3 # An example hook script to mail out commit update information.
4 #
5 # To enable this hook:
6 # (1) change the recipient e-mail address
7 # (2) make this file executable by "chmod +x update".
8 #
9
10 recipient="commit-list@mydomain.xz"
11
12 if expr "$2" : '0*$' >/dev/null
13 then
14         echo "Created a new ref, with the following commits:"
15         git-rev-list --pretty "$2"
16 else
17         echo "New commits:"
18         git-rev-list --pretty "$3" "^$2"
19 fi |
20 mail -s "Changes to ref $1" "$recipient"
21 exit 0