From: martin f krafft <madduck@madduck.net>
To: git discussion list <git@vger.kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: confused about a conflict during octopus merging
Date: Tue, 9 Oct 2007 10:47:48 +0100 [thread overview]
Message-ID: <20071009094748.GA1158@lapse.madduck.net> (raw)
In-Reply-To: <alpine.LFD.0.999.0710081812200.4964@woody.linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 3498 bytes --]
Thanks, Linus, for taking your time to answer me. I truly appreciate
it.
also sprach Linus Torvalds <torvalds@linux-foundation.org> [2007.10.09.0221 +0100]:
> So when the octopus merge starts merging in "master" into the
> "merger" branch, it will *not* just fast-forward the branch to
> "master". Instead, if will generate a new tree that is basically
> the merged state: but that new tree is *not* the same as the
> master commit, it's literally a merge of the two branches - which
> in practice means that it has the same *content* as master, but
> it's not at that commit.
Okay, this makes perfect sense.
> And so now we have a half-way done octopus merge, with the first
> branch added. Now it merges in the second branch ("second"), and
> it *still* has the merge base being the original merge base,
> namely "merger".
>
> And from that standpoint, it really *is* a conflict.
I would have to agree with you: this is pretty exactly what's going
on.
Now, I think Git could do better though. Fast-forwarding
octopus merges, as you suggest, is one possible enhancement, but is
that the solution to my problem? Yes, but could we do better?
Couldn't Git just ignore any commit it has already seen in this
octopus merge? I think this is perfectly okay in terms of the
resulting ancestry, it's really all about applying a commit to the
worktree or not.
Recall the original tree:
x -- master: d2
| x -- second: b
|/
x d1
|
x -- merger: a
Now after merging master, the tree is at the same state as it is at
the tip of master. The asterisk denotes that the commit is half-way
done:
x c* (a+d1+d2)
|\
| x -- master: d2
| | x -- second: b
| |/
| x d1
|/
x a
Next, we merge second to create c2
x_ c2* ((a+d1+d2)+(d1+b))
|\ \
| | |
| x-|- master: d2
| | |
| | x -- second: b
| |/
| x d1
|/
x a
(yay ASCII art!)
At this point, the conflict happens, when Git tries to re-apply d1
to the work tree. But since d1 is already in the ancestry of the
node into which we are merging, couldn't it just skip applying the
commit to the worktree?
x_ c (a+d1+d2+b)
|\ \
| | |
| x-|- master: d2
| | |
| | x -- second: b
| |/
| x d1
|/
x a
If it does, then I think ordering of merges for an octopus becomes
relevant, but I'd say that's already the case.
And I guess this is identical to fast-forwarding the branches...
just seems like approaching it from another angle to me.
> If you think of octopus merges as a really stupid thing where git
> will mindlessly do a three-way merge based on the *current* state
> with all the branches you name, then you get the current octopus
> merge. You just expected it to be smarter than it is, probably
> because you compare it to the *real* merge.
No, Git just raised the bar for expectations half-way up to the
moon In other words: you spoiled me so far; now I won't settle for
less than perfection. :)
--
martin; (greetings from the heart of the sun.)
\____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
"however jewel-like the good will may be in its own right, there is
a morally significant difference between rescuing someone from
a burning building and dropping him from a twelfth-storey window
while trying to rescue him."
-- thomas nagel
spamtraps: madduck.bogus@madduck.net
[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2007-10-09 9:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-09 0:31 confused about a conflict during octopus merging martin f krafft
2007-10-09 1:21 ` Linus Torvalds
2007-10-09 9:47 ` martin f krafft [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=20071009094748.GA1158@lapse.madduck.net \
--to=madduck@madduck.net \
--cc=git@vger.kernel.org \
--cc=torvalds@linux-foundation.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).