Re: confused about a conflict during octopus merging

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linus Torvalds
Date: Monday, October 8, 2007 - 6:21 pm

On Tue, 9 Oct 2007, martin f krafft wrote:

Octopus merges are special. Don't use them unless you really know what 
you're doing. And generally not even then ;)


Right. It makes total sense, because an octopus merge is simply always 
going to create a whole new merge commit that goes through the sources one 
by one, and merges them in - and if you do that, then you get a conflict 
in "d".


Octopus merges do *not* fast-forward. Maybe they should. But they don't.

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.

So that first stage of the octopus merge has gone fine, but it didn't 
really do what you expected.

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 do think that 
 - octopus merges should probably refuse to happen when a branch isn't a 
   "merge" at all, but a fast-forward.
*or*
 - we should make octopus-merges smarter, and for each branch that is a 
   fast-forward, it really just fast-forwards.

but I don't think the current behaviour is "wrong", it's just not what you 
expected.

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.

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
confused about a conflict during octopus merging, martin f krafft, (Mon Oct 8, 5:31 pm)
Re: confused about a conflict during octopus merging, Linus Torvalds, (Mon Oct 8, 6:21 pm)
Re: confused about a conflict during octopus merging, martin f krafft, (Tue Oct 9, 2:47 am)