From 4836a8fef7468ca1eb9202a80a2d4e4d70ce8324 Mon Sep 17 00:00:00 2001 From: Ted Zlatanov Date: Tue, 22 Nov 2011 05:48:45 -0500 Subject: [PATCH] * post-receive: Get the user name and e-mail correctly. --- etc/ChangeLog | 4 ++++ etc/post-receive | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/etc/ChangeLog b/etc/ChangeLog index a127951fe..12c65005d 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2011-11-22 Teodor Zlatanov + + * post-receive: Get the user name and e-mail correctly. + 2011-02-25 Teodor Zlatanov * post-receive: Always show the commit messages and the "git describe" diff --git a/etc/post-receive b/etc/post-receive index 5714dccbf..db59bd1e0 100755 --- a/etc/post-receive +++ b/etc/post-receive @@ -2,11 +2,6 @@ # 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) - # the remainder is the standard git-core post-receive-email with some changes: # - USER_EMAIL and USER_NAME are used in the header @@ -214,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 -- 2.25.1