Re: [PATCH RFC] cherry: support --abbrev option

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

 



Am 15.03.2010 23:30, schrieb Erik Faye-Lund:
> On Mon, Mar 15, 2010 at 6:08 PM, René Scharfe
>> If I use --no-abbrev, do I get 0 or 40 hash chars?  I didn't actually
>> test it, but I suspect an "if (!abbrev) abbrev = 40;" is needed somewhere.
> 
> "abbrev" is initialized to 40 when declared, so you get the same
> behavior as before by default.

Yes, but --no-abbrev sets it to zero.  Which is OK, though, as I found
out after actually testing your patch this time.  A closer look at
find_unique_abbrev() in sha1_name.c reveals that the function returns
the full hash if len is either 40 or 0.

So you could initialize abbrev to zero and avoid the magic constant 40
there altogether.  (Is this still nitpicking or already bikeshedding? ;)

René
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]