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

false directory/file merge conflict

From
JMJeffrey Middleton <jefromi@gmail.com>
Date
Dec 8, 2009, 22:55 UTC
Message-ID
<4389ce950912081455g2f6ad1c3i72386073e5154d6@mail.gmail.com>

When a directory (with contents) has changed into a file on one branch, and another branch attempts to merge it, there's a false conflict - the directory is processed before its contents are removed. This is particularly nasty, because "resolving" the non-existent conflict results in no changes, so future merges will fail in exactly the same way. Test script and failed merge output below.

Jeffrey
-- 8< --

rm -rf directory-file mkdir directory-file cd directory-file git init

mkdir foo echo bar > foo/bar echo bas > foo/baz git add foo/bar foo/baz git commit -m "check in files"

git branch foo_unchanged

git rm -r foo echo foo > foo git add foo git commit -m "foo changes from directory to file"

git checkout foo_unchanged echo foobar > foobar git add foobar git commit -m "make a separate change"

git merge master
-- 8< --

CONFLICT (directory/file): There is a directory with name foo in HEAD. Adding foo as foo~master Removing foo/bar Removing foo/baz Automatic merge failed; fix conflicts and then commit the result.

Message 1 of 1 in “false directory/file merge conflict”
  1. Jeffrey MiddletonDec 8, 2009

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.