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

Re: git prune pig slow

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 29, 2006, 18:14 UTC
Message-ID
<Pine.LNX.4.64.0607291110180.4168@g5.osdl.org>
In-Reply-To
<20060729090250.GC26956@flint.arm.linux.org.uk>
On Sat, 29 Jul 2006, Russell King wrote:
> 
> I killed it after 10 minutes and decided to do the job manually -
> git-fsck-objects --unreachable and deleting the objects one by one is
> _much_ quicker than git-fsck-objects --full --cache --unreachable.
It's also very dangerous.

If you have partial packing (which you can get if you fetch data using rsync or http, for example), not havign the "--full" means that git-fsck-objects will report on objects being "unreachable" if they are only reachable from another object that is packed.

Now, in practice, if you only use the git native protocol, this should never happen, and you're fine. But there's a _very_ real reason why "git prune" passes the "--full" flag to git-fsck-cache. "git prune" is simply too dangerous without it.

That said, the current "git prune" in 1.4.2-rc is much faster, because it does the reachability analysis on its own, and doesn't do all the other things that git-fsck-cache does.

Btw, another alternative to "git prune" is actually to do
	git repack -a -d
and then just delete all unpacked objects.
			Linus
Previous: Johannes SchindelinNext: Linus Torvalds
Message 3 of 4 in “git prune pig slow”
  1. Russell KingJul 29, 2006
  2. Johannes SchindelinJul 29, 2006
  3. Linus TorvaldsJul 29, 2006
  4. Linus TorvaldsJul 29, 2006

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.