# Correction for post-receive-email

5 messages from 2007-10-05 to 2007-10-05. Participants: Eric Mertens, Andy Parkins, Andreas Ericsson, Bill Lear.
Thread: https://gitlist.dev/t/10154

## Eric Mertens, 2007-10-05 07:14

Subject: Correction for post-receive-email
Message-ID: <449c8cfc0710050014j9bbf057ka108ee27dea49a89@mail.gmail.com>
URL: https://gitlist.dev/e/449c8cfc0710050014j9bbf057ka108ee27dea49a89%40mail.gmail.com

```
Hello,

(My apologies if my incorrectly addressed subscribe message went to the list)

I noticed that my mutt wasn't correctly detecting the signature block
on the end of the automated emails I was receiving from the script in
contrib. I've made this trivial change in my local copy of the script,
but I figured that if I was going to be modifying the source code I
should share my changes.

-- 
Eric Mertens


From 119f84fa6f6bb33c6fc524ab4277d38bebc10468 Mon Sep 17 00:00:00 2001
From: Eric Mertens <emertens@gmail.com>
Date: Fri, 5 Oct 2007 00:06:52 -0700
Subject: [PATCH] Correct signature block delimiter in post-receive-email by adding a trailing space

This change allows mail clients like Mutt to easily detect the signature
and is consistent with the signature block article on Wikipedia.
---
 contrib/hooks/post-receive-email |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/hooks/post-receive-email b/contrib/hooks/post-receive-email
index cbbd02f..828651a 100644
--- a/contrib/hooks/post-receive-email
+++ b/contrib/hooks/post-receive-email
@@ -198,7 +198,7 @@ generate_email_footer()
 
 
 	hooks/post-receive
-	--
+	-- 
 	$projectdesc
 	EOF
 }
-- 
1.5.3.4


```

## Andy Parkins, 2007-10-05 08:13

Subject: Re: Correction for post-receive-email
Message-ID: <200710050913.58835.andyparkins@gmail.com>
URL: https://gitlist.dev/e/200710050913.58835.andyparkins%40gmail.com
In-Reply-To: <449c8cfc0710050014j9bbf057ka108ee27dea49a89@mail.gmail.com>

```
On Friday 2007 October 05, Eric Mertens wrote:

> I noticed that my mutt wasn't correctly detecting the signature block
> on the end of the automated emails I was receiving from the script in
> contrib. I've made this trivial change in my local copy of the script,
> but I figured that if I was going to be modifying the source code I
> should share my changes.

That change has been in my pending queue for a while.  It's technically 
correct, but I've never submitted it.  The reason I haven't is that it adds 
trailing whitespace.

Perhaps one of the shell gurus can offer a nicer way of having a trailing 
space be output in a heredoc that doesn't add a trailing space in the source 
script?


Andy

-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

```

## Andreas Ericsson, 2007-10-05 08:54

Subject: Re: Correction for post-receive-email
Message-ID: <4705FBAA.50302@op5.se>
URL: https://gitlist.dev/e/4705FBAA.50302%40op5.se
In-Reply-To: <200710050913.58835.andyparkins@gmail.com>

```
Andy Parkins wrote:
> On Friday 2007 October 05, Eric Mertens wrote:
> 
>> I noticed that my mutt wasn't correctly detecting the signature block
>> on the end of the automated emails I was receiving from the script in
>> contrib. I've made this trivial change in my local copy of the script,
>> but I figured that if I was going to be modifying the source code I
>> should share my changes.
> 
> That change has been in my pending queue for a while.  It's technically 
> correct, but I've never submitted it.  The reason I haven't is that it adds 
> trailing whitespace.
> 
> Perhaps one of the shell gurus can offer a nicer way of having a trailing 
> space be output in a heredoc that doesn't add a trailing space in the source 
> script?
> 

space=' '

cat << EOF
--$space
EOF

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

```

## Bill Lear, 2007-10-05 12:35

Subject: Re: Correction for post-receive-email
Message-ID: <18182.12163.311826.242309@lisa.zopyra.com>
URL: https://gitlist.dev/e/18182.12163.311826.242309%40lisa.zopyra.com
In-Reply-To: <200710050913.58835.andyparkins@gmail.com>

```
On Friday, October 5, 2007 at 09:13:57 (+0100) Andy Parkins writes:
>On Friday 2007 October 05, Eric Mertens wrote:
>
>> I noticed that my mutt wasn't correctly detecting the signature block
>> on the end of the automated emails I was receiving from the script in
>> contrib. I've made this trivial change in my local copy of the script,
>> but I figured that if I was going to be modifying the source code I
>> should share my changes.
>
>That change has been in my pending queue for a while.  It's technically 
>correct, but I've never submitted it.  The reason I haven't is that it adds 
>trailing whitespace.
>
>Perhaps one of the shell gurus can offer a nicer way of having a trailing 
>space be output in a heredoc that doesn't add a trailing space in the source 
>script?

I have a few changes I would like to see in this script, ones that I think
would make it generally more useful.  I don't have a clean patch, though,
so should I just submit suggestions to you directly, Andy?


Bill

```

## Andy Parkins, 2007-10-05 14:29

Subject: Re: Correction for post-receive-email
Message-ID: <200710051529.45440.andyparkins@gmail.com>
URL: https://gitlist.dev/e/200710051529.45440.andyparkins%40gmail.com
In-Reply-To: <18182.12163.311826.242309@lisa.zopyra.com>

```
On Friday 2007 October 05, Bill Lear wrote:

> I have a few changes I would like to see in this script, ones that I think
> would make it generally more useful.  I don't have a clean patch, though,
> so should I just submit suggestions to you directly, Andy?

Me; or the list. Or both.

I'm happy to try to accommodate any suggestions.  I'm happy if it is useful to 
anyone other than just me :-)


--- SNIP THIS BIT IF YOU'RE NOT INTERESTED IN ITS BUGS ---
The big fault in it as it stands is that it doesn't try to reorder the refs 
being updated to the most logical form.  For example:

 O --- * --- A (ref2)
              \
               B (ref1)

Let's say that both ref1 and ref2 were originally at O and this push has moved 
them to these new locations.  The email hook gets sent this information like 
this:

 refs/heads/ref1 O B
 refs/heads/ref2 O A

The hook iterates through this list, for each ref update it shows only the 
commits introduced by the change that aren't already included in an existing 
ref.  This is the problem, ref2 introduced "*" and "A" and ref1 
introduced "B",  ideally then the two emails would show

 ref2 updated from O to A
   new revs: *, A
 ref1 updated from O to B
   new revs: B

But because ref1 is alphabetically before ref1, what you get is:

 ref1 updated from O to B
   new revs: *, A, B
 ref2 updated from O to A
   new revs: <none>

I can't say I know what the answer is; nor even what the correct output should 
be.  If anyone has opinions on this, I'll be glad to hear them.


Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

```
