X-Git-Url: http://cgit.sxemacs.org/?p=gnus;a=blobdiff_plain;f=etc%2Fpost-receive;h=db59bd1e0b1fc77d9bfa98c29080340de123edfa;hp=0b307eaea4155886202e5b0d5d2a9c7480e81499;hb=997404c721a1de533aa9f82d4d5bbc5447bfc23d;hpb=4d3a4f3c472122432af2b8755585368d830d5ce9 diff --git a/etc/post-receive b/etc/post-receive index 0b307eaea..db59bd1e0 100755 --- a/etc/post-receive +++ b/etc/post-receive @@ -1,17 +1,13 @@ #!/bin/sh -# 2010-09-01 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) +# modified: 2010-09-01 and on by tzz@lifelogs.com # the remainder is the standard git-core post-receive-email with some changes: # - USER_EMAIL and USER_NAME are used in the header # - the update message is after the diff # - without annotations, we use `git log --format=oneline' to generate the change summary (joining multiples with semicolons) -# - the subject is shorter and prefixed with [gnus git] always +# - the subject is shorter # Copyright (c) 2007 Andy Parkins # @@ -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 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,12 +209,17 @@ 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 From: ${USER_NAME} <${USER_EMAIL}> To: $recipients - Subject: [gnus git] $refname_type $short_refname ${change_type}d: $describe + Subject: $emailprefix $refname_type $short_refname ${change_type}d: $describe X-Git-Refname: $refname X-Git-Reftype: $refname_type X-Git-Oldrev: $oldrev