]> snippets.scripts.mit.edu Git - Scripts/git/.git/blobdiff - git-hooks/zephyr-post-receive
git-hooks/zephyr-post-receive: Use --first-parent when listing commits.
[Scripts/git/.git] / git-hooks / zephyr-post-receive
index 7e06b30b72578ed000690b663b4b1674047ac82d..bd06fe45edadd62440ec867ec59f9505110451de 100755 (executable)
@@ -25,7 +25,13 @@ 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" |
      sed -e 's/@/@@/g' \