{"thread":{"id":"5041","subject":"Re: git prune pig slow","startedAt":"2006-07-29T22:41:06Z","lastAt":"2006-07-29T23:48:39Z","messageCount":2,"participants":["linux@horizon.com","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"24354","messageId":"20060729224106.12312.qmail@science.horizon.com","threadId":"5041","inReplyTo":null,"subject":"Re: git prune pig slow","fromName":"","fromEmail":"linux@horizon.com","sentAt":"2006-07-29T22:41:06Z","receivedAt":"2006-07-29T22:41:06Z","isPatch":false,"sender":{"key":"linux@horizon.com","avatar":null},"body":"> Btw, another alternative to \"git prune\" is actually to do\n>\n>\tgit repack -a -d\n>\n> and then just delete all unpacked objects.\n\nNo, that's dangerous too.  The index file is considered part of the root\nset for git-fsck-objects, but not for git-repack.\n\nExample script:\n\n$ git-init-db\n$ cat > hello.c\n#include <stdio.h>\n\nint\nmain(void)\n{\n        puts(\"Hello, world!\");\n        return 0;\n}\n$ git-update-index --add hello.c\n$ git-repack -a -d\nGenerating pack...\nDone counting 0 objects.\nNothing new to pack.\n$ rm .git/objects/67/159ba959e0a0cd6157bf04d5dad66af59383c2\nrm: remove write-protected regular file `.git/objects/67/159ba959e0a0cd6157bf04d5dad66af59383c2'? y\n$ git commit\nerror: invalid object 67159ba959e0a0cd6157bf04d5dad66af59383c2\nfatal: git-write-tree: error building trees\n"},{"id":"24356","messageId":"Pine.LNX.4.64.0607291647030.4168@g5.osdl.org","threadId":"5041","inReplyTo":"20060729224106.12312.qmail@science.horizon.com","subject":"Re: git prune pig slow","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-07-29T23:48:39Z","receivedAt":"2006-07-29T23:48:39Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sat, 29 Jul 2006, linux@horizon.com wrote:\n> \n> No, that's dangerous too.  The index file is considered part of the root\n> set for git-fsck-objects, but not for git-repack.\n\nIndeed.\n\nAlthough at least you won't lose any history - at worst you'll have to \nbasically do a \"git reset HEAD\" to make things right again.\n\nI was careful when I wrote the new git-prune to take the index into \naccount, but I'd forgotten about it wrt the \"git repack -a -d\" suggestion.\n\n\t\tLinus\n"}]}