From: Junio C Hamano <gitster@pobox.com>
To: Han Young <hanyang.tony@bytedance.com>
Cc: git@vger.kernel.org, C O Xing Xin <xingxin.xx@bytedance.com>,
Jonathan Tan <jonathantanmy@google.com>,
Jeff Hostetler <jeffhostetler@github.com>
Subject: Re: [PATCH 1/1] revision: don't set parents as uninteresting if exclude promisor objects
Date: Fri, 02 Aug 2024 09:45:28 -0700 [thread overview]
Message-ID: <xmqq4j82euvr.fsf@gitster.g> (raw)
In-Reply-To: <20240802073143.56731-2-hanyang.tony@bytedance.com> (Han Young's message of "Fri, 2 Aug 2024 15:31:43 +0800")
Han Young <hanyang.tony@bytedance.com> writes:
> In revision.c, `process_parents()` recursively marks commit parents
> as UNINTERESTING if the commit itself is UNINTERESTING.
Makes sense.
> `--exclude-promisor-objects` is implemented as
> "iterate all objects in promisor packfiles, mark them as UNINTERESTING".
Also makes sense.
> So when we find a commit object in a promisor packfile, we also set its ancestors
> as UNINTERESTING, whether the ancestor is a promisor object or not.
> This causes normal objects to be falsely marked as promisor objects
> and removed by `git repack`.
Ahh, that is not desirable. So the need to do something to fix it
is well established here.
> Signed-off-by: Han Young <hanyang.tony@bytedance.com>
> Helped-by: C O Xing Xin <xingxin.xx@bytedance.com>
> ---
Please order these trailer lines logically in chronological order,
i.e. you get helped by others to complete the change and then seal
it by signing it off at the end. I'll swap these two while queuing.
> diff --git a/revision.c b/revision.c
> index 1c0192f522..eacb0c909d 100644
> --- a/revision.c
> +++ b/revision.c
> @@ -1164,7 +1164,7 @@ static int process_parents(struct rev_info *revs, struct commit *commit,
> * wasn't uninteresting), in which case we need
> * to mark its parents recursively too..
> */
> - if (commit->object.flags & UNINTERESTING) {
> + if (!revs->exclude_promisor_objects && commit->object.flags & UNINTERESTING) {
> while (parent) {
> struct commit *p = parent->item;
> parent = parent->next;
But if the iteration is over all objects in certain packfiles to
mark them all uninteresting, shouldn't the caller avoid the call to
process_parents() in the first place? Letting process_parents() to
do other things and only refrain from doing the "this commit is
marked uninteresting" part does not quite match what you are trying
to do, at least to me.
Please check "git blame" to find those who are likely to know better
about the code around the area and ask for help from them. I think
the bulk of the logic related came from the series that led to
f3d618d2 (Merge branch 'jh/fsck-promisors', 2018-02-13), so I added
the authors of the series.
It apepars to me that its approach to exclude the objects that
appear in the promisor packs may be sound, but the design and
implementation of it is dubious. Shouldn't it be getting the list
of objects with get_object_list() WITHOUT paying any attention to
--exclude-promisor-objects flag, and then filtering objects that
appear in the promisor packs out of that list, without mucking with
the object and commit traversal in revision.c at all?
Thanks.
next prev parent reply other threads:[~2024-08-02 16:45 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 7:31 [PATCH 0/1] revision: fix reachable objects being gc'ed in no blob clone repo Han Young
2024-08-02 7:31 ` [PATCH 1/1] revision: don't set parents as uninteresting if exclude promisor objects Han Young
2024-08-02 16:45 ` Junio C Hamano [this message]
2024-08-12 12:34 ` [External] " 韩仰
2024-08-12 16:09 ` Junio C Hamano
2024-08-22 8:28 ` 韩仰
2024-08-13 0:45 ` [PATCH 0/1] revision: fix reachable objects being gc'ed in no blob clone repo Jonathan Tan
2024-08-13 17:18 ` Jonathan Tan
2024-08-14 4:10 ` Junio C Hamano
2024-08-14 19:30 ` Jonathan Tan
2024-08-23 12:43 ` [WIP v2 0/4] " Han Young
2024-08-23 12:43 ` [WIP v2 1/4] packfile: split promisor objects oidset into two Han Young
2024-08-23 12:43 ` [WIP v2 2/4] revision: add exclude-promisor-pack-objects option Han Young
2024-08-23 12:43 ` [WIP v2 3/4] revision: don't mark commit as UNINTERESTING if --exclude-promisor-objects is set Han Young
2024-08-23 12:43 ` [WIP v2 4/4] repack: use new exclude promisor pack objects option Han Young
2024-09-19 23:47 ` [PATCH 0/2] revision: fix reachable commits being gc'ed in partial repo Calvin Wan
2024-09-19 23:47 ` [PATCH 1/2] packfile: split promisor objects oidset into two Calvin Wan
2024-09-22 6:37 ` Junio C Hamano
2024-09-19 23:47 ` [PATCH 2/2] fetch-pack.c: do not declare local commits as "have" in partial repos Calvin Wan
2024-09-22 6:53 ` Junio C Hamano
2024-09-22 16:41 ` Junio C Hamano
2024-09-23 3:44 ` [External] " 韩仰
2024-09-23 16:21 ` Junio C Hamano
2024-10-02 22:35 ` Calvin Wan
2024-09-25 7:20 ` [PATCH 0/2] repack: pack everything into promisor packfile " Han Young
2024-09-25 7:20 ` [PATCH 1/2] repack: pack everything into packfile Han Young
2024-09-25 7:20 ` [PATCH 2/2] t0410: adapt tests to repack changes Han Young
2024-09-25 15:20 ` [PATCH 0/2] repack: pack everything into promisor packfile in partial repos Phillip Wood
2024-09-25 16:48 ` Junio C Hamano
2024-09-25 17:03 ` Junio C Hamano
2024-10-01 19:17 ` Missing Promisor Objects in Partial Repo Design Doc Calvin Wan
2024-10-01 19:35 ` Junio C Hamano
2024-10-02 2:54 ` Junio C Hamano
2024-10-02 7:57 ` [External] " Han Young
2024-10-08 21:35 ` Calvin Wan
2024-10-09 6:46 ` [External] " Han Young
2024-10-09 18:34 ` Jonathan Tan
2024-10-12 2:05 ` Jonathan Tan
2024-10-12 3:30 ` Han Young
2024-10-14 17:52 ` Jonathan Tan
2024-10-09 18:53 ` Jonathan Tan
2024-10-08 8:13 ` [PATCH v2 0/3] repack: pack everything into promisor packfile in partial repos Han Young
2024-10-08 8:13 ` [PATCH v2 1/3] repack: pack everything into packfile Han Young
2024-10-08 21:41 ` Calvin Wan
2024-10-08 8:13 ` [PATCH v2 2/3] t0410: adapt tests to repack changes Han Young
2024-10-08 8:13 ` [PATCH v2 3/3] partial-clone: update doc Han Young
2024-10-08 21:57 ` [PATCH v2 0/3] repack: pack everything into promisor packfile in partial repos Junio C Hamano
2024-10-08 22:43 ` Junio C Hamano
2024-10-09 6:31 ` [External] " Han Young
2024-10-11 8:24 ` [PATCH v3 " Han Young
2024-10-11 8:24 ` [PATCH v3 1/3] repack: pack everything into packfile Han Young
2024-10-11 8:24 ` [PATCH v3 2/3] repack: adapt tests to repack changes Han Young
2024-10-11 8:24 ` [PATCH v3 3/3] partial-clone: update doc Han Young
2024-10-11 18:18 ` [PATCH v3 0/3] repack: pack everything into promisor packfile in partial repos Junio C Hamano
2024-10-11 18:23 ` Junio C Hamano
2024-10-14 3:25 ` [PATCH v4 " Han Young
2024-10-14 3:25 ` [PATCH v4 1/3] repack: pack everything into packfile Han Young
2024-10-14 3:25 ` [PATCH v4 2/3] t0410: adapt tests to repack changes Han Young
2024-10-14 3:25 ` [PATCH v4 3/3] partial-clone: update doc Han Young
2024-10-21 22:29 ` [WIP 0/3] Repack on fetch Jonathan Tan
2024-10-21 22:29 ` [WIP 1/3] move variable Jonathan Tan
2024-10-21 22:29 ` [WIP 2/3] pack-objects Jonathan Tan
2024-10-21 22:29 ` [WIP 3/3] record local links and call pack-objects Jonathan Tan
2024-10-23 7:00 ` [External] [WIP 0/3] Repack on fetch Han Young
2024-10-23 17:03 ` Jonathan Tan
-- strict thread matches above, loose matches on Subject: below --
2024-07-19 9:34 [PATCH 0/1] Fix bug in revision walk if --exclude-promisor-objects is set Han Young
2024-07-19 9:34 ` [PATCH 1/1] revision: don't set parents as uninteresting if exclude promisor objects Han Young
2024-07-20 5:28 ` [PATCH 0/1] Fix bug in revision walk if --exclude-promisor-objects is set Han Young
2024-07-20 5:28 ` [PATCH 1/1] revision: don't set parents as uninteresting if exclude promisor objects Han Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq4j82euvr.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=hanyang.tony@bytedance.com \
--cc=jeffhostetler@github.com \
--cc=jonathantanmy@google.com \
--cc=xingxin.xx@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).