From: Junio C Hamano Date: Thu, 29 Sep 2016 19:42:38 GMT Subject: Re: [PATCH 4/4] core.abbrev: raise the default abbreviation to 12 hexdigits Message-ID: In-Reply-To: Linus Torvalds writes: > On Thu, Sep 29, 2016 at 11:55 AM, Linus Torvalds > 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.