Re: [PATCH v2 0/3] sample hooks: become hash agnostic
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 23, 2020, 16:34 UTC
- Message-ID
- <xmqqa6xgjvud.fsf@gitster.c.googlers.com>
- In-Reply-To
- <cover.1600853895.git.liu.denton@gmail.com>
Denton Liu <liu.denton@gmail.com> writes:
Show 12 quoted lines
> There are currently two hooks that have hardcoded 40 zeros as the null > OID and, thus, are not hash-agnostic. Rewrite these to get the zero OID using > > git hash-object --stdin </dev/null | tr '[0-9a-f]' '0' > > so that the zero OID is hash-agnostic. > > This was initially done by introducing `git rev-parse --null-oid` to get the > zero OID but that seems like overkill. From a cursory search of Github, the > only instances of the zero OID being used come from clones of the git.git > repository (tests and sample hooks). Since we don't want to introduce an option > that no one will use, don't go this route and just do the easiest thing.
Patches 2&3/3 look quite sensible.
Patch 1/3 is a borderline Meh, as we do not need to force _our_ coding convention to the end-users, even though we do do so on ourselves. But let's take it to make things more consistent.
Thanks.