Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 18, 2020, 18:16 UTC
- Message-ID
- <xmqqy2l7kl0p.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200918141614.GC1602321@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
> In either case, I think '--zero-oid' makes more sense than '--null-oid' > (and it matches the tests that are already written). The pair > '--zero-oid' and '--empty-oid=<type>' make sense to me.
I am not sure rev-parse should even know about "empty-oid". An end user or a script who wants to learn what name an empty blob has can and should ask "git hash-object -t blob --stdin </dev/null".
I can buy --zero-oid might be handy, but don't see a pressing need if it is merely to support our test suite and sample hooks. Instead, something like
ZERO_OID=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
should suffice, no?
Take this as a mild indifference, not as a strong rejection.