I don't trust test's boolean operators.
[invirt/scripts/git-hooks.git] / sub / zephyr-post-receive
index 7e06b30..0dfa83b 100755 (executable)
@@ -25,9 +25,15 @@ if [ -z "$class" ]; then
   exit 1
 fi
 while read oldrev newrev refname; do
-  git-rev-list --reverse "$oldrev..$newrev" | while read rev; do
+  if [ "$oldrev" = "0000000000000000000000000000000000000000" ]; then
+    # dammit git
+    zwrite -c "$class" -i "$(basename "$refname")" -s "${zsig:-Git}: $refname" -d \
+      -m "New branch created."
+    continue
+  fi
+  git rev-list --first-parent --reverse "$oldrev..$newrev" | while read rev; do
     shortrev=`git log -1 --pretty=format:%h "$rev"`
-    (git show --stat $usecolor "$rev" |
+    (git show --stat -M $usecolor "$rev" |
      sed -e 's/@/@@/g' \
          -e 's/}/@(})/g' \
          -e 's/\e\[m/}@{/g' \