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

Re: git prune pig slow

From
Llinux@horizon.com <linux@horizon.com>
Date
Jul 29, 2006, 22:41 UTC
Message-ID
<20060729224106.12312.qmail@science.horizon.com>
Show 5 quoted lines
> 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
Next: Linus Torvalds
Message 1 of 2 in “Re: git prune pig slow”
  1. linux@horizon.comJul 29, 2006
  2. 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.