Hi,
On Thu, 6 May 2010, Johannes Schindelin wrote:
> Pasky, it seems that something happened to your box. If I download
>
http://repo.or.cz/r/msysgit.git/objects/pack/pack-5b51af9cb1b1122d27ddd53d40a8c3e4472ae9e4.pack
> directly and use git verify-pack on it, it says:
>
> error: pack-5b51af9cb1b1122d27ddd53d40a8c3e4472ae9e4.pack SHA1 checksum mismatch
> error: inflate: data stream error (incorrect data check)
> error: cannot unpack eb13a0a8705adbd3980332e6a7c0c236217bc503 from pack-5b51af9cb1b1122d27ddd53d40a8c3e4472ae9e4.pack at offset 129707676
>
> Either your box has a disk that's about to go bad, or the repack code is
> borked.
Note that I think that Git is pretty broken (I seem to remember that this
was not the case earlier): cat <attachment> | git hash-object -w --stdin
does _not_ write a new loose object. (IOW after said command, there is
_still_ no valid 25b1d1 and neither eb13a0!!!) I had to initialize a dummy
repository and copy over .git/objects/??/* !!!
Another problem is that a "git gc" returned "Nothing to repack". Which is
clearly untrue. I had to use quite a lot of low-level tricks to get the
whole thing to repack correctly.
So, clearly, Git sucks when it comes to fixing corruptions. We knew that,
but I thought that Nico worked on that part.
Apparently, the easiest way to get a correct clone is to
1) initialize a new, empty repository,
2) add the 'origin' remote thusly:
git remote add -f origin
http://repo.or.cz/r/msysgit.git
3) in spite of the error, continue by fetching the pack manually:
(cd .git/objects/pack/ && curl -O \
http://repo.or.cz/r/msysgit.git/objects/pack/pack-5b51af9cb1b1122d27ddd53d40a8c3e4472ae9e4.pack)
4) adding the non-corrupted objects using the attached bundle:
git bundle unbundle borked.bundle
5) Now fetch from 'origin' again (to update the refs correctly):
git fetch origin
6) Manually (!!!) remove the borked temporary object files:
find .git -name \*.temp -exec rm {} \;
7) Now, 'git gc'
If you already have a (borked) checkout, you might be able to get away
with 4, 6 and 7.
If we did not have the dumb transport, we would be thoroughly fscked.
Unamazed,
Dscho