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

Re: git-feed-mail-list.sh

From
Linus Torvalds <torvalds@osdl.org>
Date
May 9, 2006, 03:06 UTC
Message-ID
<Pine.LNX.4.64.0605081951390.3718@g5.osdl.org>
In-Reply-To
<7vwtcvc42s.fsf@assigned-by-dhcp.cox.net>
On Mon, 8 May 2006, Junio C Hamano wrote:
Show 13 quoted lines
> "Bertrand Jacquin" <beber.mailing@gmail.com> writes:
> 
> > But I would like to send an email after merge to inform people that:
> >
> > o tree ``a'' and ``b'' have been merged.
> > o made by John Doe at a time
> > o show a diffstat.
> > o show a --short-log=oneline from merge base.
> 
> Forgetting about a fast-forward merge,  (1) and (2) are
> available in the commit header and the commit log, so is (4) if
> you enable merge.summary configuration like Linus does in his
> kernel repository.

NOTE! Please don't enable "merge.summary" if you ever merge from the upstream tree. That just looks ugly. Your merge messages will be just filled with crap that has nothing to do with your tree - and everything to do with all the _unrelated_ normal development that happened in the tree.

So in general, "merge.summary" makes sense only for trees that pull from downstreams, and never merge with anything upstream. My tree obviously does that for the kernel. Think of it as a "top-level maintainer" flag, although it works find also for sub-maintainers as long as they synchronize upwards _purely_ by being pulled from, not by pulling.

But if you want to get it for any random merges, you can always just do
	git log -11 --pretty=oneline ^$commit^ $commit^@ |
		sed 's/[0-9a-f]* // ; 11 s/.*/\.\.\./' 

which will show up to the ten first commits that were merged (and turn the eleventh one, if it exists, into "..." - that's a pretty disgusting trick to make it show when you left things out).

That "^$commit^ $commit^@" part is important. It may look like some deranged git smiley, but it does exactly what you want it to do: take all the parents of the commit, but ignore any commit reachable from the first one (the "mainline" of the person who did the commit).

The ^@ syntax is obviously pretty new, so it requires a modern git.
		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 21 of 24 in “git-feed-mail-list.sh”
  1. David WoodhouseMay 3, 2006
  2. Junio C HamanoMay 4, 2006
  3. Junio C HamanoMay 4, 2006
  4. David WoodhouseMay 8, 2006
  5. Linus TorvaldsMay 9, 2006
  6. David WoodhouseMay 9, 2006
  7. Junio C HamanoMay 9, 2006
  8. Bertrand JacquinMay 9, 2006
  9. Junio C HamanoMay 9, 2006
  10. Bertrand JacquinMay 9, 2006
  11. Linus TorvaldsMay 9, 2006
  12. David WoodhouseMay 9, 2006
  13. Junio C HamanoMay 9, 2006
  14. David WoodhouseMay 9, 2006
  15. Martin MaresMay 10, 2006
  16. Linus TorvaldsMay 9, 2006
  17. Bertrand JacquinMay 9, 2006
  18. Junio C HamanoMay 9, 2006
  19. Bertrand JacquinMay 9, 2006
  20. Junio C HamanoMay 9, 2006
  21. Linus TorvaldsMay 9, 2006
  22. Junio C HamanoMay 9, 2006
  23. Linus TorvaldsMay 9, 2006
  24. Junio C HamanoMay 9, 2006

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.