git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Correction for post-receive-email

From
APAndy Parkins <andyparkins@gmail.com>
Date
Oct 5, 2007, 14:29 UTC
Message-ID
<200710051529.45440.andyparkins@gmail.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
Previous: Bill Lear
Message 5 of 5 in “Correction for post-receive-email”
  1. Eric MertensOct 5, 2007
  2. Andy ParkinsOct 5, 2007
  3. Andreas EricssonOct 5, 2007
  4. Bill LearOct 5, 2007
  5. Andy ParkinsOct 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.