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 base=build.hooks.post_commit.zephyr
12 class=$(invirt-getconf "$base.class" 2>/dev/null)
13 instance=$(invirt-getconf "$base.instance" 2>/dev/null)
14 zsig=$(invirt-getconf "$base.zsig" 2>/dev/null)
15 color=$(invirt-getconf "$base.color" 2>/dev/null)
17 if [ "${color:-true}" = "true" ]; then
23 if [ -z "$class" ]; then
24 echo "I don't know where to send a commit zephyr!" >&2
25 echo "Please provide a value for $base.class in" >&2
26 echo "your invirt config file." >&2
29 while read oldrev newrev refname; do
30 if [ "$oldrev" = "0000000000000000000000000000000000000000" ]; then
32 zwrite -c "$class" -i "$(basename "$refname")" -s "${zsig:-Git}: $refname" -d \
33 -m "New branch created."
36 git rev-list --first-parent --reverse "$oldrev..$newrev" | while read rev; do
37 shortrev=`git log -1 --pretty=format:%h "$rev"`
38 (git show --stat -M $usecolor "$rev" |
42 -e 's/
\e\[33m/@color(yellow)/g' \
43 -e 's/
\e\[31m/@color(red)/g' \
44 -e 's/
\e\[32m/@color(green)/g' \
47 zwrite -c "$class" -i "${instance:-$shortrev}" -s "${zsig:-Git}: $refname" -d