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

Re: Request for adding a "clean" merge strategy for a double-commit merge to deal with conflicts separately

From
Elijah Newren <newren@gmail.com>
Date
Jul 21, 2020, 17:08 UTC
Message-ID
<CABPp-BE2R3eUU7WD1Ovkn_OfVH6fc42DnXs5CuBTkMUcQsnCdQ@mail.gmail.com>
In-Reply-To
<CAD9n_qh0y84HC6sX1OxXWWv8dDMMA_tPv9zRknePVivQq_rfww@mail.gmail.com>
On Thu, Jul 16, 2020 at 10:17 AM Alireza <rezaxm@gmail.com> wrote:
Show 16 quoted lines
>
> Hi,
>
> Even though the merge commit's message includes conflicted files by
> default, the *resolution* itself is lost, that is, it's hard or
> impossible to review how the author *resolved* said conflicts.
>
> The proposal is that an option like `-X clean` would commit a clean
> merge and leave out any conflicting hunks in the tree for a follow-up
> commit to resolve conflicts.
>
> That would be extremely helpful for a code reviewer to see how a
> possibly external contributor has dealt with upstream changes e.g. in
> a long-standing branch.
>
> Any comment would be appreciated.

I disagree that they are "lost". Rather, git doesn't make them very easy to access: git log -p won't show you any output for a merge by default, and the only options that exist (-c, -cc) don't do what you need to see how conflicts were resolved. Thus, the only way to get them would be to check out the first parent of the merge, do a merge with the second parent, then do a "git diff -R $merge_commit". That's doable, it's just annoying.

If there were an option to allow git log for a merge to show the difference between what an automatic merge would do (complete with conflicts) and the end-state that was committed, then the resolution would become very accessible and the rest of your request would be moot. See https://bugs.chromium.org/p/git/issues/detail?id=12. I'm getting closer to having such a thing.

Elijah
Previous: AlirezaNext: Alireza
Message 5 of 8 in “Request for adding a "clean" merge strategy for a double-commit merge to deal with conflicts separately”
  1. AlirezaJul 16, 2020
  2. Michal SuchánekJul 16, 2020
  3. Junio C HamanoJul 16, 2020
  4. AlirezaJul 21, 2020
  5. Elijah NewrenJul 21, 2020
  6. AlirezaJul 21, 2020
  7. Elijah NewrenJul 21, 2020
  8. Junio C HamanoJul 21, 2020

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.