3 # This script is run after receive-pack has accepted a pack and the
4 # repository has been updated. It is passed arguments in through stdin
6 # <oldrev> <newrev> <refname>
8 # aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
10 class=`git config zephyr.class`
11 instance=`git config zephyr.instance`
12 zsig=`git config zephyr.zsig`
13 color=`git config --bool zephyr.color`
15 if [ "${color:-true}" = "true" ]; then
21 if [ -z "$zsig" ]; then
22 if [ -e "$GIT_DIR/description" ]; then
23 zsig=`cat "$GIT_DIR/description"`
25 if [ -z "$zsig" ] || \
26 [ "$zsig" = "Unnamed repository; edit this file to name it for gitweb." ] || \
27 [ "$zsig" = "Unnamed repository; edit this file 'description' to name the repository." ]; then
28 zsig=$(basename "$(cd "$GIT_DIR" && pwd)")
29 if [ "$zsig" = ".git" ]; then
30 zsig=$(basename "$(cd "$GIT_DIR/.." && pwd)")
35 if [ -z "$class" ]; then
36 echo "I don't know where to send a commit zephyr!" >&2
37 echo "Please set the zephyr.class config variable in" >&2
38 echo "$PWD/config." >&2
41 while read oldrev newrev refname; do
42 if [ "$oldrev" = "0000000000000000000000000000000000000000" ]; then
44 zwrite -c "$class" -i "${instance:-${refname#refs/heads/}}" -s "$zsig: $refname" -d \
45 -m "New branch $refname created, currently at $newrev."
48 git rev-list --first-parent --reverse "$oldrev..$newrev" | while read rev; do
49 shortrev=`git log -1 --pretty=format:%h "$rev"`
50 (git show --stat -M $usecolor "$rev" |
54 -e 's/
\e\[33m/@color(yellow)/g' \
55 -e 's/
\e\[31m/@color(red)/g' \
56 -e 's/
\e\[32m/@color(green)/g' \
59 zwrite -c "$class" -i "${instance:-$shortrev}" -s "$zsig: $refname" -d