git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git prune pig slow
@ 2006-07-29  9:02 Russell King
  2006-07-29 11:40 ` Johannes Schindelin
  2006-07-29 18:14 ` Linus Torvalds
  0 siblings, 2 replies; 6+ messages in thread
From: Russell King @ 2006-07-29  9:02 UTC (permalink / raw)
  To: git

Hi,

git 1.4.0, P4 2.6GHz, 1GB.

I'm trying to use "git prune" to remove some unreachable objects from
my git tree.  However, it appears to be _extremely_ expensive:

rmk      13376 91.3 15.7 165980 161556 pts/0   R+   09:50   5:14 git-fsck-object

stracing it shows that it's doing lots and lots of brk() calls.

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.

-- 
Russell King

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: git prune pig slow
@ 2006-07-29 22:41 linux
  2006-07-29 23:48 ` Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: linux @ 2006-07-29 22:41 UTC (permalink / raw)
  To: git; +Cc: torvalds

> Btw, another alternative to "git prune" is actually to do
>
>	git repack -a -d
>
> and then just delete all unpacked objects.

No, that's dangerous too.  The index file is considered part of the root
set for git-fsck-objects, but not for git-repack.

Example script:

$ git-init-db
$ cat > hello.c
#include <stdio.h>

int
main(void)
{
        puts("Hello, world!");
        return 0;
}
$ git-update-index --add hello.c
$ git-repack -a -d
Generating pack...
Done counting 0 objects.
Nothing new to pack.
$ rm .git/objects/67/159ba959e0a0cd6157bf04d5dad66af59383c2
rm: remove write-protected regular file `.git/objects/67/159ba959e0a0cd6157bf04d5dad66af59383c2'? y
$ git commit
error: invalid object 67159ba959e0a0cd6157bf04d5dad66af59383c2
fatal: git-write-tree: error building trees

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-07-29 23:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-29  9:02 git prune pig slow Russell King
2006-07-29 11:40 ` Johannes Schindelin
2006-07-29 18:14 ` Linus Torvalds
2006-07-29 20:03   ` Linus Torvalds
  -- strict thread matches above, loose matches on Subject: below --
2006-07-29 22:41 linux
2006-07-29 23:48 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).