Re: [PATCH 2/4] builtin/rev-parse: learn --null-oid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 18, 2020 at 11:16:54AM -0700, Junio C Hamano wrote:
> Taylor Blau <me@xxxxxxxxxxxx> 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".

Yeah, my uncertainty ("should this be '--empty-oid' or '--null-oid'?")
is probably a good indication (to me, at least) that the option
shouldn't even exist.

> 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?

Absolutely.

> Take this as a mild indifference, not as a strong rejection.

For what it's worth, I'm probably as indifferent as you. I would be
slightly less so if there was evidence of lots of out-of-tree scripts
that care about these special OIDs, but I haven't looked too far.


Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux