git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 16:09 UTC

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

From
Justin Tobler <jltobler@gmail.com>
Date
Sep 8, 2026, 23:04 UTC
Message-ID
<aqCTAXB3AbGW8Dt8@denethor>
In-Reply-To
<ap5sqR6RBamJjEeP@pks.im>
On 26/09/07 09:50AM, Patrick Steinhardt wrote:
Show 22 quoted lines
> 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
Previous: Patrick SteinhardtNext: Justin Tobler
Message 21 of 23 in “odb: stop registering in-memory sources”
  1. 00/13 odb: stop registering in-memory sourcesPatrick Steinhardt, Sep 2, 2026
  2. 01/13 cache-tree: drop `the_repository` in `cache_tree_fully_valid()`Patrick Steinhardt, Sep 2, 2026
  3. 02/13 cache-tree: remove dependency on `the_repository`Patrick Steinhardt, Sep 2, 2026
  4. 03/13 submodule-config: remove uses of `the_repository`Patrick Steinhardt, Sep 2, 2026
  5. 04/13 submodule-config: stop using `the_hash_algo`Patrick Steinhardt, Sep 2, 2026
  6. 05/13 submodule-config: stop registering submodule sourcesPatrick Steinhardt, Sep 2, 2026
  7. 06/13 builtin/grep: stop registering submodule ODB as sourcePatrick Steinhardt, Sep 2, 2026
  8. 07/13 odb: remove infrastructure to register submodule sourcesPatrick Steinhardt, Sep 2, 2026
  9. 08/13 tmp-objdir: drop unused function to register alternatePatrick Steinhardt, Sep 2, 2026
  10. 09/13 odb/packed: fix memory leaks when freeing sourcePatrick Steinhardt, Sep 2, 2026
  11. 10/13 builtin/multi-pack-index: refuse unknown sources with "--object-dir="Patrick Steinhardt, Sep 2, 2026
  12. 11/13 t/helper: adapt read-midx to not link ad-hoc source anymorePatrick Steinhardt, Sep 2, 2026
  13. 12/13 t/helper: stop registering alternates in "ref-store" commandPatrick Steinhardt, Sep 2, 2026
  14. 13/13 odb: remove the ability to link sources ad-hocPatrick Steinhardt, Sep 2, 2026
  15. Karthik NayakSep 4, 2026
  16. Karthik NayakSep 4, 2026
  17. Karthik NayakSep 4, 2026
  18. Justin ToblerSep 6, 2026
  19. Patrick SteinhardtSep 7, 2026
  20. Patrick SteinhardtSep 7, 2026
  21. Justin ToblerSep 8, 2026
  22. Justin ToblerSep 8, 2026
  23. Patrick SteinhardtSep 9, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.