Re: [PUB]corrupt repos does not return error with `git fsck`
From: Matthieu Moy <hidden>
Date: 2016-06-15 23:04:51
Faheem Mitha [off-list ref] writes:
I was going by the answer (by CodeWizard) in http://stackoverflow.com/q/30348615/350713
OK, so the hash you got comes from a superproject which references it. My guess is that the superproject did a private commit in a submodule, added this submodule to the superproject, and forgot to push the submodule. If so, it's a user error (that could arguably have been avoided with a better command-line interface, so Git is partly guilty), but not a repository corruption.
If I just give a random hash to `git show` in that repos, I get
fatal: ambiguous argument '...': unknown revision or path not in the working tree.Not "a random hash", but a random abreviated hash. Look: Changing the last digit: $ git show 280c12ab49223c64c6f914944287a7d049cf4d23 fatal: bad object 280c12ab49223c64c6f914944287a7d049cf4d23 $ git show 280c12ab49223c64c6f914944287a7d049cf4d24 fatal: bad object 280c12ab49223c64c6f914944287a7d049cf4d24 $ git show 280c12ab49223c64c6f914944287a7d049cf4d25 fatal: bad object 280c12ab49223c64c6f914944287a7d049cf4d25 $ git show 280c12ab49223c64c6f914944287a7d049cf4d26 fatal: bad object 280c12ab49223c64c6f914944287a7d049cf4d26 Removing the last digit: $ git show 280c12ab49223c64c6f914944287a7d049cf4d2 fatal: ambiguous argument '280c12ab49223c64c6f914944287a7d049cf4d2': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' -- Matthieu Moy http://www-verimag.imag.fr/~moy/