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

Re: [RFC/PATCH] commit-tree: bump MAX_PARENTS to 128

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 26, 2007, 14:31 UTC
Message-ID
<20070226143142.GA1390@spearce.org>
In-Reply-To
<20070226121557.GA18114@coredump.intra.peff.net>
Jeff King <peff@peff.net> wrote:
> This limit doesn't seem to come into effect anywhere else; it's simply
> an arbitrary limit to make memory allocation easier. It's used to
> declare a single static array of 20-byte hashes, so this increase wastes
> about 2K.
I don't really see a problem with this, however:

The pack v4 code that Nico and I are working on was planning on taking a very useful optimization for any commit with less than 64 parents (or maybe 128, I'd have to go back to look at my notes). We would fall back to a less optimal storage for these large octopus commits. Of course the fallback strategy (which is really just the current OBJ_COMMIT packing) is still more space efficient than making multiple commits to express the octopus, so pushing this limit up higher would save space better. Oh, and these types of octopus merges aren't very frequent either. ;-)

git-bisect can bisect these large octopuses, but it needs to search every parent commit in the merge. It cannot perform a binary search through them. Getting massive octopuses makes it harder for the user to bisect.

I'm thinking maybe this should just change to a dynamic allocation and let the caller feed however many parents they want. Most people don't make an octopus very often, and when they do they really mean to do it, such as the case you just described.

Unless Dscho/Nico/Junio/Linus/etc. know of some other limitation lurking within Git. My recollection is that only git-commit-tree and git-gui knew about this 16 parent limit. And the latter only knows about the limit so that can prevent the user from doing an octopus merge that overflowed git-commit-tree's limit. Be nice if git-gui has no limit. ;-)

-- 
Shawn.
Previous: Jeff KingNext: Johannes Schindelin
Message 2 of 12 in “commit-tree: bump MAX_PARENTS to 128”
  1. commit-tree: bump MAX_PARENTS to 128Jeff King, Feb 26, 2007
  2. Shawn O. PearceFeb 26, 2007
  3. Johannes SchindelinFeb 26, 2007
  4. Junio C HamanoFeb 27, 2007
  5. Jeff KingFeb 27, 2007
  6. Junio C HamanoFeb 27, 2007
  7. Jeff KingFeb 27, 2007
  8. Junio C HamanoFeb 27, 2007
  9. Andy ParkinsFeb 27, 2007
  10. Jeff KingFeb 27, 2007
  11. Jakub NarebskiFeb 27, 2007
  12. Johannes SchindelinFeb 27, 2007

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.