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, 01:18 UTC
Message-ID
<Pine.LNX.4.64.0605081805290.3718@g5.osdl.org>
In-Reply-To
<4fb292fa0605081755m22e8239cjda0b1ac74b84c0d9@mail.gmail.com>
On Tue, 9 May 2006, Bertrand Jacquin wrote:
Show 9 quoted lines
> On 5/9/06, Linus Torvalds <torvalds@osdl.org> wrote:
> > 
> > Ie you could probably more easily parse the data from something like
> > 
> >         git show -B --patch-with-stat --pretty=fuller $commit
> > 
> 
> Is there a way to track merge like that ? Documentation is not very
> clear and near from empty.
Sure.

If you want to track merges and get their patches, add the "--cc" flag, which tells git to use the "conflict combination patch" that shows any visible conflicts.

(NOTE NOTE NOTE! This is _not_ the same as showing what conflicted: if you edited the result to match one of the original branches, it will be quiet in --cc, but if the result of a conflict was something that was in _neither_ branch, it will be shown! So most clean merges will not show any conflict diff at all, but the diffstat will be shown against the "first parent").

And you probably don't want to abbreviate the parent commit SHA1's (which are shown for merges, but not regular commits), so add "--no-abbrev".

If you want to show parents for _all_ commits, you could do something like
  git show --no-abbrev --cc -C --patch-with-stat --pretty=fuller --parents |
	sed '1 s/commit [0-9a-f]*/\0\nParents:   / ; /^Merge: / d'

which removes a potential "Merge: " line in favour of listing the parents on a "Parents:" line, and which also shows merges nicely.

That said, the diffstat for merges is usually just a lot of noise. It's sometimes nice (you've merged from a topic branch), but if you have merged from the mainline _into_ a topic branch, it's just annoying.

So the above is just a wild suggestion. Caveat emptor.
		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 23 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.