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

Re: [PATCH v3 1/4] clone: update submodule.recurse in config when using --recurse-submodule

From
Philippe Blain <levraiphilippeblain@gmail.com>
Date
Aug 3, 2021, 03:20 UTC
Message-ID
<e1bec4f1-d68f-2342-f759-8d0dc0de5eb4@gmail.com>
In-Reply-To
<fea3d6d72b63c06138d8eeb61e45edb30abbd79d.1627946590.git.gitgitgadget@gmail.com>
Le 2021-08-02 à 19:23, Mahi Kolla via GitGitGadget a écrit :
> From: Mahi Kolla <mahikolla@google.com>
> 
> When running 'git clone --recurse-submodules', developers expect various other commands such as 'pull' and 'checkout' to also run recursively into submodules.

missing space after period here. Also, maybe I would say "some developers" or "developers might expect", or something like that.

The submitted code updates the 'submodule.recurse' config value to true when 'git clone' is run with the '--recurse-submodules' option.

We usually use the imperative form for commit messages, like if giving an order to the code base to improve itself. So you might word this simply as:

Set 'submodule.recurse' to true when 'git clone' is run with '--recurse-submodules'.
Show 19 quoted lines
> 
> Signed-off-by: Mahi Kolla <mahikolla@google.com>
> ---
>   builtin/clone.c          | 1 +
>   t/t5606-clone-options.sh | 7 +++++++
>   2 files changed, 8 insertions(+)
> 
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 66fe66679c8..f41fd1afb66 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -1130,6 +1130,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
>   					   strbuf_detach(&sb, NULL));
>   		}
>   
> +                string_list_append(&option_config, "submodule.recurse=true");
>   		if (option_required_reference.nr &&
>   		    option_optional_reference.nr)
>   			die(_("clone --recursive is not compatible with "

I think that this change is a big enough behaviour change to warrant that an "advice" message be shown to the user, informing them that 'submodule.recurse' has been set to true, and maybe point users to 'gitsubmodules(7) to learn what this configuration entails.

Show 12 quoted lines
> diff --git a/t/t5606-clone-options.sh b/t/t5606-clone-options.sh
> index 3a595c0f82c..3daef8c941f 100755
> --- a/t/t5606-clone-options.sh
> +++ b/t/t5606-clone-options.sh
> @@ -16,6 +16,13 @@ test_expect_success 'setup' '
>   
>   '
>   
> +test_expect_success 'clone --recurse-submodules sets submodule.recurse=true' '
> +
> +        git clone --recurse-submodules parent clone-rec-submodule &&
> +        test_config_global submodule.recurse true

This should be 'test_cmp_config', which checks that a specific config variable has the expected value. 'test_config' is used to set a config for the duration of the test, which is not what you want to do here. I see you've changed it in a following patch, but not to the right thing. As I wrote in my response to your cover letter, this series should be as a single patch.

Thanks for working on this!
Philippe.
Previous: Mahi Kolla via GitGitGadgetNext: Mahi Kolla
Message 10 of 46 in “clone: update submodule.recurse in config when using --recurse-submodule”
  1. 0/2 clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 2, 2021
  2. 1/2 clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 2, 2021
  3. 2/2 clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 2, 2021
  4. 0/3 clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 2, 2021
  5. 1/3 clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 2, 2021
  6. 2/3 clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 2, 2021
  7. 3/3 clone test: update whitespace according to style guideMahi Kolla via GitGitGadget, Aug 2, 2021
  8. 0/4 clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 2, 2021
  9. 1/4 clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 2, 2021
  10. Philippe BlainAug 3, 2021
  11. Mahi KollaAug 7, 2021
  12. 2/4 clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 2, 2021
  13. 3/4 clone test: update whitespace according to style guideMahi Kolla via GitGitGadget, Aug 2, 2021
  14. 4/4 clone: update whitespace according to style guideMahi Kolla via GitGitGadget, Aug 2, 2021
  15. Philippe BlainAug 3, 2021
  16. Junio C HamanoAug 3, 2021
  17. clone: update submodule.recurse in config when using --recurse-submoduleMahi Kolla via GitGitGadget, Aug 9, 2021
  18. Junio C HamanoAug 9, 2021
  19. Mahi KollaAug 10, 2021
  20. Junio C HamanoAug 10, 2021
  21. Philippe BlainAug 10, 2021
  22. Mahi KollaAug 10, 2021
  23. Junio C HamanoAug 11, 2021
  24. clone: set submodule.recurse=true if user enables feature.experimental flagMahi Kolla via GitGitGadget, Aug 12, 2021
  25. Junio C HamanoAug 12, 2021
  26. Emily ShafferAug 12, 2021
  27. Philippe BlainAug 13, 2021
  28. Mahi KollaAug 13, 2021
  29. Junio C HamanoAug 13, 2021
  30. Junio C HamanoAug 13, 2021
  31. Junio C HamanoAug 13, 2021
  32. Emily ShafferAug 13, 2021
  33. Junio C HamanoAug 13, 2021
  34. Emily ShafferAug 13, 2021
  35. Mahi KollaAug 13, 2021
  36. Junio C HamanoAug 13, 2021
  37. Felipe ContrerasAug 13, 2021
  38. clone: set submodule.recurse=true if submodule.stickyRecursiveClone enabledMahi Kolla via GitGitGadget, Aug 14, 2021
  39. Junio C HamanoAug 14, 2021
  40. Emily ShafferAug 17, 2021
  41. Junio C HamanoAug 18, 2021
  42. fixup! clone: set submodule.recurse=true if submodule.stickyRecursiveClone enabledJunio C Hamano, Aug 18, 2021
  43. Emily ShafferAug 19, 2021
  44. Emily ShafferAug 30, 2021
  45. Junio C HamanoAug 30, 2021
  46. Philippe BlainAug 18, 2021

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.