From: Junio C Hamano Date: Thu, 28 Mar 2013 14:55:43 GMT Subject: Re: Bug in "git rev-parse --verify" Message-ID: <7vtxnvwp3k.fsf@alter.siamese.dyndns.org> In-Reply-To: <20130328140510.GB12898@sigill.intra.peff.net> Jeff King writes: > On Thu, Mar 28, 2013 at 02:04:27PM +0100, Michael Haggerty wrote: > >> $ git rev-parse --verify 1111111111111111111111111111111111111111 >> 1111111111111111111111111111111111111111 >> $ echo $? >> 0 >> >> [...] >> >> I believe that "git rev-parse --verify" is meant to verify that the >> argument is an actual object, and that it should reject fictional SHA1s. >> (If not then the documentation should be clarified.) The same problem >> also exists in 1.8.2 but I haven't checked how much older it is. > > I think it is only about verifying the name of the object. I.e., that > you can resolve the argument to an object. It has always behaved this > way; I even just tested with git v0.99. Correct. It is about "is it well formed and something we can turn into 20-byte object name?" and nothing more. It certainly does not mean "do we have it?", as the function needs to be able to validate something we do not yet have.