zsig=$(invirt-getconf "$base.zsig" 2>/dev/null)
color=$(invirt-getconf "$base.color" 2>/dev/null)
+# Git hooks are always called with PWD == GIT_DIR.
+repo=${PWD#/srv/git/}
+repo=${repo%/.git}
+
if [ "${color:-true}" = "true" ]; then
usecolor="--color"
else
while read oldrev newrev refname; do
if [ "$oldrev" = "0000000000000000000000000000000000000000" ]; then
# dammit git
- zwrite -c "$class" -i "$(basename "$refname")" -s "${zsig:-Git}: $refname" -d \
- -m "New branch created."
+ zwrite -c "$class" -i "$repo" -s "${zsig:-Git}: $refname" -d \
+ -m "New branch ${refname#refs/heads/} created."
continue
fi
git rev-list --first-parent --reverse "$oldrev..$newrev" | while read rev; do
-e 's/\e\[32m/@color(green)/g' \
-e '1s/^/@{/' \
-e '$s/$/}/') |
- zwrite -c "$class" -i "${instance:-$shortrev}" -s "${zsig:-Git}: $refname" -d
+ zwrite -c "$class" -i "${instance:-$repo/$shortrev}" -s "${zsig:-Git}: $refname" -d
done
done