Re: [PATCH 3/3] abbrev: auto size the default abbreviation

2016-11-01 Thread Jeff King
On Tue, Nov 01, 2016 at 06:33:38PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > On Fri, Sep 30, 2016 at 05:19:37PM -0700, Junio C Hamano wrote: > > > >> Introduce a mechanism, where we estimate the number of objects in > >> the repository upon the first request to

Re: [PATCH 3/3] abbrev: auto size the default abbreviation

2016-11-01 Thread Junio C Hamano
Jeff King writes: > On Fri, Sep 30, 2016 at 05:19:37PM -0700, Junio C Hamano wrote: > >> Introduce a mechanism, where we estimate the number of objects in >> the repository upon the first request to abbreviate an object name >> with the default setting and come up with a sane

Re: [PATCH 3/3] abbrev: auto size the default abbreviation

2016-10-04 Thread Jeff King
On Mon, Oct 03, 2016 at 06:37:18PM -0700, Junio C Hamano wrote: > Jeff King writes: > > >> OK, as Linus's "count at the point of use" is already in 'next', > >> could you make it incremental with a log message? > > > > Sure. I wasn't sure if you actually liked my direction or

Re: [PATCH 3/3] abbrev: auto size the default abbreviation

2016-10-03 Thread Junio C Hamano
Jeff King writes: >> OK, as Linus's "count at the point of use" is already in 'next', >> could you make it incremental with a log message? > > Sure. I wasn't sure if you actually liked my direction or not, so I was > mostly just showing off what the completed one would look like.

Re: [PATCH 3/3] abbrev: auto size the default abbreviation

2016-10-03 Thread Jeff King
On Mon, Oct 03, 2016 at 03:52:44PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > On Mon, Oct 03, 2016 at 03:34:03PM -0700, Linus Torvalds wrote: > > > >> On Mon, Oct 3, 2016 at 3:27 PM, Jeff King wrote: > >> > > >> > + if (len < 0) { > >> > +

Re: [PATCH 3/3] abbrev: auto size the default abbreviation

2016-10-03 Thread Junio C Hamano
Jeff King writes: > On Mon, Oct 03, 2016 at 03:34:03PM -0700, Linus Torvalds wrote: > >> On Mon, Oct 3, 2016 at 3:27 PM, Jeff King wrote: >> > >> > + if (len < 0) { >> > + unsigned long count = approximate_object_count(); >> > +

Re: [PATCH 3/3] abbrev: auto size the default abbreviation

2016-10-03 Thread Jeff King
On Mon, Oct 03, 2016 at 03:34:03PM -0700, Linus Torvalds wrote: > On Mon, Oct 3, 2016 at 3:27 PM, Jeff King wrote: > > > > + if (len < 0) { > > + unsigned long count = approximate_object_count(); > > + len = (msb(count) + 1) / 2; > > +

Re: [PATCH 3/3] abbrev: auto size the default abbreviation

2016-10-03 Thread Linus Torvalds
On Mon, Oct 3, 2016 at 3:27 PM, Jeff King wrote: > > + if (len < 0) { > + unsigned long count = approximate_object_count(); > + len = (msb(count) + 1) / 2; > + if (len < 0) > + len = FALLBACK_DEFAULT_ABBREV; > +

Re: [PATCH 3/3] abbrev: auto size the default abbreviation

2016-10-03 Thread Jeff King
On Fri, Sep 30, 2016 at 05:19:37PM -0700, Junio C Hamano wrote: > Introduce a mechanism, where we estimate the number of objects in > the repository upon the first request to abbreviate an object name > with the default setting and come up with a sane default for the > repository. Based on the

[PATCH 3/3] abbrev: auto size the default abbreviation

2016-09-30 Thread Junio C Hamano
From: Linus Torvalds In fairly early days we somehow decided to abbreviate object names down to 7-hexdigits, but as projects grow, it is becoming more and more likely to see such a short object names made in earlier days and recorded in the log messages no longer