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

Feature request: a merge strategy that makes any file difference a merge conflict

From
MEMichael Ernst <mernst@cs.washington.edu>
Date
Mar 29, 2024, 19:20 UTC
Message-ID
<CAAJCdQQB3_DWOTCTbb-TAkLUX_XVd5TBd3z0M2_KrHxKxr69Kw@mail.gmail.com>

Git's built-in merge strategies, such as ort, sometimes create a clean-but-incorrect merge. A merge driver or a mergetool cannot be used to correct such problems, because a merge driver or mergetool is only called when the strategy resulted in a conflict (so far as I understand). It is challenging to write a merge strategy, but it is much easier to write a merge driver or a mergetool.

If git had a strategy that always caused a merge conflict (even when the differences are mergeable), then a merge driver or mergetool would be called on every file difference. This effectively permits a user to completely replace git's merge strategy, without the difficulty of writing a merge strategy.

I realize that the proposed strategy would likely only create merge conflicts when no two of {parent1,parent2,base} are the same -- that is, only when the low-level merge driver `git merge-file` is called. That is fine with me.

What do you think of this feature request?

Thanks in advance, -Mike

Next: Junio C Hamano
Message 1 of 4 in “Feature request: a merge strategy that makes any file difference a merge conflict”
  1. Michael ErnstMar 29, 2024
  2. Junio C HamanoMar 29, 2024
  3. Michael ErnstMar 29, 2024
  4. Thomas BraunApr 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.