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

2 conflicts referencing the same path?

From
Bryan Turner <bturner@atlassian.com>
Date
Feb 1, 2018, 23:00 UTC
Message-ID
<CAGyf7-He4in8JWUh9dpAwvoPkQz9hr8nCBpxOxhZEd8+jtqTpg@mail.gmail.com>

While investigating an issue with rendering conflicts on a pull request, I noticed that the merge was producing this output (sanitized for paths)

$ git merge --no-ff --log -m "Test" 190a25b6e0f32c7b8ccddf8c31e054149dece8b7 CONFLICT (rename/add): Rename A->B in HEAD. B added in 190a25b6e0f32c7b8ccddf8c31e054149dece8b7 Adding as B~190a25b6e0f32c7b8ccddf8c31e054149dece8b7 instead ... Auto-merging B CONFLICT (content): Merge conflicts in B

(There are several other conflicts listed "between" the two I'm showing here, various rename/add, add/add and content conflicts, but I'm trimming those out to focus on the lines that I think are relevant to my question.)

This merge produces 2 (or is it 3?) conflicts for the same B path:
- Rename A to B in HEAD, add B in 190a25b
- Content conflicts in B

The version of B left in place _does_ contain conflict markers, after the merge processes completes. The version added as B~190a25b has no conflict markers; it just shows a small number of inserted lines.

The merge in question produces 23 different CONFLICT lines, but aside from "composite" conflicts (rename/add, add/add) that can include the same path multiple times in their output, only this one path is mentioned in multiple CONFLICT lines.

I'm still trying to produce a set of steps that will allow a minimal reproduction, but I thought I'd post to the list just to see if anyone had any thoughts on how it could happen. Is it a "normal" (albeit rare) case? Or could it represent some sort of issue in Git's 3-way merge algorithm (in its behavior or perhaps in how the merge conflicts are logged)?

Any insights appreciated! Bryan Turner

Next: Elijah Newren
Message 1 of 2 in “2 conflicts referencing the same path?”
  1. Bryan TurnerFeb 1, 2018
  2. Elijah NewrenFeb 2, 2018

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.