From: Jeff King <peff@peff.net>
To: Eric Wong <e@80x24.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] gc: fix off-by-one error with gc.autoPackLimit
Date: Mon, 27 Jun 2016 15:38:42 -0400 [thread overview]
Message-ID: <20160627193842.GD10877@sigill.intra.peff.net> (raw)
In-Reply-To: <20160625064647.GA20659@dcvr.yhbt.net>
On Sat, Jun 25, 2016 at 06:46:47AM +0000, Eric Wong wrote:
> This matches the documentation and allows gc.autoPackLimit=1
> to maintain a single pack without attempting a repack on every
> "git gc --auto" invocation.
>
> Signed-off-by: Eric Wong <e@80x24.org>
> ---
> builtin/gc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/gc.c b/builtin/gc.c
> index c583aad..332bcf7 100644
> --- a/builtin/gc.c
> +++ b/builtin/gc.c
> @@ -177,7 +177,7 @@ static int too_many_packs(void)
> */
> cnt++;
> }
> - return gc_auto_pack_limit <= cnt;
> + return gc_auto_pack_limit < cnt;
> }
Looks good, and I cannot think of any real downside. "0" is special for
"do not use this limit", so you now have no way of asking to gc every
time. But why would you want to? Asking for 1 pack is effectively "gc if
something happened, otherwise do nothing".
-Peff
prev parent reply other threads:[~2016-06-27 19:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-25 1:14 [RFC] gc: correct gc.autoPackLimit documentation Eric Wong
2016-06-25 2:06 ` Jeff King
2016-06-25 2:53 ` Eric Wong
2016-06-25 6:14 ` Junio C Hamano
2016-06-25 6:46 ` [PATCH] gc: fix off-by-one error with gc.autoPackLimit Eric Wong
2016-06-27 19:38 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160627193842.GD10877@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=e@80x24.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).