[gnus git] branch master updated: n0-17-397-g4836a8f =1= * post-receive: Get the user name and e-mail correctly.

Ted Zlatanov <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  4836a8fef7468ca1eb9202a80a2d4e4d70ce8324 (commit)
      from  0d6645e3f9fbf6c51b42fcf1bcde60057b9d1a85 (commit)


- Log -----------------------------------------------------------------
commit 4836a8fef7468ca1eb9202a80a2d4e4d70ce8324
Author: Ted Zlatanov <[email protected]>
Date:   Tue Nov 22 05:48:45 2011 -0500

    * post-receive: Get the user name and e-mail correctly.

diff --git a/etc/ChangeLog b/etc/ChangeLog
index a127951..12c6500 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-22  Teodor Zlatanov  <[email protected]>
+
+	* post-receive: Get the user name and e-mail correctly.
+
 2011-02-25  Teodor Zlatanov  <[email protected]>
 
 	* post-receive: Always show the commit messages and the "git describe"
diff --git a/etc/post-receive b/etc/post-receive
index 5714dcc..db59bd1 100755
--- a/etc/post-receive
+++ b/etc/post-receive
@@ -2,11 +2,6 @@
 
 # modified: 2010-09-01 and on by [email protected]
 
-# 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

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 etc/ChangeLog    |    4 ++++
 etc/post-receive |   10 +++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.