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

Re: Errors cloning large repo

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 10, 2007, 02:03 UTC
Message-ID
<Pine.LNX.4.64.0703091800110.10832@woody.linux-foundation.org>
In-Reply-To
<Pine.LNX.4.64.0703091641460.10832@woody.linux-foundation.org>
On Fri, 9 Mar 2007, Linus Torvalds wrote:
Show 9 quoted lines
> >
> > For some reason git add . swallowed the whole thing
> > but git commit did not and I had to split it up. I trimmed the tree a bit
> > since then by removing c & c++ files ;-)
> 
> Ok, that's a bit surprising, since "git commit" actually should do less 
> than "git add .", but it's entirely possible that just the status message 
> generation ends up doing strange things for a repository with that many 
> files in it.
Ahhh. Found it.

It's indeed "git commit" that takes tons of memory, but for all the wrong reasons. It does a "git diff-tree" to generate the diffstat, and *that* is extremely expensive:

	git-diff-tree --shortstat --summary --root --no-commit-id HEAD --

I suspect we shouldn't bother with the diffstat for the initial commit. Just removing "--root" migth be sufficient.

		Linus
Previous: Linus TorvaldsNext: Junio C Hamano
Message 3 of 4 in “Re: Errors cloning large repo”
  1. Anton TropashkoMar 9, 2007
  2. Linus TorvaldsMar 10, 2007
  3. Linus TorvaldsMar 10, 2007
  4. Junio C HamanoMar 10, 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.