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

Re: Question related to submodule and different recurse config options

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Sep 18, 2022, 14:36 UTC
Message-ID
<36621ba8-ad8e-8758-3e17-ea7a83432b4c@gmail.com>
In-Reply-To
<CABxXVRS-9unw-8_N8w2bdj4E5Ch780tMetJyD+++ixdWsBv90A@mail.gmail.com>
Hi Pieter-Jan,
Le 2022-09-08 à 11:01, Pieter-Jan Busschaert a écrit :
Show 6 quoted lines
> Hello,
> 
> I'm trying to set my git config like this (fetch.recurseSubmodules =
> on-demand) and (submodule.recurse = true). The goal is to do fetch &
> submodule update if-and-only-if the pointed-to commit changes.
> 
That makes sense.
Show 15 quoted lines
> However, it seems with this config a git pull will act as if
> fetch.recurseSubmodules was set to true (instead of on-demand) and do
> a fetch on all of the submodules. For me this does not correspond to
> the documentation (which says the value of submodule.recurse will only
> be used if fetch.recurseSubmodules is NOT set). I would have thought
> that this recent commit:
> https://github.com/git/git/commit/ed54e1b31ad1a9a35ef6c23024d325a2c4d85221
> describes this scenario and fixed it, but I still have that behaviour
> (git 2.37.3). Maybe that patch only covered true/false settings for
> fetch.recurseSubmodules and doesn't properly handle the on-demand
> setting?
> 
> Is what I see the intended behaviour?
> Is it possible in any way to configure git to only fetch & update
> submodules if the pointed-to commit changes?

I'm not sure if that's the bug you are hitting, but I remember noticing that the actual order of the two configs in the config file mattered (whereas it should not). With this:

    fetch.recurseSubmodules = on-demand
    submodule.recurse = true

the "submodule.recurse = true" is read last and then the "on-demand" setting for fetch is effectively ignored.

With this order:
    submodule.recurse = true
    fetch.recurseSubmodules = on-demand
I think it would work correctly. But I might be misremembering (I did not try it).
Cheers,
Philippe.
Previous: Pieter-Jan BusschaertNext: Glen Choo
Message 2 of 3 in “Question related to submodule and different recurse config options”
  1. Pieter-Jan BusschaertSep 8, 2022
  2. Philippe BlainSep 18, 2022
  3. Glen ChooSep 19, 2022

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.