git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Rename edge case...
@ 2012-11-09  9:10 John Szakmeister
  2012-11-09  9:27 ` Tomas Carnecky
  2012-11-09 16:09 ` Jeff King
  0 siblings, 2 replies; 7+ messages in thread
From: John Szakmeister @ 2012-11-09  9:10 UTC (permalink / raw)
  To: git

I've been browsing StackOverflow answering git-related questions, and
ran across this one:
    <http://stackoverflow.com/questions/13300675/git-merge-rename-conflict>

It's a bit of an interesting situation.  The user did a couple of
renames in a branch:
    foo.txt => fooOld.txt
    fooNew.txt => foo.txt

Meanwhile, master had an update to fooNew.txt.  When the user tried to
merge master to the branch, it gave a merge conflict saying fooNew.txt
was deleted, but master tried to update it.

I was a bit surprised that git didn't follow the rename here, though I
do understand why: git only sees it as a rename if the source
disappears completely.  So I played locally with a few ideas, and was
surprised to find out that even breaking up the two renames into two
separate commits git still didn't follow it.

I'm just curious--I don't run into this often myself--but is there a
good strategy for dealing with this that avoids the conflict?

Thanks!

-John

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-11-10  2:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-09  9:10 Rename edge case John Szakmeister
2012-11-09  9:27 ` Tomas Carnecky
2012-11-09 10:25   ` John Szakmeister
2012-11-09 10:30     ` Nguyen Thai Ngoc Duy
2012-11-09 13:17     ` Johannes Sixt
2012-11-09 16:09 ` Jeff King
2012-11-10  2:01   ` John Szakmeister

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).