{"thread":{"id":"21913","subject":"false directory/file merge conflict","startedAt":"2009-12-08T22:55:30Z","lastAt":"2009-12-08T22:55:30Z","messageCount":1,"participants":["Jeffrey Middleton"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"129583","messageId":"4389ce950912081455g2f6ad1c3i72386073e5154d6@mail.gmail.com","threadId":"21913","inReplyTo":null,"subject":"false directory/file merge conflict","fromName":"Jeffrey Middleton","fromEmail":"jefromi@gmail.com","sentAt":"2009-12-08T22:55:30Z","receivedAt":"2009-12-08T22:55:30Z","isPatch":false,"sender":{"key":"jefromi@gmail.com","avatar":null},"body":"When a directory (with contents) has changed into a file on one\nbranch, and another branch attempts to merge it, there's a false\nconflict - the directory is processed before its contents are removed.\nThis is particularly nasty, because \"resolving\" the non-existent\nconflict results in no changes, so future merges will fail in exactly\nthe same way.  Test script and failed merge output below.\n\nJeffrey\n\n-- 8< --\n\nrm -rf directory-file\nmkdir directory-file\ncd directory-file\ngit init\n\nmkdir foo\necho bar > foo/bar\necho bas > foo/baz\ngit add foo/bar foo/baz\ngit commit -m \"check in files\"\n\ngit branch foo_unchanged\n\ngit rm -r foo\necho foo > foo\ngit add foo\ngit commit -m \"foo changes from directory to file\"\n\ngit checkout foo_unchanged\necho foobar > foobar\ngit add foobar\ngit commit -m \"make a separate change\"\n\ngit merge master\n\n-- 8< --\n\nCONFLICT (directory/file): There is a directory with name foo in HEAD.\nAdding foo as foo~master\nRemoving foo/bar\nRemoving foo/baz\nAutomatic merge failed; fix conflicts and then commit the result.\n"}]}