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

conflict merging directory replaced by symlink

From
MPMischa POSLAWSKY <shiar@shiar.nl>
Date
Oct 29, 2010, 17:32 UTC
Message-ID
<20101029173232.GA9869@pearl.mediadesign.nl>
Hello list,

After replacing a directory by a symlink, branches without that change will conflict whenever they change something unrelated in the link target. To illustrate:

	git init &&
	mkdir common &&
	touch common/test &&
	git add common/test &&
	mkdir dupe &&
	touch dupe/test &&
	git add dupe/test && 
	git commit -m 'initial setup' &&
	git rm -r dupe &&
	ln -s common dupe &&
	git add dupe &&
	git commit -m 'replace dir by symlink' &&
	git checkout -b prelink HEAD^ &&
	touch common/irrelevant &&
	git add common/irrelevant &&
	git commit -m 'additional common file' &&
	git checkout - &&
	git merge prelink
fails in git v1.7.2.3 with:
> CONFLICT (file/directory): There is a directory with name dupe in prelink.
> Adding dupe as dupe~HEAD
> Automatic merge failed; fix conflicts and then commit the result.

I'd expect the same resolution as when adding a symlink from a different name, without replacing the directory, but this happily merges without raising a fuss.

Does anyone recognise or know a reason for this behaviour?
Thanks!
-- 
Mischa
Message 1 of 1 in “conflict merging directory replaced by symlink”
  1. Mischa POSLAWSKYOct 29, 2010

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.