Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 29, 2016, 19:42 UTC
- Message-ID
- <xmqq1t02fq6p.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CA+55aFx9Utm9yDZceks+5q9c8ydc2QMYshWwJ0G0GHWWLwSsXQ@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 15 quoted lines
> 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.
Whew. I was wondering where my brain went wrong, as I knew we have 200k objects and 8 hexdigits means 1<<16 = 64k which is way too short.