From: Junio C Hamano <gitster@pobox.com>
To: "Martin Langhoff" <martin.langhoff@gmail.com>
Cc: "Junio C Hamano" <gitster@pobox.com>, "git list" <git@vger.kernel.org>
Subject: Re: git merge no longer handles add/add
Date: Mon, 19 Nov 2007 11:25:11 -0800 [thread overview]
Message-ID: <7vabpanilk.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <46a038f90711191033s4bc5ab50kd3e4f30d6b301e43@mail.gmail.com> (Martin Langhoff's message of "Tue, 20 Nov 2007 07:33:27 +1300")
"Martin Langhoff" <martin.langhoff@gmail.com> writes:
> On Nov 19, 2007 7:43 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> As far as the point of the merge is concerned, that's an add/add
>> of _different_ contents, and we have always left the conflict to
>> resolve for you since day one. The only case we handle without
>> complaining is the accidental *clean* merge. Both branches adds
>> the path *identically* compared to the common ancestor.
>
> Even if the 2 paths did have matching content at one point? In fact,
> the 2 files here get added with identicaly content and one of them is
> later modified...
A merge does not look at the history.
It _does_ look at the history to figure out what the common
ancestors are, but after finding them out, the "file history" is
not examined by following each step in the ancestry chain (that
would have been the "blame merge").
>> The very initial implementation of merge may have used the total
>> emptyness as the common ancestor for the merge, and later we
>> made it a bit more pleasant to resolve by computing the common
>> part of the file from the two branches to be used as a fake
>> ancestor contents. But the fact we left the result as conflict
>> for you to validate hasn't changed and will not change.
>
> In this case, if you use the common part (100%) as the ancestor, then
> you get a _clean_ merge. The file is added on both sides identically,
> and then it changes on one side.
Exactly. We may keep conflict markers in the file left in the
work tree to highlight which lines are unique to the side that
added more (iow, one group of lines delimited by <<< === >>> is
empty while the other is not) but this is currently treated as
"fishy, needs human validation" to catch mismerges.
next prev parent reply other threads:[~2007-11-19 19:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 3:18 git merge no longer handles add/add Martin Langhoff
2007-11-19 3:29 ` Martin Langhoff
2007-11-19 6:43 ` Junio C Hamano
2007-11-19 18:33 ` Martin Langhoff
2007-11-19 18:46 ` J. Bruce Fields
2007-11-19 19:25 ` Junio C Hamano [this message]
2007-11-19 19:56 ` Jakub Narebski
2007-11-20 1:15 ` Johannes Schindelin
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=7vabpanilk.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=martin.langhoff@gmail.com \
/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).