Re: [PATCH] fix pack.packSizeLimit and --max-pack-size handling
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 12, 2008, 17:46 UTC
- Message-ID
- <7vk5b8q1l4.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.LFD.2.00.0811121109420.27509@xanadu.home>
Nicolas Pitre <nico@cam.org> writes:
Show 10 quoted lines
> First, pack.packSizeLimit and --max-pack-size didn't use the same base > unit which was confusing. They both use MiB now. > > Also, if the limit was sufficiently low, having a single object written > could bust the limit (by design), but caused the remaining allowed size > to go negative for subsequent objects, which for an unsigned variable is > a rather huge limit. > > Signed-off-by: Nicolas Pitre <nico@cam.org> > ---
Show 6 quoted lines
> @@ -1844,7 +1848,7 @@ static int git_pack_config(const char *k, const char *v, void *cb)
> return 0;
> }
> if (!strcmp(k, "pack.packsizelimit")) {
> - pack_size_limit_cfg = git_config_ulong(k, v);
> + pack_size_limit_cfg = git_config_ulong(k, v) * 1024 * 1024;The fix to tweak the limit for subsequent split pack is a good thing to have, but this change would break existing repositories where people specified 20971520 (or worse yet "20m") to limit the size to 20MB.
I think --max-pack-size is what should be fixed to use git_parse_ulong() to match the configuration, if you find the discrepancy disturbing.