Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Sep 30, 2016, 00:57 UTC
- Message-ID
- <CA+55aFxsfxvDQqi2M3TUVvAHUx3Qm1hHQ4DMyzXzN6V2v7o-3A@mail.gmail.com>
- In-Reply-To
- <CA+55aFyXxQSygO-gqevLZDjuggOaHs7HsRO=P6GhpC3GStqwvQ@mail.gmail.com>
On Thu, Sep 29, 2016 at 5:28 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 6 quoted lines
> > To be fair, my original patch had a different worry that I didn't > bother with: what if one of the _other_ callers of "get_short_sha1()" > passed in -1 to it. I only handled the -1 case in th eone path care > about in that first RFC for testing. So I'm *not* suggesting you > should apply my first version,, It has issues too.
Actually, all the other cases seem to be "parse a SHA1 with a known length", so they really don't have a negative length. So this seems ok, and is easier to verify than the "what all contexts might use DEFAULT_ABBREV" thing. There's only a few callers, and it's a static function so it's easy to check it locally in sha1_name.c.
Linus