]> sipb.mit.edu Git - snippets/.git/blobdiff - git-hooks/zephyr-post-receive
Update the git post-receive hook for git's new default description.
[snippets/.git] / git-hooks / zephyr-post-receive
index 38f211e4aa010cb5bda5606bbd7df61a075aa39f..71e96bccad9f2e057d733eef73bc687d58a21ca6 100755 (executable)
@@ -22,7 +22,9 @@ if [ -z "$zsig" ]; then
     if [ -e "$GIT_DIR/description" ]; then
         zsig=`cat "$GIT_DIR/description"`
     fi
-    if [ -z "$zsig" ] || [ "$zsig" = "Unnamed repository; edit this file to name it for gitweb." ]; then
+    if [ -z "$zsig" ] || \
+        [ "$zsig" = "Unnamed repository; edit this file to name it for gitweb." ] || \
+        [ "$zsig" = "Unnamed repository; edit this file 'description' to name the repository." ]; then
         zsig=$(basename "$(readlink -f "$GIT_DIR")")
         if [ "$zsig" = ".git" ]; then
             zsig=$(basename "$(readlink -f "$GIT_DIR/..")")
@@ -39,8 +41,8 @@ fi
 while read oldrev newrev refname; do
   if [ "$oldrev" = "0000000000000000000000000000000000000000" ]; then
     # dammit git
-    zwrite -c "$class" -i "$(basename "$refname")" -s "$zsig: $refname" -d \
-      -m "New branch created."
+    zwrite -c "$class" -i "${instance:-${refname#refs/heads/}}" -s "$zsig: $refname" -d \
+      -m "New branch $refname created, currently at $newrev."
     continue
   fi
   git rev-list --first-parent --reverse "$oldrev..$newrev" | while read rev; do