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

Re: [PATCH v5] clone: set submodule.recurse=true if user enables feature.experimental flag

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 13, 2021, 14:59 UTC
Message-ID
<xmqqr1exxuew.fsf@gitster.g>
In-Reply-To
<c74a9d75-cd89-d020-dcb3-76509bc95284@gmail.com>
Philippe Blain <levraiphilippeblain@gmail.com> writes:
> Here I think you are confusing submodule.active (which takes a pathspec)
> and submodule.recurse (which takes a boolean).
Sigh, but I have to agree with you.

I really hoped that in a recursive clone of a repository with two submodules A and B, when made with --recurse-submodules=A, "git grep ." would look for things in the superproject and submodule A as Emily seemed to have meant by her "the right thing", but you are correct. We only set .active but we do not set .recurse, so "git grep ." in the superproject does not descend into neither submodules without being told.

If it did "the right thing" as Emily said, it would have been much easier to justify the change being proposed as a simple fix for the bug that --recurse-submodules without pathspec does one thing (i.e. setting things up not to recurse for later "grep" etc.") and the same option with "everything matches" pathspec "." does a different thing (i.e. always to recurse).

The discrepancy would have given us an excuse, an argument for changing the behaviour for the former to match the latter. Some users may have deliberately built their workflow relying on the distinction and the result still may give them a regression, but at least it would have gave us a viable justification:

    A command run without pathspec means the entire tree and it is
    the same as running it with pathspec '.' in the rest of Git, but
    the way "git clone --recurse-submodules" handles its optional
    pathspec is inconsistent.  Treat "clone --recurse-submodules"
    without pathspec as if it came with pathspec '.' and give the
    same configuration.
But unfortunately it does not seem to be the case.
Previous: Junio C HamanoNext: Junio C Hamano
Message 30 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.