Small post-receive fixes.
authorTed Zlatanov <tzz@lifelogs.com>
Fri, 18 Feb 2011 11:44:06 +0000 (05:44 -0600)
committerTed Zlatanov <tzz@lifelogs.com>
Fri, 18 Feb 2011 11:44:06 +0000 (05:44 -0600)
* post-receive: Fix $(( bug.  Note that the user name and address are
incorrect if the last commit was on a branch.

etc/ChangeLog
etc/post-receive

index f8b781d..775c3a4 100644 (file)
@@ -1,3 +1,8 @@
+2011-02-18  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * post-receive: Fix $(( bug.  Note that the user name and address are
+       incorrect if the last commit was on a branch.
+
 2010-11-22  Julien Danjou  <julien@danjou.info>
 
        * post-receive: Use commiter name and email address.
 2010-11-22  Julien Danjou  <julien@danjou.info>
 
        * post-receive: Use commiter name and email address.
index aacd6ef..ebd230c 100755 (executable)
@@ -3,6 +3,7 @@
 # modified: 2010-09-01 and on by tzz@lifelogs.com
 
 # Use the email address of the author of the last commit.
 # modified: 2010-09-01 and on by tzz@lifelogs.com
 
 # Use the email address of the author of the last commit.
+# This fails if the commit is on a branch.
 export USER_EMAIL=$(git log -1 --format=format:%ce HEAD)
 export USER_NAME=$(git log -1 --format=format:%cn HEAD)
 
 export USER_EMAIL=$(git log -1 --format=format:%ce HEAD)
 export USER_NAME=$(git log -1 --format=format:%cn HEAD)
 
@@ -183,7 +184,7 @@ generate_email()
        # that we can build from the parameters
        describe=$(git describe $rev 2>/dev/null)
        if [ -z "$describe" ]; then
        # that we can build from the parameters
        describe=$(git describe $rev 2>/dev/null)
        if [ -z "$describe" ]; then
-               describe=$((git log --format="%s" $oldrev...$newrev | perl -e'@p = <>; chomp @p; print "=", scalar @p, "= ", join(" ; ", @p)') 2>/dev/null)
+               describe=$( (git log --format="%s" $oldrev...$newrev | perl -e'@p = <>; chomp @p; print "=", scalar @p, "= ", join(" ; ", @p)') 2>/dev/null)
        fi
 
        if [ -z "$describe" ]; then
        fi
 
        if [ -z "$describe" ]; then