Re: [External] Re: [PATCH 1/1] revision: don't set parents as uninteresting if exclude promisor objects
- From
韩仰 <hanyang.tony@bytedance.com>
- Date
- Aug 22, 2024, 08:28 UTC
- Message-ID
- <CAG1j3zHKic1DQr-M2nS6Qjp=DV5B90guNbP-PgQkxY2e3XtK8g@mail.gmail.com>
- In-Reply-To
- <xmqqo75x67v7.fsf@gitster.g>
On Tue, Aug 13, 2024 at 12:09 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> Perhaps another simpler approach may be to use is_promisor_object() > function and get rid of this initial marking of these objects in > prepare_revision_walk() with the for_each_packed_object() loop, > which abuses the UNINTERESTING bit. The feature wants to exclude > objects contained in these packs, but does not want to exclude > objects that are referred to and outside of these packs, so > UNINTERESTING bit whose natural behaviour is to propagate down the > history is a very bad fit for it. We may be able to lose a lot of > existing code paths that say "if exclude_promisor_objects then do > this", and filter objects out with "is_promisor_object()" at the > output phase near get_revision().
I tried to go down this route. I removed the for_each_packed_object() loop and filter promisor commits in get_revision_1() instead. However, this only filtered promisor commits, not promisor trees and objects. A combined approach would be keeping the for_each_packed_object() loop, but only mark non-commit objects as UNINTERESTING there, and filter promisor commits in get_revision()?