> Yep, sorry, it's my fault that I overlooked Medusa there. I usually check with gitk, but at this time, I checked the results only via --no-merges option for concentrating on the real changes.
> Now I looked at it, and I was turned into sto..n...e...... Takashi [0]
Perhaps the use-case is "consensus". I.e., when you have a 66-way merge and 50 of those say "x=0;" and 16 of those say "x=1;", then it can pick the one with the most consensus, i.e. "x=0;". Or something like that ...
EDIT: of course using a special flag, otherwise indeed it could lead to problems.
I'd wager it's just to make life a bit easier, not because of any technical advantages... i.e. so that they don't have to sign off on 66+ commits for a 66-commit merge.
They don't need to be identical. You could use the same kind of algorithms as bioinformaticians use to merge multiple different DNA sequences (which can be of different length).
If git did that automatically, without reporting a merge conflict, that would be a disaster. Suppose there were more Americans on team 1 of the Mars Climate Orbiter and more Europeans on team 2, so team 1 chose imperial units by consensus and team 2 chose metric units by consensus. That isn't going to give a stable system.
It allows a reduction of (useless) merge commits. Assume you have 8 different branches (without conflicts) that you need to merge. Then you can either have 8 merge commits (merged $number into master), or a single one (merged 1,2,3,4,5,6,7,8 into master).
If you have no conflicts, it makes the history much cleaner without losing relevant history.
Git merges aren't really merges in the sense that they store a delta produced by some kind of N-way merge algorithm. A git commit is essentially a full copy of a tree where the parents are stored as simple metadata attributes. The parent links are used by tools like "git log" to show how code evolved. But that evolution is calculated on the fly from the difference between trees.
In the data model of git, a 66-way merge is therefore nothing special. It's simply a tree with 66 parent links.
19 comments
[ 4.7 ms ] story [ 53.0 ms ] thread> Now I looked at it, and I was turned into sto..n...e...... Takashi [0]
[0] https://lkml.org/lkml/2014/1/23/80
Is this a relatively new feature? And what is the use-case for N>2?
EDIT: of course using a special flag, otherwise indeed it could lead to problems.
https://en.wikipedia.org/wiki/Edit_distance
https://en.wikipedia.org/wiki/Consensus_sequence
If you have no conflicts, it makes the history much cleaner without losing relevant history.
http://cameronmcefee.com/work/the-octocat/
[0] https://www.destroyallsoftware.com/blog/2017/the-biggest-and... [1] https://news.ycombinator.com/item?id=13647927
In the data model of git, a 66-way merge is therefore nothing special. It's simply a tree with 66 parent links.
[0] https://lkml.org/lkml/2014/1/23/611