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

Re: Determining if a merge was produced automatically

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 1, 2024, 18:16 UTC
Message-ID
<xmqqbk3hx9ik.fsf@gitster.g>
In-Reply-To
<CAChcVu=bWR_DvR==b7L0tn8PmK+9KOWWw+e7RtjMhywMv3W+qA@mail.gmail.com>
Pavel Rappo <pavel.rappo@gmail.com> writes:
> it for such merge commits produced automatically because of the
> assumption that nothing bad can happen there.

I do not think that assumption holds in the first place, though. A typical and often cited example is when one side changed a helper function's behaviour while the other side added new callers to the helper function, still assuming the original behaviour. In such a case there may not even be an textual conflict but the end results may be broken, and if the breakage is subtle, it may take weeks or months before somebody notices such a semantic mismerge.

Your "review a conflicted-and-resolved merge on one integration branch once, and skip the re-review as long as the resolution is the same way as the original one when the same branch gets merged into another integration branch" is a neat idea (and the integration branches we have in our project are run more-or-less like that).

But there, you'd need more than "both are cleanly auto-merged"; more like "both may have conflicted but they are resolved the same way" is what you are interested, no? Since at that point, your primary interest shouldn't be "does it cleanly auto-merge?" but "do these two merges do the same thing?", determining if a merge was created automatically becomes a problem you do not need to solve, or solving it would not further your true goal.

If you have two integration branches A and B, and a topic branch T first gets merged to A and then after proving its worth it gets merged down to B, I wonder if you can verify somebody's merge of B into T by comparing the result with your "verification merge", which you preform locally and on a throw-away branch by using "git rebase --rebase-merges" or some mechanism, to replay the original merge of T into A on top of B (before the merge of T you are verifying).

Previous: Pavel RappoNext: Pavel Rappo
Message 7 of 11 in “Determining if a merge was produced automatically”
  1. Pavel RappoJun 30, 2024
  2. Jonathan NiederJul 1, 2024
  3. Pavel RappoJul 1, 2024
  4. Junio C HamanoJul 1, 2024
  5. Junio C HamanoJul 1, 2024
  6. Pavel RappoJul 1, 2024
  7. Junio C HamanoJul 1, 2024
  8. Pavel RappoJul 1, 2024
  9. Martin von ZweigbergkJul 1, 2024
  10. Elijah NewrenJul 1, 2024
  11. Pavel RappoJul 1, 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.