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

Problem using 'submodule.recurse'

From
Maksim Odnoletkov <odnoletkov@mail.ru>
Date
May 23, 2019, 17:42 UTC
Message-ID
<20190523174214.7447-1-odnoletkov@mail.ru>

I have a problem using 'submodule.recurse' config option. I want to use it and at the same time fine-tune behavior for individual commands with more specific options. For example to keep 'on-demand' behavior for 'fetch' and 'pull'.

 * If I put 'fetch.recurseSubmodules = on-demand' *below*
   'submodule.recurse = true' in the config, it kinda works - fetch will
   use 'on-demand' behavior.
 * But with this setup 'fetch' within 'pull' will always recurse
   unconditionally. Looking at the code this happens because 'pull'
   reads 'submodule.recurse' and seeing it in non-default state forces
   this behavior on underlying 'fetch'.

As far as I understand there is no way currently to have 'on-demand' recursing for 'fetch' within the 'pull' when 'submodule.recurse' is on (outside of using command line args). Also with described setup 'fetch' behaves differently from 'pull' which is unexpected.

Looking at the code quickly I see two ways this can be resolved:
 * Add 'pull.recurseSubmodules' option so it can be used to explicitly
   override 'submodule.recurse' for 'pull'.
 * Don't force recursing behavior from 'pull' to underlying 'fetch' if
   it comes from config and not from command line args.
Message 1 of 1 in “Problem using 'submodule.recurse'”
  1. Maksim OdnoletkovMay 23, 2019

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.