git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] contrib/hooks/post-receive-email: add a From: line to the email header
@ 2007-11-08  9:48 Gerrit Pape
  2007-11-08  9:55 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Gerrit Pape @ 2007-11-08  9:48 UTC (permalink / raw)
  To: git, Junio C Hamano

$committer is already extracted from the latest existing rev, so add the
corresponding From: line to the email header.

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 contrib/hooks/post-receive-email |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index 3904c18..c73f2d5 100644
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -189,6 +189,7 @@ generate_email_header()
 	# --- Email (all stdout will be the email)
 	# Generate header
 	cat <<-EOF
+	From: $committer
 	To: $recipients
 	Subject: ${emailprefix}$projectdesc $refname_type, $short_refname, ${change_type}d. $describe
 	X-Git-Refname: $refname
-- 
1.5.3.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] contrib/hooks/post-receive-email: add a From: line to the email header
  2007-11-08  9:48 [PATCH] contrib/hooks/post-receive-email: add a From: line to the email header Gerrit Pape
@ 2007-11-08  9:55 ` Junio C Hamano
  2007-11-08 10:35   ` Andreas Ericsson
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Junio C Hamano @ 2007-11-08  9:55 UTC (permalink / raw)
  To: Gerrit Pape; +Cc: git, Andy Parkins

Gerrit Pape <pape@smarden.org> writes:

> $committer is already extracted from the latest existing rev, so add the
> corresponding From: line to the email header.

You may fight this out with Andy if you want to, but I think I'd
side with the existing behaviour.

commit e6dc8d60fbd2c84900a26545c5d360b0e202d95b
Author: Andy Parkins <andyparkins@gmail.com>
Date:   Fri Sep 28 15:24:26 2007 +0100

    post-receive-hook: Remove the From field from the generated email header so that the pusher's name is used
    
    Using the name of the committer of the revision at the tip of the
    updated ref is not sensible.  That information is available in the email
    itself should it be wanted, and by supplying a "From", we were
    effectively hiding the person who performed the push - which is useful
    information in itself.
    
    Signed-off-by: Andy Parkins <andyparkins@gmail.com>
    Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index 1f88099..cbbd02f 100644
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -177,7 +177,6 @@ generate_email_header()
 	# --- Email (all stdout will be the email)
 	# Generate header
 	cat <<-EOF
-	From: $committer
 	To: $recipients
 	Subject: ${EMAILPREFIX}$projectdesc $refname_type, $short_refname, ${change_type}d. $describe
 	X-Git-Refname: $refname

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] contrib/hooks/post-receive-email: add a From: line to the email header
  2007-11-08  9:55 ` Junio C Hamano
@ 2007-11-08 10:35   ` Andreas Ericsson
  2007-11-08 12:11   ` [PATCH] contrib/hooks/post-receive-email: remove cruft, $committer is not used Gerrit Pape
  2008-01-22 14:12   ` [PATCH] contrib/hooks/post-receive-email: add a From: line to the email header Benoit Sigoure
  2 siblings, 0 replies; 5+ messages in thread
From: Andreas Ericsson @ 2007-11-08 10:35 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Gerrit Pape, git, Andy Parkins

Junio C Hamano wrote:
> Gerrit Pape <pape@smarden.org> writes:
> 
>> $committer is already extracted from the latest existing rev, so add the
>> corresponding From: line to the email header.
> 
> You may fight this out with Andy if you want to, but I think I'd
> side with the existing behaviour.
> 

I'm with Andy here, for the reasons stated below.

> commit e6dc8d60fbd2c84900a26545c5d360b0e202d95b
> Author: Andy Parkins <andyparkins@gmail.com>
> Date:   Fri Sep 28 15:24:26 2007 +0100
> 
>     post-receive-hook: Remove the From field from the generated email header so that the pusher's name is used
>     
>     Using the name of the committer of the revision at the tip of the
>     updated ref is not sensible.  That information is available in the email
>     itself should it be wanted, and by supplying a "From", we were
>     effectively hiding the person who performed the push - which is useful
>     information in itself.
>     

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] contrib/hooks/post-receive-email: remove cruft, $committer is not used
  2007-11-08  9:55 ` Junio C Hamano
  2007-11-08 10:35   ` Andreas Ericsson
@ 2007-11-08 12:11   ` Gerrit Pape
  2008-01-22 14:12   ` [PATCH] contrib/hooks/post-receive-email: add a From: line to the email header Benoit Sigoure
  2 siblings, 0 replies; 5+ messages in thread
From: Gerrit Pape @ 2007-11-08 12:11 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Andy Parkins

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 contrib/hooks/post-receive-email |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index 3904c18..7511ea0 100644
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -156,10 +156,6 @@ generate_email()
 	fi
 
 	# Email parameters
-	# The committer will be obtained from the latest existing rev; so
-	# for a deletion it will be the oldrev, for the others, then newrev
-	committer=$(git show --pretty=full -s $rev | sed -ne "s/^Commit: //p" |
-		sed -ne 's/\(.*\) </"\1" </p')
 	# 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)
-- 
1.5.3.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] contrib/hooks/post-receive-email: add a From: line to the email header
  2007-11-08  9:55 ` Junio C Hamano
  2007-11-08 10:35   ` Andreas Ericsson
  2007-11-08 12:11   ` [PATCH] contrib/hooks/post-receive-email: remove cruft, $committer is not used Gerrit Pape
@ 2008-01-22 14:12   ` Benoit Sigoure
  2 siblings, 0 replies; 5+ messages in thread
From: Benoit Sigoure @ 2008-01-22 14:12 UTC (permalink / raw)
  To: Andy Parkins; +Cc: Gerrit Pape, Git Mailing List, tv

On Nov 8, 2007, at 10:55 AM, Junio C Hamano wrote:

> Gerrit Pape <pape@smarden.org> writes:
>
>> $committer is already extracted from the latest existing rev, so  
>> add the
>> corresponding From: line to the email header.
>
> You may fight this out with Andy if you want to, but I think I'd
> side with the existing behaviour.
>
> commit e6dc8d60fbd2c84900a26545c5d360b0e202d95b
> Author: Andy Parkins <andyparkins@gmail.com>
> Date:   Fri Sep 28 15:24:26 2007 +0100
>
>     post-receive-hook: Remove the From field from the generated  
> email header so that the pusher's name is used
>
>     Using the name of the committer of the revision at the tip of the
>     updated ref is not sensible.  That information is available in  
> the email
>     itself should it be wanted, and by supplying a "From", we were
>     effectively hiding the person who performed the push - which is  
> useful
>     information in itself.
>
>     Signed-off-by: Andy Parkins <andyparkins@gmail.com>
>     Signed-off-by: Junio C Hamano <gitster@pobox.com>


Hi guys,
the problem with this change is that when one uses Gitosis all the  
commits are pushed with the `git' user so emails always appear to  
come from git@fqdn.  I guess it would be worth to add an option to  
retain the old behavior (where $committer was extracted from the last  
commit pushed and used in the `From' field), don't you think?

-- 
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-22 14:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-08  9:48 [PATCH] contrib/hooks/post-receive-email: add a From: line to the email header Gerrit Pape
2007-11-08  9:55 ` Junio C Hamano
2007-11-08 10:35   ` Andreas Ericsson
2007-11-08 12:11   ` [PATCH] contrib/hooks/post-receive-email: remove cruft, $committer is not used Gerrit Pape
2008-01-22 14:12   ` [PATCH] contrib/hooks/post-receive-email: add a From: line to the email header Benoit Sigoure

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).