Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: Errors cloning large repo

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:42:58


On Fri, 9 Mar 2007, Linus Torvalds wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help