From: Patrick Steinhardt <ps@pks.im>
To: Justin Tobler <jltobler@gmail.com>
Cc: git@vger.kernel.org,
Johannes Schindelin <Johannes.Schindelin@gmx.de>,
Wolfgang Kritzinger <wkritzinger@atlassian.com>
Subject: Re: [PATCH 5/5] odb/source: drop `local` flag
Date: Thu, 15 Oct 2026 07:29:42 +0200 [thread overview]
Message-ID: <atBkxlGbTfm1g_e8@pks.im> (raw)
In-Reply-To: <as-iH9JtWaKacK4T@denethor>
On Wed, Oct 14, 2026 at 10:43:23AM -0500, Justin Tobler wrote:
> On 26/10/14 08:56AM, Patrick Steinhardt wrote:
> > On Tue, Oct 13, 2026 at 05:44:11PM -0500, Justin Tobler wrote:
> > > On 26/10/13 09:36AM, Patrick Steinhardt wrote:
> > > > The `local` flag indicates whether a given `struct odb_source` is a
> > > > local source or not, where "local" is defined as being the object
> > > > directory that is directly attached to the current repository. But now
> > > > that alternates are handled in the "files" backend, this property is not
> > > > something that even makes sense anymore to have on the generic source.
> > > >
> > > > In fact, we already have a partial replacement for this field in `struct
> > > > odb_files_dir`. The only other site that requires it is the packed
> > > > object database source, because it propagates the bit into the packfiles
> > > > it is opening.
> > > >
> > > > Drop the flag from `struct odb_source` and instead move it into the
> > > > packed source.
> > > >
> > > > Note that we stop considering the `local` bit when iterating through all
> > > > loose objects with the `ODB_FOR_EACH_OBJECT_LOCAL_ONLY` flag. This is
> > > > fine though, as we already handle the flag in the "files" backend
> > > > itself, where we skip over any object directory that is not marked as
> > > > local.
> > >
> > > I do wish we could also drop ODB_FOR_EACH_OBJECT_LOCAL_ONLY. This flag
> > > also feels rather leaky to me. I guess though we still need a way to
> > > ignore objects from certain sources when iterating over all sources such
> > > as the inmemory source.
> > >
> > > Overall, I happy to see the `local` field dropped from the generic ODB
> > > source structure, but IMO is does make each `for_each_object` callback
> > > handling of the ODB_FOR_EACH_OBJECT_LOCAL_ONLY flag a bit ambiguous and
> > > awkward.
> > >
> > > Naive question: Do all odb_for_each_object() call sites that use the
> > > ODB_FOR_EACH_OBJECT_LOCAL_ONLY flag have "files" backend specific
> > > reasons to do so?
> >
> > It does make it awkward, I agree. There's only two callers that use the
> > flag right now:
> >
> > - git-pack-objects(1) with its "--local" flag. I consider this command
> > to be too specific to the "files" backend anyway though, so arguably
> > we could just let it handle this directly.
> >
> > - "reachable.c" via `add_unseen_recent_objects_to_traversal()`. This
> > is invoke by git-prune(1) to mark reachable objects that are recent,
> > and it's dubious that we only enumerate local objects here.
> >
> > So we might be able to get rid of that flag altogether. But I'm inclined
> > to go one step at a time and leave this for a future patch series.
>
> That's fair. I don't think we need to get rid of this flag as part of
> this series, but it seem like it would be something nice to eventually
> remove.
>
> Do we want to leave a TODO comment to mention this?
I think I'd rather keep it in the hive mind. It's a bit more intricate
to get rid of this, and TODO items often invit rather mindless
approaches to fixes.
Patrick
next prev parent reply other threads:[~2026-10-15 5:29 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 7:36 [PATCH 0/5] odb/files: cleanups and improvements for alternates Patrick Steinhardt
2026-10-13 7:36 ` [PATCH 1/5] odb/source-files: fix performance when reading objects with alternates Patrick Steinhardt
2026-10-13 20:46 ` Justin Tobler
2026-10-13 7:36 ` [PATCH 2/5] odb/source-files: fix performance when streaming " Patrick Steinhardt
2026-10-13 20:51 ` Justin Tobler
2026-10-13 7:36 ` [PATCH 3/5] odb/source-files: make the second read an implementation detail Patrick Steinhardt
2026-10-13 21:28 ` Justin Tobler
2026-10-14 6:55 ` Patrick Steinhardt
2026-10-14 15:37 ` Justin Tobler
2026-10-13 7:36 ` [PATCH 4/5] odb: remove read loop for found objects Patrick Steinhardt
2026-10-13 21:48 ` Justin Tobler
2026-10-14 6:56 ` Patrick Steinhardt
2026-10-14 15:38 ` Justin Tobler
2026-10-13 7:36 ` [PATCH 5/5] odb/source: drop `local` flag Patrick Steinhardt
2026-10-13 22:44 ` Justin Tobler
2026-10-14 6:56 ` Patrick Steinhardt
2026-10-14 15:43 ` Justin Tobler
2026-10-15 5:29 ` Patrick Steinhardt [this message]
2026-10-14 8:53 ` [PATCH v2 0/6] odb/files: cleanups and improvements for alternates Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 1/6] odb/source-files: fix performance when reading objects with alternates Patrick Steinhardt
2026-10-14 13:35 ` Johannes Schindelin
2026-10-14 13:44 ` Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 2/6] odb/source-files: fix performance when streaming " Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 3/6] odb/source-files: make the second read an implementation detail Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 4/6] odb: remove read loop for found objects Patrick Steinhardt
2026-10-14 8:53 ` [PATCH v2 5/6] odb: don't try re-fetching corrupt objects Patrick Steinhardt
2026-10-14 15:59 ` Justin Tobler
2026-10-14 8:53 ` [PATCH v2 6/6] odb/source: drop `local` flag Patrick Steinhardt
2026-10-15 5:27 ` [PATCH v3 0/6] odb/files: cleanups and improvements for alternates Patrick Steinhardt
2026-10-15 5:27 ` [PATCH v3 1/6] odb/source-files: fix performance when reading objects with alternates Patrick Steinhardt
2026-10-15 5:27 ` [PATCH v3 2/6] odb/source-files: fix performance when streaming " Patrick Steinhardt
2026-10-15 5:27 ` [PATCH v3 3/6] odb/source-files: make the second read an implementation detail Patrick Steinhardt
2026-10-15 5:27 ` [PATCH v3 4/6] odb: remove read loop for found objects Patrick Steinhardt
2026-10-15 5:27 ` [PATCH v3 5/6] odb: don't try re-fetching corrupt objects Patrick Steinhardt
2026-10-15 5:28 ` [PATCH v3 6/6] odb/source: drop `local` flag Patrick Steinhardt
2026-10-15 17:27 ` [PATCH v3 0/6] odb/files: cleanups and improvements for alternates Justin Tobler
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=atBkxlGbTfm1g_e8@pks.im \
--to=ps@pks.im \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=jltobler@gmail.com \
--cc=wkritzinger@atlassian.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