From: Patrick Steinhardt <ps@pks.im>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, Karthik Nayak <karthik.188@gmail.com>,
Justin Tobler <jltobler@gmail.com>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v3 10/14] treewide: drop uses of `for_each_{loose,packed}_object()`
Date: Fri, 23 Jan 2026 10:43:00 +0100 [thread overview]
Message-ID: <aXNCpJ6q3HwcwhPG@pks.im> (raw)
In-Reply-To: <aXLEzAnNRTf5A6bt@nand.local>
On Thu, Jan 22, 2026 at 07:46:04PM -0500, Taylor Blau wrote:
> On Wed, Jan 21, 2026 at 01:50:26PM +0100, Patrick Steinhardt wrote:
> > diff --git a/builtin/cat-file.c b/builtin/cat-file.c
> > index 6964a5a52c..7d16fbc1b8 100644
> > --- a/builtin/cat-file.c
> > +++ b/builtin/cat-file.c
> > @@ -846,8 +849,15 @@ static void batch_each_object(struct batch_options *opt,
> > .payload = _payload,
> > };
> > struct bitmap_index *bitmap = prepare_bitmap_git(the_repository);
> > + struct odb_source *source;
> >
> > - for_each_loose_object(the_repository->objects, batch_one_object_loose, &payload, 0);
> > + odb_prepare_alternates(the_repository->objects);
> > + for (source = the_repository->objects->sources; source; source = source->next) {
> > + int ret = odb_source_loose_for_each_object(source, NULL, batch_one_object_oi,
> > + &payload, flags);
> > + if (ret)
> > + break;
> > + }
>
> OK, I'm guessing that this is one such case where we can't yet use
> odb_for_each_object() function directly because of the refactoring which
> you alluded to in the commit message. That seems reasonable, though I
> wonder if it's worth adding a /* TODO */ comment here to that effect.
Sure, I can add a comment.
> Just out of curiosity, what does that refactoring entail? I'm curious
> because I wonder whether the caller is just written in such a way that
> it makes it hard to immediately plug into the new API, or whether there
> are more fundamental issues at play that make the refactoring less than
> straightforward. If the latter, those could potentially help inform the
> direction here.
>
> (To be clear, I figure that this is likely work that you have already
> done, I'm just curious to see if the details would yield any benefit to
> the immediate patch series under discussion.)
What this code here intends to do is to filter objects via an object
filter (e.g. "--filter=blobs:none"). The way I intend do introduce this
functinoality in a subsequent series is to introduce a `struct
odb_for_each_object_options` that contains optional parameters:
- An object ID prefix that can be used to iterate over all objects
that have a certain matching prefix. This will be used for example
in "object-name.c".
- An object filter that can be used to filter objects like we do here.
- Potentially more things that I haven't discovered yet?
Once we have that, the filtering can then happen on the source level.
For the packfile store it would mean that we can try to filter via the
bitmap, if available, and that would allow us to move the logic that we
have here into the backend.
Patrick
next prev parent reply other threads:[~2026-01-23 9:43 UTC|newest]
Thread overview: 120+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 11:04 [PATCH 00/14] odb: introduce `odb_for_each_object()` Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 01/14] odb: rename `FOR_EACH_OBJECT_*` flags Patrick Steinhardt
2026-01-15 18:00 ` Justin Tobler
2026-01-15 11:04 ` [PATCH 02/14] odb: fix flags parameter to be unsigned Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 03/14] object-file: extract function to read object info from path Patrick Steinhardt
2026-01-15 18:31 ` Justin Tobler
2026-01-16 7:03 ` Patrick Steinhardt
2026-01-20 9:09 ` Karthik Nayak
2026-01-15 11:04 ` [PATCH 04/14] object-file: introduce function to iterate through objects Patrick Steinhardt
2026-01-15 20:54 ` Justin Tobler
2026-01-16 7:03 ` Patrick Steinhardt
2026-01-20 9:16 ` Karthik Nayak
2026-01-15 11:04 ` [PATCH 05/14] packfile: extract function to iterate through objects of a store Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 06/14] packfile: introduce function to iterate through objects Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 07/14] odb: introduce `odb_for_each_object()` Patrick Steinhardt
2026-01-15 21:17 ` Justin Tobler
2026-01-16 7:03 ` Patrick Steinhardt
2026-01-16 17:46 ` Justin Tobler
2026-01-19 7:10 ` Patrick Steinhardt
2026-01-20 9:20 ` Karthik Nayak
2026-01-21 7:39 ` Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 08/14] builtin/fsck: refactor to use `odb_for_each_object()` Patrick Steinhardt
2026-01-15 21:24 ` Justin Tobler
2026-01-15 11:04 ` [PATCH 09/14] treewide: enumerate promisor objects via `odb_for_each_object()` Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 10/14] treewide: drop uses of `for_each_{loose,packed}_object()` Patrick Steinhardt
2026-01-15 21:44 ` Justin Tobler
2026-01-16 7:03 ` Patrick Steinhardt
2026-01-16 17:47 ` Justin Tobler
2026-01-19 7:10 ` Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 11/14] odb: introduce mtime fields for object info requests Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 12/14] builtin/pack-objects: use `packfile_store_for_each_object()` Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 13/14] reachable: convert to use `odb_for_each_object()` Patrick Steinhardt
2026-01-15 11:04 ` [PATCH 14/14] odb: drop unused `for_each_{loose,packed}_object()` functions Patrick Steinhardt
2026-01-15 13:50 ` [PATCH 00/14] odb: introduce `odb_for_each_object()` Junio C Hamano
2026-01-16 7:03 ` Patrick Steinhardt
2026-01-16 16:49 ` Junio C Hamano
2026-01-20 15:25 ` [PATCH v2 " Patrick Steinhardt
2026-01-20 15:25 ` [PATCH v2 01/14] odb: rename `FOR_EACH_OBJECT_*` flags Patrick Steinhardt
2026-01-20 15:25 ` [PATCH v2 02/14] odb: fix flags parameter to be unsigned Patrick Steinhardt
2026-01-20 15:25 ` [PATCH v2 03/14] object-file: extract function to read object info from path Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 04/14] object-file: introduce function to iterate through objects Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 05/14] packfile: extract function to iterate through objects of a store Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 06/14] packfile: introduce function to iterate through objects Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 07/14] odb: introduce `odb_for_each_object()` Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 08/14] builtin/fsck: refactor to use `odb_for_each_object()` Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 09/14] treewide: enumerate promisor objects via `odb_for_each_object()` Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 10/14] treewide: drop uses of `for_each_{loose,packed}_object()` Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 11/14] odb: introduce mtime fields for object info requests Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 12/14] builtin/pack-objects: use `packfile_store_for_each_object()` Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 13/14] reachable: convert to use `odb_for_each_object()` Patrick Steinhardt
2026-01-20 15:26 ` [PATCH v2 14/14] odb: drop unused `for_each_{loose,packed}_object()` functions Patrick Steinhardt
2026-01-21 12:50 ` [PATCH v3 00/14] odb: introduce `odb_for_each_object()` Patrick Steinhardt
2026-01-21 12:50 ` [PATCH v3 01/14] odb: rename `FOR_EACH_OBJECT_*` flags Patrick Steinhardt
2026-01-21 12:50 ` [PATCH v3 02/14] odb: fix flags parameter to be unsigned Patrick Steinhardt
2026-01-21 21:11 ` Jeff King
2026-01-22 0:00 ` Taylor Blau
2026-01-22 15:41 ` Junio C Hamano
2026-01-22 19:23 ` Jeff King
2026-01-23 10:57 ` Patrick Steinhardt
2026-01-26 22:32 ` Junio C Hamano
2026-01-22 6:50 ` Patrick Steinhardt
2026-01-22 23:44 ` Taylor Blau
2026-01-21 12:50 ` [PATCH v3 03/14] object-file: extract function to read object info from path Patrick Steinhardt
2026-01-22 0:04 ` Taylor Blau
2026-01-22 6:51 ` Patrick Steinhardt
2026-01-22 23:47 ` Taylor Blau
2026-01-21 12:50 ` [PATCH v3 04/14] object-file: introduce function to iterate through objects Patrick Steinhardt
2026-01-22 0:15 ` Taylor Blau
2026-01-22 6:52 ` Patrick Steinhardt
2026-01-23 0:01 ` Taylor Blau
2026-01-21 12:50 ` [PATCH v3 05/14] packfile: extract function to iterate through objects of a store Patrick Steinhardt
2026-01-22 1:37 ` Taylor Blau
2026-01-21 12:50 ` [PATCH v3 06/14] packfile: introduce function to iterate through objects Patrick Steinhardt
2026-01-23 0:06 ` Taylor Blau
2026-01-23 9:42 ` Patrick Steinhardt
2026-01-23 9:52 ` Chris Torek
2026-01-23 16:22 ` Junio C Hamano
2026-01-23 17:45 ` Taylor Blau
2026-01-21 12:50 ` [PATCH v3 07/14] odb: introduce `odb_for_each_object()` Patrick Steinhardt
2026-01-23 0:13 ` Taylor Blau
2026-01-21 12:50 ` [PATCH v3 08/14] builtin/fsck: refactor to use `odb_for_each_object()` Patrick Steinhardt
2026-01-23 0:32 ` Taylor Blau
2026-01-23 9:42 ` Patrick Steinhardt
2026-01-21 12:50 ` [PATCH v3 09/14] treewide: enumerate promisor objects via `odb_for_each_object()` Patrick Steinhardt
2026-01-23 0:33 ` Taylor Blau
2026-01-21 12:50 ` [PATCH v3 10/14] treewide: drop uses of `for_each_{loose,packed}_object()` Patrick Steinhardt
2026-01-23 0:46 ` Taylor Blau
2026-01-23 9:43 ` Patrick Steinhardt [this message]
2026-01-21 12:50 ` [PATCH v3 11/14] odb: introduce mtime fields for object info requests Patrick Steinhardt
2026-01-23 1:06 ` Taylor Blau
2026-01-23 9:43 ` Patrick Steinhardt
2026-01-23 17:48 ` Taylor Blau
2026-01-26 8:53 ` Patrick Steinhardt
2026-01-21 12:50 ` [PATCH v3 12/14] builtin/pack-objects: use `packfile_store_for_each_object()` Patrick Steinhardt
2026-01-23 1:21 ` Taylor Blau
2026-01-23 9:43 ` Patrick Steinhardt
2026-01-23 18:35 ` Taylor Blau
2026-01-26 8:53 ` Patrick Steinhardt
2026-01-29 11:08 ` Jeff King
2026-01-30 12:57 ` Patrick Steinhardt
2026-01-21 12:50 ` [PATCH v3 13/14] reachable: convert to use `odb_for_each_object()` Patrick Steinhardt
2026-01-21 12:50 ` [PATCH v3 14/14] odb: drop unused `for_each_{loose,packed}_object()` functions Patrick Steinhardt
2026-01-22 1:33 ` [PATCH v3 00/14] odb: introduce `odb_for_each_object()` Taylor Blau
2026-01-22 17:02 ` Junio C Hamano
2026-01-26 9:51 ` [PATCH v4 " Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 01/14] odb: rename `FOR_EACH_OBJECT_*` flags Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 02/14] odb: fix flags parameter to be unsigned Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 03/14] object-file: extract function to read object info from path Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 04/14] object-file: introduce function to iterate through objects Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 05/14] packfile: extract function to iterate through objects of a store Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 06/14] packfile: introduce function to iterate through objects Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 07/14] odb: introduce `odb_for_each_object()` Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 08/14] builtin/fsck: refactor to use `odb_for_each_object()` Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 09/14] treewide: enumerate promisor objects via `odb_for_each_object()` Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 10/14] treewide: drop uses of `for_each_{loose,packed}_object()` Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 11/14] odb: introduce mtime fields for object info requests Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 12/14] builtin/pack-objects: use `packfile_store_for_each_object()` Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 13/14] reachable: convert to use `odb_for_each_object()` Patrick Steinhardt
2026-01-26 9:51 ` [PATCH v4 14/14] odb: drop unused `for_each_{loose,packed}_object()` functions Patrick Steinhardt
2026-02-20 22:59 ` [PATCH v4 00/14] odb: introduce `odb_for_each_object()` Junio C Hamano
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=aXNCpJ6q3HwcwhPG@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jltobler@gmail.com \
--cc=karthik.188@gmail.com \
--cc=me@ttaylorr.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