Re: [PATCH 2/3] tag: die when listing missing or corrupt objects
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 6, 2012, 08:36 UTC
- Message-ID
- <7vfweo8ikq.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vk4408ir6.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
> Hmm, a pedant in me says a tag object cannot have zero length, so the > second case is also an indication of a corrupt repository, unless the tag > happens to be a lightweight one that refers directly to a blob object that > is empty. > > For that matter, shouldn't we make sure that the type is OBJ_TAG? It might > make sense to allow OBJ_COMMIT (i.e. lightweight tag to a commit) as well, > because the definition of "first N lines" is compatible between tag and > commit for the purpose of the -n option.
Ahh, Ok, your 3/3 addresses this exact issue.
I do not object to silently return when the object is not OBJ_TAG (even though I slightly prefer showing the first N lines of commit log contents for OBJ_COMMIT lightweight tag), but I still think it should be warned just like a corruption when we see (type == OBJ_TAG && !size).