git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Jay Soffian <jaysoffian@gmail.com>, git <git@vger.kernel.org>,
	Ken Schalk <ken.schalk@intel.com>
Subject: Re: [PATCH 1/3] t3030: fix accidental success in symlink rename
Date: Fri, 25 Mar 2011 10:42:05 -0700	[thread overview]
Message-ID: <7v1v1v6qs2.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110325160326.GA26635@sigill.intra.peff.net> (Jeff King's message of "Fri, 25 Mar 2011 12:03:26 -0400")

Jeff King <peff@peff.net> writes:

> In this test, we have merge two branches. On one branch, we
> renamed "a" to "e". On the other, we renamed "a" to "e" and
> then added a symlink pointing at "a" pointing to "e".

I read this five times but still couldn't figure out that you meant that
the other side 'added a symlink "a" to allow people keep referring to "e"
with the old name "a"' until I actually read the actual test you are
describing here.

Besides, /we have merge/s/have//, I think.

> The results for the test indicate that the merge should
> succeed, but also that "a" should no longer exist. Since
> both sides renamed "a" to the same destination, we will end
> up comparing those destinations for content.
>
> But what about what's left? One side (the rename only),
> replaced "a" with nothing. The other side replaced it with a
> symlink. The common base must also be nothing, because any
> "a" before this was meaningless (it was totally unrelated
> content that ended up getting renamed).
>
> The only sensible resolution is to keep the symlink.

I agree.

We should treat structural changes and do a 3-way on that, and then
another 3-way on content changes, treating them as an independent thing.
One side has "create 'e' out of 'a', removing 'a'" and "_create_ 'a', that
is unrelated to the original 'a'", the other side has "create 'e' out of
'a', removing 'a'", so the end result should be that we do both,
i.e. "create 'e' out of 'a', removing 'a'" and "create 'a'".  At the
content level, the result in 'e' may have to be decided by 3-way.  The
result in 'a' should be a clean merge taken from the former "with b/c
link" branch, as this is not even a create (by the side that added a
backward compatibility symbolic link) vs a delete (by pure-rename side)
conflict.

  reply	other threads:[~2011-03-25 17:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-24 21:18 merge recursive and code movement Jay Soffian
2011-03-25  9:37 ` Jeff King
2011-03-25 10:12   ` Jeff King
2011-03-25 11:12     ` Jeff King
2011-03-25 16:00       ` Jeff King
2011-03-25 16:03         ` [PATCH 1/3] t3030: fix accidental success in symlink rename Jeff King
2011-03-25 17:42           ` Junio C Hamano [this message]
2011-03-25 17:51             ` Jeff King
2011-03-25 18:25             ` Schalk, Ken
2011-03-25 16:06         ` [PATCH 2/3] merge: handle renames with replacement content Jeff King
2011-03-25 16:08         ` [PATCH 3/3] merge: turn on rewrite detection Jeff King
2011-03-25 17:32         ` merge recursive and code movement Jay Soffian
2012-07-16  0:17         ` Techlive Zheng
2012-07-16 12:26           ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7v1v1v6qs2.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=ken.schalk@intel.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).