From: Toon Claes Date: Thu, 26 Nov 2026 15:26:24 GMT Subject: Re: [PATCH 6/6] packfile: skip closing packs marked as do-not-close Message-ID: <874id3sjfj.fsf@dev.null.iotcl.com.invalid> In-Reply-To: Junio C Hamano writes: > Patrick Steinhardt writes: > >> When closing a packfile to maintain the maximum number of open packs we >> completely ignore the `do_not_close` bit. That bit is only set by >> git-fast-import(1), and as that command allocates its packs manually it >> wouldn't add those packs to the list of all packfiles, and consequently >> we won't ever try to close such a packfile via `close_one_pack()`. But >> that feels like coincidence rather than proper design, and the result is >> rather fragile. >> >> Skip over packfiles marked as do-not-close to reduce the fragility. This >> should not result in a user-visible change in behaviour. > > Hmph. If the only user of the bit does not care that this codepath does > not honor the bit, perhaps a simpler alternative is to retire the bit > that nobody else uses? Or am I reading the above analysis incorrectly? Before this patch, there is one user of this bit: use_pack(). This function might open the pack to mmap() it, and close afterward, unless do_not_close is set. -- Laters, Toon