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 10:11:25AM -0400, Taylor Blau wrote:
> Hi Denton,
>
> On Fri, Sep 18, 2020 at 04:19:03AM -0700, Denton Liu wrote:
> > When a user needed the null OID for scripting purposes, it used to be
> > very easy: hardcode 40 zeros. However, since Git started supporting
> > SHA-256, this assumption became false which may break some scripts.
> > Allow users to fix their broken scripts by providing users with a
> > hash-agnostic method of obtaining the null OID.
>
> I have not been very involved in the hash transition, so please take my
> comments with a grain of salt (and if they are misplaced, feel free to
> ignore them).

Same disclaimer above applies here, too ;-). There are a number of spots
in the test suite that reference 'ZERO_OID', as well as OIDs for the
empty tree and blob. Maybe the definition of those could be updated to
use any new flags you do/don't introduce?

I'd be just as happy if that were to occur in a different series than
this, since I don't want to hold you up by adding a bunch of new things
to your list.

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.

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