Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Sep 29, 2016, 19:06 UTC
- Message-ID
- <CA+55aFx9Utm9yDZceks+5q9c8ydc2QMYshWwJ0G0GHWWLwSsXQ@mail.gmail.com>
- In-Reply-To
- <CA+55aFwbCNiF0nDppZ5SuRcZwc9kNvKYzgyd_bR8Ut8XRW_p4Q@mail.gmail.com>
On Thu, Sep 29, 2016 at 11:55 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote:
> > For the kernel, just the *math* right now actually gives 12 > characters. For current git it actually seems to say that 8 is the > correct number. For small projects, you'll still see 7.
Sorry, the git number is 9, not 8. The reason is that git has roughly 212k objects, and 9 hex digits gets expected collisions at about 256k objects.
So the logic means that we'll see 7 hex digits for projects with less than 16k objects, 8 hex digits if there are less than 64k objects, and 9 hex digits for projects like git that currently have fewer than 256k objects.
But git itself might not be *that* far from going to 10 hex digits with my patch.
The kernel uses 12 he digits because the collision math says that's the right thing for a project with between 4M and 16M objects (with the kernel being at 5M).
So on the whole the patch really does seem to just do the right thing automatically.
Linus