On Mon, Feb 27, 2012 at 11:33:49AM -0800, Junio C Hamano wrote: > Jeff King <peff@xxxxxxxx> writes: > > > You would also get NULL if the object exists but is not a commit. Maybe: > > > > die("object '%s' does not point to a commit", ...) > > > > would be better? It covers the wrong-type case, and is still technically > > true when the object does not exist. > > For this particular message I like the above a lot better. The output > from "git grep -e 'invalid object' -e 'bad object'" seems to show that > the use of both are fairly evenly distributed. It looks like "bad object" generally comes from parse_object failing, which makes sense. It either means object corruption or you fed a full 40-char sha1 that didn't exist (which, if you are being that specific, probably is an indication of broken-ness in your repository). It looks like "invalid object" comes from failing to access the subject of an annotated tag or an entry in a tree, both of which would meet the same criteria (corruption or a missing 40-char sha1). I don't think bad versus invalid in existing cases is a big deal, as they are both used consistently. But in this case, I think either would be wrong, since it is equally likely that the user gave an existing, OK object of the wrong type. -Peff -- 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