From: "Raimund Berger" <raimund.berger@gmail.com>
To: git@vger.kernel.org
Subject: Re: Newbie question regarding 3way merge order.
Date: Sat, 31 Jan 2009 14:14:02 +0100 [thread overview]
Message-ID: <87r62jboth.fsf@gigli.quasi.internal> (raw)
In-Reply-To: <20090131095724.6117@nanako3.lavabit.com> (Nanako Shiraishi's message of "Sat, 31 Jan 2009 09:57:24 +0900")
Nanako Shiraishi <nanako3@lavabit.com> writes:
> Quoting "Raimund Berger" <raimund.berger@gmail.com>:
>
>> The question is whether a (3way) merge is commutative, purely in terms
>> of content (i.e. disregarding commit history for now). Iow if no matter
>> in which order I merge A and B, i.e. A into B or B into A, I'd be
>> guaranteed to arrive at the same content.
>
> I think three-way merge of A into B and B into A will produce the same
> result when the merge doesn't conflict (when it does, you will get the
> conflict markers and text from A and B in a different order depending on
> the direction of the merge).
>
>> The reason I ask is obvious I guess. What basically interests me is if I
>> gave a bunch of topic branches exposure on a test branch and, after
>> resolving issues, applied them to stable, that I could be 100% sure to
>> not introduce new issues content wise just by applying merges in a
>> different order or form (rebase, patch set).
>
> I don't think you can make a blanket conclusion like that by only knowing
> that merging A into B and merging B into A would produce the same result.
>
> If you merge topics A, B, and C in this order into your current state O,
> there may not be any conflict, but if you merge the same topics to the
> same current state in different order, C, B and then A for example, you
> may get conflicts that breaks the merge. The commutativeness only says
> that merge of A into O will produce the same result as merge of O into A.
> It doesn't say anything about what would happen when you merge B to O.
That's correct. Strictly speaking one would also have to verify
associativity. I.e. whether merge(merge(A,B),C) == merge(A,merge(B,C))
for all A,B,C.
Thanks for making an implicit point explicit. So a followup question
would be: is git's 3way merge associative?
>From my pov people seem to assume it.
prev parent reply other threads:[~2009-01-31 13:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-29 22:25 Newbie question regarding 3way merge order Raimund Berger
2009-01-30 11:37 ` Raimund Berger
2009-01-30 17:31 ` Sitaram Chamarty
2009-01-30 19:09 ` Raimund Berger
2009-01-31 0:32 ` Sitaram Chamarty
2009-01-31 13:26 ` Raimund Berger
2009-01-31 21:45 ` Nanako Shiraishi
2009-02-01 14:13 ` Raimund Berger
2009-02-01 19:22 ` Junio C Hamano
2009-02-02 1:50 ` Sitaram Chamarty
2009-02-02 14:58 ` Raimund Berger
2009-02-02 16:10 ` Johannes Sixt
2009-02-02 18:15 ` Raimund Berger
2009-02-03 7:21 ` Johannes Sixt
2009-01-31 0:57 ` Nanako Shiraishi
2009-01-31 13:14 ` Raimund Berger [this message]
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=87r62jboth.fsf@gigli.quasi.internal \
--to=raimund.berger@gmail.com \
--cc=git@vger.kernel.org \
/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).