From: Jonathan Tan Date: Wed, 14 Aug 2024 19:30:36 GMT Subject: Re: [PATCH 0/1] revision: fix reachable objects being gc'ed in no blob clone repo Message-ID: <20240814193036.3918771-1-jonathantanmy@google.com> In-Reply-To: Junio C Hamano writes: > Jonathan Tan writes: > > > Jonathan Tan writes: > >> Solutions I can think of: > > > > One more thing that I just thought of regarding the solution in this > > patch. It seems to be to have a different separation of packs: all > > objects currently in promisor packs and all objects currently not > > in promisor packs. And the way it is done is to only exclude (in > > this patch, mark UNINTERESTING, although it might be better to have > > a separate flag for it) objects in promisor packs, but not their > > ancestors. > > You're right to mention two separate bits, especially because you do > not want the "I am in a promisor pack" bit to propagate down to the > ancestry chain like UNINTERESTING bit does. But isn't the approach > to enumerate all objects in promisor packs in an oidset and give a > quick way for is_promisor_object() to answer if an object is or is > not in promisor pack sufficient to replace the need to use _any_ > object flag bits to manage objects in promisor packs? Ah...yes, you're right. But if someone is intending to go this route, note that you can't use the oidset in is_promisor_object() directly, as it contains both objects in promisor packs and objects that they directly reference. You'll need to adapt it.