Re: [PUB]corrupt repos does not return error with `git fsck`
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 20, 2015, 20:39 UTC
- Message-ID
- <xmqqlhgjm19z.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20150520183115.GB7142@peff.net>
Jeff King <peff@peff.net> writes:
> I should have looked before replying. It would indeed break "cat-file > -e" horribly. So the right answer may be to just improve the "bad > object" message (probably by checking has_sha1_file there and diagnosing > it either as missing or corrupted).
I should have looked before replying, too ;-)
Yeah, "bad object" sounds as if we tried to parse something that exists and it was corrupt. So classifying "a file or a pack index entry exists where a valid object with that name should reside in" as "bad object" and "there is no such file or a pack index entry that would house the named object" as "missing object" _might_ make things better.
But let's think about it a bit more. Would it have prevented the original confusion if we said "missing object"? I have a feeling that it wouldn't have. Faheem was so convinced that the object named with the 40-hex *must* exist in the cloned repository, and if we told "missing object" to such a person, it will just enforce the (mis)conception that the repository is somehow corrupt, when it is not.
So...