Thread (40 messages) flat view 40 messages, 4 authors, 1d ago

Re: [PATCH v2 05/13] submodule-config: stop registering submodule sources

From: Patrick Steinhardt <hidden>
Date: 2026-09-09 05:52:29

On Tue, Sep 08, 2026 at 06:04:54PM -0500, Justin Tobler wrote:
On 26/09/07 09:50AM, Patrick Steinhardt wrote:
quoted
On Sun, Sep 06, 2026 at 01:38:15PM -0500, Justin Tobler wrote:
quoted
On 26/09/02 03:34PM, Patrick Steinhardt wrote:
quoted
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
How about we say "we register _that_ repository's object database"
instead then? I've queued that change locally, but I'll refrain from
sending a new version only to swap out that one word.

Thanks!

Patrick
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help