Update the zephyr-post-receive hook from the snippets locker.
authorEvan Broder <broder@mit.edu>
Mon, 12 Oct 2009 06:16:30 +0000 (02:16 -0400)
committerEvan Broder <broder@mit.edu>
Mon, 12 Oct 2009 06:16:30 +0000 (02:16 -0400)
svn path=/trunk/scripts/git-hooks/; revision=2502

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
   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"`
     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' \
      sed -e 's/@/@@/g' \
          -e 's/}/@(})/g' \
          -e 's/\e\[m/}@{/g' \