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

Re: [PATCH v2 0/3] Teach fetch and pull to recursively fetch submodules too

From
Jens Lehmann <jens.lehmann@web.de>
Date
Oct 13, 2010, 19:32 UTC
Message-ID
<4CB6093F.3040800@web.de>
In-Reply-To
<4CB5C6D8.1070108@xiplink.com>
Am 13.10.2010 16:48, schrieb Marc Branchaud:
Show 17 quoted lines
> On 10-10-09 03:17 PM, Jens Lehmann wrote:
>> Am 07.10.2010 00:52, schrieb Kevin Ballard:
>>> On Oct 5, 2010, at 2:06 PM, Junio C Hamano wrote:
>>>> I dunno.  I've never been a fan of automatically recursing into submodules
>>>> (iow, treating the nested structure as if there is no nesting), so...
>>>
>>> I agree with this as well.
>>
>> There are use cases like mine where automatic recursion is just the right
>> thing to do. But I would be fine with having to turn the recursion on
>> explicitly in the configuration if most people think recursion is not a
>> desirable default. It would be really nice to hear from other submodule
>> users what they think about that ...
> 
> I tend to think that the right default for fetch is to employ the same level
> of recursion that was used for the initial clone.  So if the clone was made
> with --recursive then fetch should default to using --recursive.
That's a very interesting idea.
Show 6 quoted lines
> But I'd like to see finer-grained control than that.  For us the set of
> submodules to clone depends on what we're trying to build.  Ideally we'd have
> a lot of different submodules, and some would be required no matter what the
> build target.  It'd be great if clone could be smart enough to recursively
> clone those required submodules (i.e. the upstream repo specifies a set of
> default submodules -- I believe this is already on Jens's TODO list).

Yup, right now I have new entries in .gitmodules in mind which will tell clone to clone certain submodules too. I'm just not so sure if those should be the same I intend to use for recursive checkout ...

>  Then
> building a particular target could trigger the cloning of ancillary
> submodules specific to that target.

And the build could do that using my proposal by adding entries to the submodule configs in .git/config, which override those from .gitmodules.

Show 5 quoted lines
> In that scenario, the default for later fetches could be to either (a)
> retrieve upstream's default set of submodules, or (b) retrieve all populated
> submodules.  Either way, a config option is needed to override the default
> behaviour, with a third configurable-but-never-default setting to recursively
> fetch all submodules, populated or not.

If I understand that correctly my proposal should handle all these cases. (a) could be done by configuring the entries in .gitmodules (even though there have been votes against that feature), (b) can be achieved by setting the repo-wide option. But I fear that its impossible to fetch non-populated submodules, as they lack a .git directory to fetch into.

Thanks for your feedback!
Previous: Marc BranchaudNext: Kevin Ballard
Message 45 of 55 in “Teach fetch and pull to recursively fetch submodules too”
  1. 0/2 Teach fetch and pull to recursively fetch submodules tooJens Lehmann, Aug 29, 2010
  2. 1/2 fetch/pull: Recursively fetch populated submodulesJens Lehmann, Aug 29, 2010
  3. 2/2 Submodules: Add the new "fetch" config optionJens Lehmann, Aug 29, 2010
  4. Junio C HamanoAug 30, 2010
  5. 2/2 Submodules: Add the new "fetch" config option for fetch and pullJens Lehmann, Aug 30, 2010
  6. Ævar Arnfjörð BjarmasonAug 29, 2010
  7. Jens LehmannAug 29, 2010
  8. Junio C HamanoAug 30, 2010
  9. Jens LehmannAug 30, 2010
  10. Kevin BallardSep 15, 2010
  11. Kevin BallardSep 15, 2010
  12. fetch: Get submodule paths from index and not from .gitmodulesJens Lehmann, Sep 16, 2010
  13. Kevin BallardSep 16, 2010
  14. Jens LehmannSep 17, 2010
  15. Johannes SixtSep 17, 2010
  16. Jens LehmannSep 17, 2010
  17. Johannes SixtSep 17, 2010
  18. Jens LehmannSep 17, 2010
  19. Johannes SixtSep 17, 2010
  20. Kevin BallardSep 18, 2010
  21. 0/2 fix problems with recursive submodule fetchingJens Lehmann, Sep 18, 2010
  22. 1/2 fetch: Fix a bug swallowing the output of recursive submodule fetchingJens Lehmann, Sep 18, 2010
  23. 2/2 fetch: Get submodule paths from index and not from .gitmodulesJens Lehmann, Sep 18, 2010
  24. Kevin BallardSep 19, 2010
  25. Jens LehmannSep 19, 2010
  26. Kevin BallardSep 20, 2010
  27. 0/3 Teach fetch and pull to recursively fetch submodules tooJens Lehmann, Oct 5, 2010
  28. 1/3 fetch/pull: Recursively fetch populated submodulesJens Lehmann, Oct 5, 2010
  29. 2/3 Submodules: Add the new "fetch" config option for fetch and pullJens Lehmann, Oct 5, 2010
  30. Jon SeymourOct 7, 2010
  31. Jens LehmannOct 9, 2010
  32. Jonathan NiederOct 9, 2010
  33. Jens LehmannOct 9, 2010
  34. 3/3 Add the 'fetch.recursive' config settingJens Lehmann, Oct 5, 2010
  35. Junio C HamanoOct 5, 2010
  36. Kevin BallardOct 6, 2010
  37. Jonathan NiederOct 6, 2010
  38. Jens LehmannOct 9, 2010
  39. Jonathan NiederOct 9, 2010
  40. Jens LehmannOct 9, 2010
  41. Jonathan NiederOct 21, 2010
  42. Jens LehmannOct 21, 2010
  43. Jens LehmannOct 9, 2010
  44. Marc BranchaudOct 13, 2010
  45. Jens LehmannOct 13, 2010
  46. Kevin BallardOct 13, 2010
  47. Jens LehmannOct 13, 2010
  48. Kevin BallardOct 13, 2010
  49. Chris PackhamOct 14, 2010
  50. Jens LehmannOct 14, 2010
  51. Chris PackhamOct 14, 2010
  52. Marc BranchaudOct 13, 2010
  53. Kevin BallardOct 13, 2010
  54. Jens LehmannSep 15, 2010
  55. Kevin BallardSep 15, 2010

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.