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

Re: Distribution of longest common hash prefixes

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 3, 2007, 23:22 UTC
Message-ID
<Pine.LNX.4.64.0704031613210.6730@woody.linux-foundation.org>
In-Reply-To
<20070403230846.GB8479@dspnet.fr.eu.org>
On Wed, 4 Apr 2007, Olivier Galibert wrote:
> 
> Isn't the number of objects an order of magnitude bigger than the
> number of commits?  Well, I guess that depends on your workflow...

Judging by the kernel tree, it's not an order of magnitude, although it's fairly close:

	[torvalds@woody linux]$ git rev-list --all | wc -l
	51156
	[torvalds@woody linux]$ git rev-list --all --objects | wc -l
	444265

So you have about 50k commit objects, and about 390k "other" objects. About 7.7 "other" objects per commit. Not quite an order-of-magnitude, but close.

Part of the reason for this is that the kernel people tend to encourage lots of smaller commits over single large commits, so we have lots of commits.

To counter-act that somewhat, the kernel tree is also pretty deep, so a lot of the "other" objects are actually the tree objects that create the directory structure - it's quite normal to have a single file (blob) change, and then three new trees that lead up to that file, and the one commit that explains it.

Other projects - like git itself - have relatively fewer tree objects, which is probably why the ratio for git itself is just 3.04 "other" objects for each commit (ie on average, commits probably touch two blobs and the top-level tree - about 10 commits, and 30k non-commit objects).

So repo layout matters. Iirc, last I did the statistics, the git repository had more blobs than trees, while the kernel repo had more trees than blobs. And the commits-to-other-objects is obviously fairly different as a result (I think both git and the kernel have the "many small changes" approach, so they're similar in that respect).

Other repositories probably have more "big changes". Especially if you create the repo initially by importing just big releases over time, you'll have relatively few commits, and lots of blob/tree changes.

			Linus
Previous: Olivier GalibertNext: James Cloos
Message 17 of 20 in “Distribution of longest common hash prefixes”
  1. Peter EriksenApr 2, 2007
  2. Linus TorvaldsApr 2, 2007
  3. Randal L. SchwartzApr 2, 2007
  4. Linus TorvaldsApr 2, 2007
  5. Randal L. SchwartzApr 2, 2007
  6. Randal L. SchwartzApr 2, 2007
  7. James CloosApr 3, 2007
  8. Randal L. SchwartzApr 3, 2007
  9. Shawn O. PearceApr 3, 2007
  10. Linus TorvaldsApr 3, 2007
  11. Junio C HamanoApr 3, 2007
  12. Linus TorvaldsApr 3, 2007
  13. Nicolas PitreApr 3, 2007
  14. Junio C HamanoApr 3, 2007
  15. Nicolas PitreApr 3, 2007
  16. Olivier GalibertApr 3, 2007
  17. Linus TorvaldsApr 3, 2007
  18. James CloosApr 4, 2007
  19. James CloosApr 2, 2007
  20. Peter EriksenApr 2, 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.