Thread (2 messages) 2 messages, 2 authors, 2016-06-15

Re: [PATCH (resend)] git-gui: make gc warning threshold match 'git gc --auto'

From: Heiko Voigt <hidden>
Date: 2016-06-15 23:05:19

On Sat, Jun 13, 2015 at 10:22:17PM +0200, Karsten Blees wrote:
Date: Wed, 6 Aug 2014 20:43:46 +0200

The number of loose objects at which git-gui shows a gc warning has
historically been hardcoded to ~2000, or ~200 on Windows. The warning can
only be disabled completely via gui.gcwarning=false.

Especially on Windows, the hardcoded threshold is so ridiculously low that
git-gui often complains even immediately after gc (due to loose objects
only referenced by the reflog).

'git gc --auto' uses a much bigger threshold to check if gc is necessary.
Additionally, the value can be configured via gc.auto (default 6700).
There's no special case for Windows.

Change git-gui so that it only warns if 'git gc --auto' would also do an
automatic gc, i.e.:
 - calculate the threshold from the gc.auto setting (default 6700,
   disabled if <= 0)
 - check directory .git/objects/17

We still check four directories (14-17) if gc.auto is very small, to get a
better estimate.

Signed-off-by: Karsten Blees <redacted>
Thanks, I like this!

Cheers Heiko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help