From: Justin Tobler Date: Tue, 08 Sep 2026 23:04:54 GMT Subject: Re: [PATCH v2 05/13] submodule-config: stop registering submodule sources Message-ID: In-Reply-To: On 26/09/07 09:50AM, Patrick Steinhardt wrote: > On Sun, Sep 06, 2026 at 01:38:15PM -0500, Justin Tobler wrote: > > On 26/09/02 03:34PM, Patrick Steinhardt wrote: > > > When reading the ".gitmodules" file from a blob in a repository other > > > than `the_repository`, we register the repository's object database as > > > an in-memory source of `the_repository`'s object database. This call has > > > its origins in d9b8b8f896 (submodule-config.c: use repo_get_oid for > > > reading .gitmodules, 2019-04-16): back then, `config_with_options()` was > > > not able to read a blob from an arbitrary repository, but would always > > > read it via `the_repository`. So even though the blob could be resolved > > > in the submodule repository via `repo_get_oid()`, the submodule's object > > > database had to be registered as an in-memory source of `the_repository` > > > so that the subsequent object read was able to find the blob at all. > > > > Ok, so IIUC the problem was that a gitmodule blob from a repository that > > is not "the_repository" would fail to be read by `config_with_options()` > > because it would only read objects from "the_repository". The workaround > > was to add the other repositories as another source to ensure the > > gitmodule blob could be read. I had to reread the commit message a > > couple of times to follow, but I think it makes sense now. > > Yes. Do you think I should rewrite the commit message to make it a bit > less dense? Otherwise I'll leave it as-is for now. It is a little dense. I think it is a bit confusing which "repository" we are talking about in the first paragraph. I think: ...we register _the_ repository's object database... is a bit ambiguous since "the repository" is actually a repository that is _not_ `the_repository`. At least for me, I was getting a bit tripped up. XD -Justin