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

Re: Distinguishing trivial and non-trivial merge commits

From
Jonathan Nieder <jrnieder@gmail.com>
Date
May 2, 2010, 18:18 UTC
Message-ID
<20100502181854.GC16051@progeny.tock>
In-Reply-To
<19419.1721.763210.679444@winooski.ccs.neu.edu>
Eli Barzilay wrote:
Show 9 quoted lines
> Using `--no-merges' helps in
> avoiding the confusing parts, but that's dangerous in omitting
> non-trivial merges too -- and those are probably even more worth
> noting than other changes (just because they'll highlights changes
> that are "hotter" in the sense of more people working on that code).
> 
> The only way I've seen to distinguish the two is to use `git show' and
> see if there is no diff output (eg, "git show --pretty=format: $rev").
> But that doesn't help in getting the list of modified files.
Maybe --name-only or --name-status can help.

Note that most conflicts will not show up here: if the merge result matches either parent, then git diff --cc and friends will not consider it interesting at all. A command to list conflicts and their resolutions would be expensive but valuable, I think. A naïve implementation would involve redoing the merge.

[...]
> Is there *any* way to get `git diff --stat' to do the same thing that
> `git show' does?  (Or a way to get `git show --stat' not show all
> files again...)

A “merge diffstat” sounds like an interesting idea, but the detailed semantics are not obvious to me (maybe separate counts for nontrivial added and removed lines from each parent?).

Thanks for the food for thought, Jonathan

Previous: Eli BarzilayNext: Eli Barzilay
Message 2 of 8 in “Distinguishing trivial and non-trivial merge commits”
  1. Eli BarzilayApr 30, 2010
  2. Jonathan NiederMay 2, 2010
  3. Eli BarzilayMay 2, 2010
  4. Jakub NarebskiMay 2, 2010
  5. Eli BarzilayMay 2, 2010
  6. Junio C HamanoMay 2, 2010
  7. Eli BarzilayMay 2, 2010
  8. Jonathan NiederMay 2, 2010

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.