Comment 5 for bug 1347814

Revision history for this message
Removed by request (removed3425744) wrote : Re: git-gc can damage a repository

> Okay. Do you still think this is a bug?

On testing it a little more I have figured out that I have made an error on creating the testcase that let me think that the repository doesn't get damaged. Here is now a testcase that natively damages a repository:

1. Make sure your user has an umask of 077 (for example by replacing #022 with 077 in ~/.profile and probably by loging out and in again).
2. Download a repository (for example I'm testing with "git clone git://git.code.sf.net/p/tvoip/code tvoip").
3. Go into the directory of the repository.
3. Call "git log" to validate that the repository is currently undamaged.
4. Instead of calling git-gc the repository gets now optimized more manually with 'sudo bash -c "git pack-refs --all; git reflog expire --all --expire-unreachable=now --expire=now; git repack --depth 250 --window 250 -Fad; git rerere gc; git prune --expire now"'.
5. Call the same command without sudo (an error should appear).
6. Call "sudo git log" to see that no commits are available anymore.