From d24fb92a0425e0ce070443bfeaa4b23144b83edf Mon Sep 17 00:00:00 2001 From: Ted Zlatanov Date: Fri, 18 Feb 2011 05:44:06 -0600 Subject: [PATCH] Small post-receive fixes. * post-receive: Fix $(( bug. Note that the user name and address are incorrect if the last commit was on a branch. --- etc/ChangeLog | 5 +++++ etc/post-receive | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index f8b781dd4..775c3a4a8 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2011-02-18 Teodor Zlatanov + + * 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 * post-receive: Use commiter name and email address. diff --git a/etc/post-receive b/etc/post-receive index aacd6ef7b..ebd230ca8 100755 --- a/etc/post-receive +++ b/etc/post-receive @@ -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. +# 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) @@ -183,7 +184,7 @@ generate_email() # 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 -- 2.25.1