Re: [PATCH 3/3] abbrev: auto size the default abbreviation
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Oct 3, 2016, 22:34 UTC
- Message-ID
- <CA+55aFydV+9c3-5C03XUj7v_wGJF5NyJNaP6742zLVgZs410FA@mail.gmail.com>
- In-Reply-To
- <20161003222701.za5njew33rqc5b6g@sigill.intra.peff.net>
On Mon, Oct 3, 2016 at 3:27 PM, Jeff King <peff@peff.net> wrote:
Show 7 quoted lines
>
> + if (len < 0) {
> + unsigned long count = approximate_object_count();
> + len = (msb(count) + 1) / 2;
> + if (len < 0)
> + len = FALLBACK_DEFAULT_ABBREV;
> + }that second "if (len < 0)" should probably be testing against FALLBACK_DEFAULT_ABBREV, not zero. Or at the very least MINIMUM_ABBREV. Because a two-character abbreviation won't even be recognized, even if the git project is very small indeed.
Linus