git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] make --max-pack-size argument to 'git pack-object' count in bytes

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 4, 2010, 17:24 UTC
Message-ID
<20100204172421.GA18548@spearce.org>
In-Reply-To
<7vtytxexjl.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Subject: [PATCH] fast-import: count --max-pack-size in bytes
>  	if (!prefixcmp(option, "max-pack-size=")) {
> -		option_max_pack_size(option + 14);
> +		unsigned long v;
> +		if (!git_parse_ulong(option + 14, &v))
> +			return 0;
> +		if (v < 1024 * 1024) {
> +			warning("minimum max-pack-size is 1 MiB");
> +			v = 1024 * 1024;
> +		}
> +		max_packsize = v;
How about for a transition period we do:
  if (v < 8192) {
  	warning("max-pack-size is now in bytes, assuming %dm", v);
	v *= 1024 * 1024;
  }

So that existing users won't be completely broken if they are relying on this flag, and have some time to adjust.

Given the huge magnitude between the old sane value range, and the new sane value range, we can safely assume anything below a small number like 8192 is an old user, warn them, and assume old behavior.

A local pack smaller than 1 MiB is mostly pointless coming out of a tool like git repack or git fast-import, unless its a complete copy of the repository. So the old style calling convention of 4096 for 4 GiB would now imply a pack so small, we probably can't get more than 1 object per pack.

-- 
Shawn.
Previous: Junio C HamanoNext: Nicolas Pitre
Message 7 of 16 in “fix multiple issues with t5300”
  1. 1/3 fix multiple issues with t5300Nicolas Pitre, Feb 4, 2010
  2. 2/3 pack-objects: fix pack generation when using pack_size_limitNicolas Pitre, Feb 4, 2010
  3. 3/3 make --max-pack-size argument to 'git pack-object' count in bytesNicolas Pitre, Feb 4, 2010
  4. Shawn O. PearceFeb 4, 2010
  5. Junio C HamanoFeb 4, 2010
  6. Junio C HamanoFeb 4, 2010
  7. Shawn O. PearceFeb 4, 2010
  8. Nicolas PitreFeb 4, 2010
  9. Shawn O. PearceFeb 4, 2010
  10. fast-import: count --max-pack-size in bytesJunio C Hamano, Feb 4, 2010
  11. Shawn O. PearceFeb 4, 2010
  12. Ilari LiusvaaraFeb 4, 2010
  13. Nicolas PitreFeb 4, 2010
  14. Shawn O. PearceFeb 4, 2010
  15. Nicolas PitreFeb 4, 2010
  16. Shawn O. PearceFeb 4, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.