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

Re: [PATCH v2] range-diff: optionally include merge commits' diffs in the analysis

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 12, 2024, 00:29 UTC
Message-ID
<xmqqwmh98fcg.fsf@gitster.g>
In-Reply-To
<CABPp-BFXZ+aaTWGAUhJxh2YYZ131BNYFCyLNVbjntBmStUu0SA@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 12 quoted lines
>> There _may_ need a tweak of the matching algorithm to allow the
>> "same" merge on both sides to match, even if they diverge a lot,
>> though.  A range-diff that pairs a merge in the previous iteration
>> with a single patch in the updated iteration may be hard to read.
>
> Sounds like you are arguing that there is an angle/usecase from which
> `first-parent` makes sense, namely the viewpoint that "a merge is
> merely bringing in lots of changes into the mainline as a single unit"
> as you put it.  What was surprising to me, though, is that it's a
> completely different usecase than the one that was brought up in the
> commit message for this feature, namely "so-called 'evil merges' are
> sometimes necessary and need to be reviewed too".

What I had in mind when I wrote the example you are responding to is based on what sometimes happens while I make repeated merges (and as you may know, I make lots of them). In the first attempt I miss the fact that I need semantic adjustments and then in the second attempt I know what additional changes are necessary in the same merge (i.e. merging exactly the same iteration of the same topic). If you run the first-parent range-diff between one iteration of 'seen' and another, the "additional changes" I would make in the second attempt would be the only thing that will appear in the output, showing the "evil merge".

There can also be updates in the topic itself when I rebuild 'seen', in addition to merge-fixes to adjust for semantic conflicts. Such a change would also appear in the first-parent view. If you used other views, like dense-combined or remerge-diff, these updates in the topic itself may be hidden, as these other views are specifically designed to highlight conflict resolutions and evil merges by discarding mechanically resolvable changes. So it all depends on what you are looking for and what you are deliberately excluding from the lower level of diff generation when you prepare your range-diff, which is a "diff of diff". Giving an impression that first-parent is the most useful may risk misleading readers in that sense.

Previous: Elijah NewrenNext: Johannes Schindelin via GitGitGadget
Message 17 of 21 in “range-diff: optionally include merge commits' diffs in the analysis”
  1. range-diff: optionally include merge commits' diffs in the analysisJohannes Schindelin via GitGitGadget, Nov 7, 2024
  2. Junio C HamanoNov 8, 2024
  3. Johannes SixtNov 8, 2024
  4. Johannes SchindelinNov 8, 2024
  5. Elijah NewrenNov 9, 2024
  6. Junio C HamanoNov 11, 2024
  7. Junio C HamanoNov 8, 2024
  8. Elijah NewrenNov 8, 2024
  9. range-diff: optionally include merge commits' diffs in the analysisJohannes Schindelin via GitGitGadget, Nov 8, 2024
  10. Elijah NewrenNov 8, 2024
  11. Johannes SchindelinNov 11, 2024
  12. Philippe BlainNov 10, 2024
  13. Johannes SchindelinNov 11, 2024
  14. Junio C HamanoNov 26, 2024
  15. Junio C HamanoNov 11, 2024
  16. Elijah NewrenNov 11, 2024
  17. Junio C HamanoNov 12, 2024
  18. 0/2 Support diff merges option in range diffJohannes Schindelin via GitGitGadget, Dec 16, 2024
  19. 1/2 range-diff: optionally include merge commits' diffs in the analysisJohannes Schindelin via GitGitGadget, Dec 16, 2024
  20. 2/2 range-diff: introduce the convenience option `--remerge-diff`Johannes Schindelin via GitGitGadget, Dec 16, 2024
  21. Elijah NewrenNov 8, 2024

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.