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

Re: Fetch on submodule update

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 2, 2018, 06:08 UTC
Message-ID
<20180802060842.GB10757@aiede.svl.corp.google.com>
In-Reply-To
<CAHd499B2VingKU-+7idv9FROYgCmOAzZ7YAQgWdwY1YUeTUVHA@mail.gmail.com>
Hi again,
Robert Dailey wrote:
Show 7 quoted lines
> Problem: I want to avoid recursively fetching submodules when I run a
> `fetch` command, and instead defer that operation to the next
> `submodule update`. Essentially I want `fetch.recurseSubmodules` to be
> `false`, and `get submodule update` to do exactly what it does with
> the `--remote` option, but still use the SHA1 of the submodule instead
> of updating to the tip of the specified branch in the git modules
> config.

I think I misread this the first time. I got distracted by your mention of the --remote option, but you mentioned you want to use the SHA-1 of the submodule listed, so that was silly of me.

I think you'll find that "git fetch --no-recurse-submodules" and "git submodule update" do exactly what you want. "git submodule update" does perform a fetch (unless you pass --no-fetch).

Let me know how it goes. :)

I'd still be interested in hearing more about the nature of the submodules involved --- maybe `submodule.fetchJobs` would help, or maybe this is a workflow where a tool that transparently fetches submodules on demand like https://gerrit.googlesource.com/gitfs/+/master/docs/design.md would be useful (I'm not recommending using slothfs for this today, since it's read-only, but it illustrates the idea).

Thanks, Jonathan

Previous: Jonathan NiederNext: Robert Dailey
Message 3 of 6 in “Fetch on submodule update”
  1. Robert DaileyAug 1, 2018
  2. Jonathan NiederAug 1, 2018
  3. Jonathan NiederAug 2, 2018
  4. Robert DaileyAug 6, 2018
  5. Jonathan NiederAug 6, 2018
  6. Robert DaileyAug 6, 2018

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.