{"thread":{"id":"51160","subject":"Problem using 'submodule.recurse'","startedAt":"2019-05-23T17:43:39Z","lastAt":"2019-05-23T17:43:39Z","messageCount":1,"participants":["Maksim Odnoletkov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"376109","messageId":"20190523174214.7447-1-odnoletkov@mail.ru","threadId":"51160","inReplyTo":null,"subject":"Problem using 'submodule.recurse'","fromName":"Maksim Odnoletkov","fromEmail":"odnoletkov@mail.ru","sentAt":"2019-05-23T17:42:14Z","receivedAt":"2019-05-23T17:43:39Z","isPatch":false,"sender":{"key":"odnoletkov@mail.ru","avatar":"https://gravatar.com/avatar/01d7e7ba42a8bdd4fb31365847af911cf3d01144e5782b0fabae72f2229f30d9?d=mp&s=160"},"body":"I have a problem using 'submodule.recurse' config option. I want to use\nit and at the same time fine-tune behavior for individual commands with\nmore specific options. For example to keep 'on-demand' behavior for\n'fetch' and 'pull'.\n\n * If I put 'fetch.recurseSubmodules = on-demand' *below*\n   'submodule.recurse = true' in the config, it kinda works - fetch will\n   use 'on-demand' behavior.\n * But with this setup 'fetch' within 'pull' will always recurse\n   unconditionally. Looking at the code this happens because 'pull'\n   reads 'submodule.recurse' and seeing it in non-default state forces\n   this behavior on underlying 'fetch'.\n\nAs far as I understand there is no way currently to have 'on-demand'\nrecursing for 'fetch' within the 'pull' when 'submodule.recurse' is on\n(outside of using command line args). Also with described setup 'fetch'\nbehaves differently from 'pull' which is unexpected.\n\nLooking at the code quickly I see two ways this can be resolved:\n\n * Add 'pull.recurseSubmodules' option so it can be used to explicitly\n   override 'submodule.recurse' for 'pull'.\n * Don't force recursing behavior from 'pull' to underlying 'fetch' if\n   it comes from config and not from command line args.\n"}]}