raku.org icon indicating copy to clipboard operation
raku.org copied to clipboard

FSCK errors in repo

Open rmloveland opened this issue 8 years ago • 7 comments

$ git clone https://github.com/perl6/perl6.org
Cloning into 'perl6.org'...
remote: Counting objects: 6355, done.
error: object 552c801ce329aab35ec7a165998e114da4edbd8e: zeroPaddedFilemode: contains zero-padded file modes
fatal: Error in object
fatal: index-pack failed

Here are the settings in my ~/.gitconfig that I believe are causing git to catch these issues:

[transfer]
    fsckObjects = true
[fetch]
    fsckObjects = true
[receive]
    fsckObjects = true

rmloveland avatar Jul 02 '16 15:07 rmloveland

Luckily git clone --depth 1 works.

rmloveland avatar Jul 02 '16 15:07 rmloveland

I've enabled the same settings as you have, and cloned fine without any problem, both via HTTPS and ssh. So I'd guess this is either a problem with your git version or the network.

moritz avatar Jul 02 '16 17:07 moritz

Wait, I cloned the wrong repo, my bad. I can reproduce it.

moritz avatar Jul 02 '16 17:07 moritz

If someone with commit access wants to fix the problem, here is a fix:

$ cd /tmp/
$ git clone -c fetch.fsckObjects=false https://github.com/Raku/raku.org.git
$ git init raku.org-fixed
$ cd raku.org
$ git fast-export --all | (cd ../raku.org-fixed && git fast-import)
$ find . -type f ! -path '*/.git/*' -exec sha256sum "{}" + > /tmp/sha256sum.txt
$ cd ../raku.org-fixed
$ git checkout
$ sha256sum --quiet -c /tmp/sha256sum.txt

And then you need to force push the repository.

Works on Linux. The find command ignores the .git directory because the SHAs of the repository have changed.

You're going to lose all the external links to the old IDs and the 3 pull requests will be broken but the error is very annoying. And disabling the fsck to clone a repo is never a good idea or the right solution to the problem.

juanfra684 avatar Nov 10 '21 22:11 juanfra684

Difficult to come to a decision here. Any git experts with deeper insights of the tradeoffs?

patrickbkr avatar Mar 09 '22 12:03 patrickbkr