Re: [PATCH] mktag: don't check SHA-1 object length under SHA-256
- From
Jeff King <peff@peff.net>
- Date
- Nov 23, 2020, 21:36 UTC
- Message-ID
- <X7wrbI/pefHJsfdY@coredump.intra.peff.net>
- In-Reply-To
- <xmqqlferoq1m.fsf@gitster.c.googlers.com>
On Mon, Nov 23, 2020 at 11:01:57AM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> > @@ -58,7 +68,7 @@ static int verify_tag(char *buffer, unsigned long size)
> > return error("char%d: does not start with \"object \"", 0);
> >
> > if (parse_oid_hex(object + 7, &oid, &p))
> > - return error("char%d: could not get SHA1 hash", 7);
> > + return error("char%d: expected object ID, got garbage", 7);
>
> Here you say object ID, which is better than <hash> or <sha>. Let's
> be consistent (I'd say "object name" if I were choosing which to
> use).It might just be me, but "object name" makes me think we'd take any name (e.g., a refname that resolves to an object), whereas "object id" would mean the object's hash specifically. And in this instance we only allow the latter.
I agree very much with your other comments that if we are changing these, we should get away from <sha> completely.
-Peff