X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=etc%2Fpost-receive;h=db59bd1e0b1fc77d9bfa98c29080340de123edfa;hp=421db3e757134334ee8df00effd59e8de150ea32;hb=997404c721a1de533aa9f82d4d5bbc5447bfc23d;hpb=d02a8ab72d703d2e5954a298754145f71bf8c166 diff --git a/etc/post-receive b/etc/post-receive index 421db3e75..db59bd1e0 100755 --- a/etc/post-receive +++ b/etc/post-receive @@ -2,10 +2,6 @@ # modified: 2010-09-01 and on by tzz@lifelogs.com -# Use the email address of the author of the last commit. -export USER_EMAIL=$(git log -1 --format=format:%ae HEAD) -export USER_NAME=$(git log -1 --format=format:%an HEAD) - # the remainder is the standard git-core post-receive-email with some changes: # - USER_EMAIL and USER_NAME are used in the header @@ -181,9 +177,13 @@ generate_email() # Email parameters # The email subject will contain the best description of the ref # 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_commit=$( (git log --format="%s" $oldrev...$newrev | perl -e'@p = <>; chomp @p; print "=", scalar @p, "= ", join(" ; ", @p)') 2>/dev/null) + describe_last=$(git describe $rev 2>/dev/null) + + if [ -z "$describe_last" ]; then + describe=$describe_commit + else + describe="$describe_last $describe_commit" fi if [ -z "$describe" ]; then @@ -209,6 +209,11 @@ generate_email() generate_email_header() { + + # Use the email address of the author of the last commit. + export USER_EMAIL=$(git log -1 $short_refname --format=format:%ce HEAD) + export USER_NAME=$(git log -1 $short_refname --format=format:%cn HEAD) + # --- Email (all stdout will be the email) # Generate header cat <<-EOF