git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/7] Submodules and partial clones

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Sep 29, 2020, 18:05 UTC
Message-ID
<20200929180508.118066-1-jonathantanmy@google.com>
In-Reply-To
<20200929155350.49066-1-andrew@adoakley.name>
Show 7 quoted lines
> I've been investigating what is required to get submodules and partial
> clones to work well together.  The issue seems to be that the correct
> repository is not passed around, so we sometimes end up trying to fetch
> objects from the wrong place.
> 
> These patches don't make promisor_remote_get_direct handle different
> repositories because I've not found a case where that is necessary.

Anything that reads a submodule object without spawning another process to do so (e.g. grep, which adds submodule object stores as alternates in order to read from them) will need to be prepared to lazy-fetch objects into those stores.

Show 7 quoted lines
> The patches rework various cases where objects from a submodule are
> added to the object store of the main repository.  There are some
> remaining cases where add_to_alternates_memory is used to do this, but
> add_submodule_odb has been removed.
> 
> I expect there will be some remaining issues, but these changes seem to
> be enough to get the basics working.
What are the basics that work?

When I looked into this, my main difficulty lay in getting the lazy fetch to work in another repository. Now that lazy fetches are done using a separate process, the problem has shifted to being able to invoke run_command() in a separate Git repository. I haven't figured out the best way to ensure that run_command() is run with a clean set of environment variables (so no inheriting of GIT_DIR etc.), but that doesn't seem insurmountable.

Previous: Andrew OakleyNext: Andrew Oakley
Message 9 of 11 in “Submodules and partial clones”
  1. 0/7 Submodules and partial clonesAndrew Oakley, Sep 29, 2020
  2. 6/7 submodule: remove add_submodule_odbAndrew Oakley, Sep 29, 2020
  3. 2/7 submodule: use separate submodule repositoriesAndrew Oakley, Sep 29, 2020
  4. 3/7 Add failing test for partial clones with submodulesAndrew Oakley, Sep 29, 2020
  5. 4/7 refs: use correct repo in refs_peel_refAndrew Oakley, Sep 29, 2020
  6. 1/7 refs: store owning repository for object lookupAndrew Oakley, Sep 29, 2020
  7. 7/7 submodule: use partial clone filterAndrew Oakley, Sep 29, 2020
  8. 5/7 merge-recursive: use separate submodule repositoryAndrew Oakley, Sep 29, 2020
  9. Jonathan TanSep 29, 2020
  10. Andrew OakleySep 30, 2020
  11. Jonathan TanSep 30, 2020

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.