Re: [PUB]corrupt repos does not return error with `git fsck`
- From
Stefan Beller <sbeller@google.com>
- Date
- May 20, 2015, 21:13 UTC
- Message-ID
- <CAGZ79kab8a9H2SFaqi2PFLxhqH86wD35STPo0Jw7CyFe7e9tig@mail.gmail.com>
- In-Reply-To
- <xmqq4mn7m00c.fsf@gitster.dls.corp.google.com>
On Wed, May 20, 2015 at 2:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> On Wed, May 20, 2015 at 1:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>>
>>> So...
>>
>> maybe we need a command:
>>
>> Given this SHA1, tell me anything you know about it,
>> Is it a {blob,tree,commit,tag}?
>> Is it referenced from anywhere else in this repository and if so, which type?
>> And if it is not referenced, nor an object, tell me so explicitely.
>
> Let me add another to that list ;-)
>
> I have this prefix; please enumerate all known objects that share it.
>
> I do not know the value of the first two in your list. If it is a
> known object, then you throw it at "git show", "git cat-file -t" and
> dig from there. If it is not known, there is nothing more to do.Right, I just tried to think of all the questions which are relevant to answer in such a case, so probably this can be outside of
> > I do not know if "need" is the right word, but I hope that you > realize the last two among the four you listed need the equivalent > of "git fsck". It is an expensive operation.
Yes, I do realize that. The way I interpreted Faheems original message was:
git fsck tells me everything is alright, but I don't trust fsck.
So now I want
to find a way to ask Git about everything it knows about this
$SHA1 and print
it for me so I can manually look at each entry and verify by hand.So that's why I included the parts easily done with cat-file and show.