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

Re: [PATCH] Convert emailing part of hooks--update to hooks--post-receive

From
APAndy Parkins <andyparkins@gmail.com>
Date
Mar 25, 2007, 08:51 UTC
Message-ID
<200703250951.04503.andyparkins@gmail.com>
In-Reply-To
<7vfy7tajiz.fsf@assigned-by-dhcp.cox.net>
On Sunday 2007, March 25, Junio C Hamano wrote:
> I think you can do something along the following line.
>
>  (1) You say "for-each-ref --all" to get the ref information
>      that is after update.

Would you mind if I delayed that to a separate patch? It's a significant difference from the original update hook, so I think it's worth having that change separately documented.

> Sorry, what I meant was:
>
> 	git show -s --pretty=oneline "$oldrev"
Ah - no problem.  Done.
> Actually it was not quite "nicely done".  If taggername has an
> unusual character then dq pair you hard coded there may not
> quote the string correctly.
Devious.  Fixed as you suggest.
Show 9 quoted lines
> > (Andreas Ericsson   54)  prev=$(git describe "$3^" | sed
> > 's/-g.*//')
>
> You could describe all the parents and see if they differ.  If
> they reach different tag, we could see which one is newer.  Or
> something like that.  In the special (but usual) case of a
> single parent commit, "describing all the parents" is what you
> are already doing, so it is not any more expensive in the normal
> case.

Again; I think I'll fix that one as a separate patch as it is a change from the behaviour of hooks/update.

> Please do not have cat on either side of a pipe.  That makes a
> shell script look ... eh, you know the word ;-).
>
> 	sed -e 1q "$GIT_DIR/description"

Done. I've taken the liberty of adding a pipe-to-cat, that I hope you'll forgive...

# Output to the terminal in command line mode - if someone wanted to
# resend an email; they could redirect the output to sendmail themselves
  generate_email $2 $3 $1 | cat

This is to force the deactivation of the pager for all the git commands that generate_email calls.

Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 11 in “Convert emailing part of hooks--update to hooks--post-receive”
  1. Convert emailing part of hooks--update to hooks--post-receiveAndy Parkins, Mar 23, 2007
  2. Junio C HamanoMar 24, 2007
  3. Andy ParkinsMar 24, 2007
  4. Linus TorvaldsMar 24, 2007
  5. Junio C HamanoMar 25, 2007
  6. Junio C HamanoMar 25, 2007
  7. Junio C HamanoMar 25, 2007
  8. Andy ParkinsMar 25, 2007
  9. Junio C HamanoMar 25, 2007
  10. Reimplement emailing part of hooks--update in contrib/hooks/post-receive-emailAndy Parkins, Mar 30, 2007
  11. Jakub NarebskiMar 31, 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.