git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Octopus merge: unique (?) to git, but is it useful?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jun 3, 2008, 02:05 UTC
Message-ID
<alpine.LFD.1.10.0806021845210.3473@woody.linux-foundation.org>
In-Reply-To
<200806030314.03252.jnareb@gmail.com>
On Tue, 3 Jun 2008, Jakub Narebski wrote:
>
> I think that octopus merge (merge with more than two parents/legs) is 
> feature which is unique to git (isn't it?).  Do you remember perhaps 
> why it was introduced?
Well, mainly because the data structures supported the notion naturally.
Once you have 0, 1 or 2 parents, the logical progression is "many". 
> What does it give, beside making it difficult 
> to convert git repositories using this feature to others SCMs

Actually, it's trivial to convert to other SCM's, although I guess the conversion tools haven't really tried. You can always turn it into a series of multiple merges. Yes, you lose information, but it's not like you lose a huge amount.

As to how useful it is.. We don't have a lot of them in the kernel, but I do have to say that the ones we have generally tend to make perfect sense.

To see just octopus merges, do
	git rev-list --parents HEAD |
		grep '.* .* .* ' |
		git diff-tree --stdin --pretty --always -S |
		less -S

but a couple of them are actually fake (same parent listed twice), due to a confluence of (a) historically bad "git merge" semantics and (b) a bug that made it not notice. In fact, that bug seems to have re-appeared, now that I look at it!

Junio: see kernel commits a733a5da9 and 52b097fff89, done as lately as 
February of this year. We shouldn't allow that kind of thing, and in git 
we have commits b389237ae and 6ea23343ce that were both about those kinds 
of mis-uses.

That said, most of those octopus merges look fine and actually give a nicer view of history. Of course, Len has been known to over-do it a bit ;)

		Linus
Previous: Jakub NarebskiNext: Junio C Hamano
Message 2 of 30 in “Octopus merge: unique (?) to git, but is it useful?”
  1. Jakub NarebskiJun 3, 2008
  2. Linus TorvaldsJun 3, 2008
  3. Junio C HamanoJun 3, 2008
  4. Junio C HamanoJun 3, 2008
  5. Johannes SchindelinJun 3, 2008
  6. Junio C HamanoJun 3, 2008
  7. Johannes SchindelinJun 3, 2008
  8. SZEDER GáborJun 3, 2008
  9. Junio C HamanoJun 3, 2008
  10. SZEDER GáborJun 3, 2008
  11. Junio C HamanoJun 3, 2008
  12. SZEDER GáborJun 3, 2008
  13. Jeff KingJun 4, 2008
  14. Junio C HamanoJun 4, 2008
  15. Linus TorvaldsJun 3, 2008
  16. Miklos VajnaJun 3, 2008
  17. Junio C HamanoJun 4, 2008
  18. Junio C HamanoJun 3, 2008
  19. Jakub NarebskiJun 3, 2008
  20. Junio C HamanoJun 3, 2008
  21. Jakub NarebskiJun 3, 2008
  22. Junio C HamanoJun 3, 2008
  23. Linus TorvaldsJun 3, 2008
  24. Commit annotations (was:: Octopus merge: unique (?) to git, but is it useful?)Jakub Narebski, Jun 3, 2008
  25. Johannes SchindelinJun 3, 2008
  26. Johan HerlandJun 3, 2008
  27. Daniel VilleneuveJun 3, 2008
  28. Matthieu MoyJun 3, 2008
  29. Jakub NarebskiJun 3, 2008
  30. Matthieu MoyJun 3, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.