From: Patrick Steinhardt <ps@pks.im>
To: Christian Couder <christian.couder@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [PATCH v2 2/4] odb/source-packed: support flags when iterating an object prefix
Date: Thu, 25 Jun 2026 07:52:14 +0200 [thread overview]
Message-ID: <ajzCDpviaL6EillJ@pks.im> (raw)
In-Reply-To: <CAP8UFD1sJNJbAAu9ZUanB8gJV-Vb64pLVkNULm3onSFZirdKxA@mail.gmail.com>
On Wed, Jun 24, 2026 at 07:02:48PM +0200, Christian Couder wrote:
> On Wed, Jun 24, 2026 at 12:37 PM Patrick Steinhardt <ps@pks.im> wrote:
> > diff --git a/odb/source-packed.c b/odb/source-packed.c
> > index 3afc4bf01f..6f31f0ff94 100644
> > --- a/odb/source-packed.c
> > +++ b/odb/source-packed.c
> > @@ -171,6 +172,20 @@ static int for_each_prefixed_object_in_midx(
> > const struct object_id *current = NULL;
> > struct object_id oid;
> >
> > + if (opts->flags) {
> > + uint32_t pack_id = nth_midxed_pack_int_id(m, i);
> > + struct packed_git *pack;
> > +
> > + if (prepare_midx_pack(m, pack_id)) {
> > + pack_errors = true;
> > + continue;
> > + }
> > +
> > + pack = nth_midxed_pack(m, pack_id);
> > + if (should_exclude_pack(pack, opts->flags))
> > + continue;
> > + }
> > +
> > current = nth_midxed_object_oid(&oid, m, i);
> >
> > if (!match_hash(len, opts->prefix->hash, current->hash))
>
> It looks like this is:
>
> if (!match_hash(len, opts->prefix->hash, current->hash))
> break;
>
> and I wonder if the `if (opts->flags) { ... }` block would be better
> after that prefix check rather than before it.
>
> Putting it after the prefix check would make sure we don't continue
> when the prefix doesn't match.
Hm, that's a good point indeed. Will adapt, thanks!
Patrick
next prev parent reply other threads:[~2026-06-25 5:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 8:49 [PATCH 0/3] connected: search promisor objects generically Patrick Steinhardt
2026-06-22 8:49 ` [PATCH 1/3] odb/source-packed: extract logic to skip certain packs Patrick Steinhardt
2026-06-22 17:51 ` Junio C Hamano
2026-06-22 8:49 ` [PATCH 2/3] odb/source-packed: support flags when iterating an object prefix Patrick Steinhardt
2026-06-22 8:49 ` [PATCH 3/3] connected: search promisor objects generically Patrick Steinhardt
2026-06-22 17:57 ` Junio C Hamano
2026-06-24 9:33 ` Patrick Steinhardt
2026-06-23 7:45 ` Christian Couder
2026-06-24 9:33 ` Patrick Steinhardt
2026-06-24 10:37 ` [PATCH v2 0/4] " Patrick Steinhardt
2026-06-24 10:37 ` [PATCH v2 1/4] odb/source-packed: extract logic to skip certain packs Patrick Steinhardt
2026-06-24 10:37 ` [PATCH v2 2/4] odb/source-packed: support flags when iterating an object prefix Patrick Steinhardt
2026-06-24 17:02 ` Christian Couder
2026-06-25 5:52 ` Patrick Steinhardt [this message]
2026-06-24 10:37 ` [PATCH v2 3/4] connected: split out promisor-based connectivity check Patrick Steinhardt
2026-06-24 10:37 ` [PATCH v2 4/4] connected: search promisor objects generically Patrick Steinhardt
2026-06-24 16:27 ` Junio C Hamano
2026-06-25 5:54 ` Patrick Steinhardt
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=ajzCDpviaL6EillJ@pks.im \
--to=ps@pks.im \
--cc=chriscool@tuxfamily.org \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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