public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Aaron Paterson via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Aaron Paterson <apaterson@pm.me>
Subject: Re: [PATCH 2/2] odb: use odb_source_files_try() in source-chain iterations
Date: Thu, 19 Mar 2026 11:05:54 +0100	[thread overview]
Message-ID: <abvKgsCe1V5g6c0s@pks.im> (raw)
In-Reply-To: <a8303b1427a41fd4b3ca107eabc49e8ac6d02410.1773674983.git.gitgitgadget@gmail.com>

On Mon, Mar 16, 2026 at 03:29:43PM +0000, Aaron Paterson via GitGitGadget wrote:
> From: Aaron Paterson <apaterson@pm.me>
> 
> Convert all source-chain iteration sites that access
> files-specific internals (pack store, loose cache, MIDX) to use
> odb_source_files_try() instead of odb_source_files_downcast().

I have to wonder what the motivation for this is. We don't have any
other sources (yet), and we're still in the process of bootstrapping
pluggable object databases. So it's expected that things won't fully
work yet that we'll die in lots of places if an alternate backend was in
use.

But the solution to this isn't to simply skip non-files backends, but
rather to adapt those sites so that they are properly abstracted.

> These loops iterate the full source chain, which may include
> alternates. When a non-files backend is added to the chain (as an
> alternate or additional source), these sites must skip it rather
> than abort. The _try() helper returns NULL for non-files sources,
> and each site checks for NULL before accessing files-specific
> members.

The big question here is whether skipping is actually the correct thing
to do, and in most cases I would claim it's probably not.

I'm a bit puzzled.

Patrick

      reply	other threads:[~2026-03-19 10:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 15:29 [PATCH 0/2] odb: add odb_source_files_try() for heterogeneous source iteration Aaron Paterson via GitGitGadget
2026-03-16 15:29 ` [PATCH 1/2] " Aaron Paterson via GitGitGadget
2026-03-16 15:29 ` [PATCH 2/2] odb: use odb_source_files_try() in source-chain iterations Aaron Paterson via GitGitGadget
2026-03-19 10:05   ` Patrick Steinhardt [this message]

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=abvKgsCe1V5g6c0s@pks.im \
    --to=ps@pks.im \
    --cc=apaterson@pm.me \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --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