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

Re: There should have be git gc --repack-arguments

From
Bryan Turner <bturner@atlassian.com>
Date
Apr 7, 2021, 19:38 UTC
Message-ID
<CAGyf7-GQ_1JV6X3Z0h4c3+Qy1eZ30RW-Mni=72p007md5NLKMg@mail.gmail.com>
In-Reply-To
<b35a68a1-e693-5502-7a28-a1dd8222d3a0@gmail.com>
On Wed, Apr 7, 2021 at 5:10 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:
Show 12 quoted lines
>
> Hi,
>
> I request that git gc should have --repack-arguments option. The value
> of this option should be passed to git repack.
>
> The use case is when I have very large repos (such as GCC and Linux kernel)
> on a server with small RAM (1-2 GB). When doing gc on such repo, the repack
> step may hang because git-repack have to create single large packfile which
> can be larger than available memory (RAM+swap), so it must be necessary to
> do git repack --window-memory=<desired memory usage> --max-pack-size=<desired
> pack size> to create split and smaller packs instead.

I can't speak to the feature request, but since there are configuration knobs already for both of those, that implies you can use git -c pack.windowMemory=... -c pack.packSizeLimit=... gc and those configuration settings will be propagated to the git repack process that git gc runs.

>
> There should also git config item gc.repackArguments, which have the same
> effect as git gc --repack-arguments, with the option takes precedence over
> the config.

Passing configuration settings as I show above would already take precedence over any config file, since config from the command line is higher priority.

Hope this helps! Bryan

Previous: Jeff KingNext: Bagas Sanjaya
Message 9 of 10 in “There should have be git gc --repack-arguments”
  1. Bagas SanjayaApr 7, 2021
  2. Jeff KingApr 7, 2021
  3. Junio C HamanoApr 7, 2021
  4. Jeff KingApr 7, 2021
  5. Junio C HamanoApr 7, 2021
  6. Jeff KingApr 7, 2021
  7. Bagas SanjayaApr 9, 2021
  8. Jeff KingApr 9, 2021
  9. Bryan TurnerApr 7, 2021
  10. Bagas SanjayaApr 8, 2021

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.