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

Move-delete merge conflict is not displayed using git ls-files --unmerged

From
CPConstantine Plotnikov <constantine.plotnikov@gmail.com>
Date
Dec 22, 2008, 14:29 UTC
Message-ID
<85647ef50812220629o46134a70waf159bb6cd6d6e72@mail.gmail.com>

Lets consider repository state created with the following script (git version 1.6.0.4).

mkdir test-move-delete cd test-move-delete git init echo test1 >file.txt echo test2 >>file.txt echo test3 >>file.txt echo test4 >>file.txt git add file.txt git commit -m "start" git checkout -b moved master git mv file.txt copy.txt git commit -m "moved" git checkout -b deleted master git rm file.txt git commit -m "deleted" git merge moved

The last merge command fails with move-delete conflict.

CONFLICT (rename/delete): Renamed file.txt->copy.txt in moved and deleted in HEAD Automatic merge failed; fix conflicts and then commit the result.

However git ls-files --unmerged does not list any conflict in that case and it is possible to execute git commit command right away without doing anything with the repository.

I think that if git merge reports the conflicts, such conflicts should be discoverable using git ls-files and prevent commit with resolving the conflict like it is done with modify-delete conflicts.

Regards, Constantine

Next: Junio C Hamano
Message 1 of 5 in “Move-delete merge conflict is not displayed using git ls-files --unmerged”
  1. Constantine PlotnikovDec 22, 2008
  2. Junio C HamanoDec 22, 2008
  3. merge-recursive: mark rename/delete conflict as unmergedJohannes Schindelin, Dec 22, 2008
  4. Junio C HamanoDec 22, 2008
  5. Johannes SchindelinDec 23, 2008

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.