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]:
Okay, this makes perfect sense.
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.
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. :)
--=20
martin; (greetings from the heart of the sun.)
\____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
=20
"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
=20
spamtraps: madduck.bogus@madduck.net