Junio C Hamano <gitster@xxxxxxxxx> 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). -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html