From: Han Young Date: Mon, 10 Feb 2025 11:38:17 GMT Subject: Re: [External] [RFC PATCH resend] builtin/repack: Honor --keep-pack and .keep when repacking promisor objects Message-ID: In-Reply-To: <2728513.vuYhMxLoTh@mintaka.ncbr.muni.cz> On Wed, Jan 29, 2025 at 6:12 PM Tomáš Trnka wrote: > > 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.