From: Junio C Hamano Date: Mon, 06 Feb 2012 08:36:05 GMT Subject: Re: [PATCH 2/3] tag: die when listing missing or corrupt objects Message-ID: <7vfweo8ikq.fsf@alter.siamese.dyndns.org> In-Reply-To: <7vk4408ir6.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > 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).