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

Re: [External] [RFC PATCH resend] builtin/repack: Honor --keep-pack and .keep when repacking promisor objects

From
Han Young <hanyang.tony@bytedance.com>
Date
Feb 10, 2025, 11:38 UTC
Message-ID
<CAG1j3zH1xngk0NZUjHA9Akx526yfEiQ=KsdfyRjE9XAewWV=Sg@mail.gmail.com>
In-Reply-To
<2728513.vuYhMxLoTh@mintaka.ncbr.muni.cz>
On Wed, Jan 29, 2025 at 6:12 PM Tomáš Trnka <trnka@scm.com> wrote:
Show 9 quoted lines
>
> git-repack currently does not pass --keep-pack or --honor-pack-keep to
> the git-pack-objects handling promisor packs. This means that settings
> like gc.bigPackThreshold are completely ignored for promisor packs.
>
> The simple fix is to just copy the keep-pack logic into
> repack_promisor_objects(), although this could possibly be improved by
> making prepare_pack_objects() handle it instead.
>

We repack promisor packs by reading all the objects in promisor packs (in repack.c), and send them to pack-objects. pack-objects then write a single pack containing all the promisor objects. The actual old promisor pack deletion happens in repack.c

So just simply copying the keep-pack logic to repack_promisor_objects() does not prevent the keep promisor packs from being repacked.

One way to achieve what you wanted would be to filter the keep packs in repack_promisor_objects's for_each_packed_object().

Thanks.
Previous: Tomáš TrnkaNext: Tomáš Trnka
Message 4 of 6 in “builtin/repack: Honor --keep-pack and .keep when repacking promisor objects”
  1. builtin/repack: Honor --keep-pack and .keep when repacking promisor objectsTomáš Trnka, Jan 29, 2025
  2. brian m. carlsonJan 30, 2025
  3. Tomáš TrnkaJan 30, 2025
  4. Han YoungFeb 10, 2025
  5. Tomáš TrnkaFeb 10, 2025
  6. Han YoungFeb 19, 2025

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.