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

Re: [PATCH 5/5] builtin/clone: support submodule groups

From
Stefan Beller <sbeller@google.com>
Date
Nov 25, 2015, 20:03 UTC
Message-ID
<CAGZ79kY8=HbKB-om+FynDPf0w4c=12PtJ_9CsUyBU21yyD4CXA@mail.gmail.com>
In-Reply-To
<565610FD.9070303@web.de>
On Wed, Nov 25, 2015 at 11:50 AM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
Show 14 quoted lines
>
>> My thinking is that groups are implying recursive, whereas recursive
>> implies
>> "all groups", so a git clone --group <half-the-submodules> --recursive
>> makes not much sense to me as it begs the question, what does --recursive
>> mean?
>
>
> Groups are only about what submodules to update and have nothing to
> do with recursion. It might make sense to imply recursion, but that's
> just because that should have been the default for submodules from day
> one. Recursion and groups are orthogonal, the first is about what to
> do inside the submodules (carry on or not?) and the latter is about
> what to do in the superproject (shall I update this submodule?).

I see. So we would not want to mutually exclude recurse and groups, but rather have groups implies --recurse, but you are allowed to give --no-recurse if you explicitely do not want to recurse into the subsubmodules.

Show 38 quoted lines
>
>> Probably recurse into all submodules which are implied by the group
>>
>> <half-the-submodules>.
>
>
> Yep. We also do not recurse into those submodules having set their
> update setting to "none", so we do not do that for submodules not
> in any chosen group either.
>
>> And then get all the nested submodules. But in case
>>
>> you use the grouping feature, you could just mark the nested submodules
>> with
>> groups, too?
>
>
> Not in the top superproject. In a submodule you can specify new groups
> for its sub-submodules, but these will in most cases be different from
> those of the superproject.
>
> Imagine I have this really cool Metaproject which contains the Android
> superproject as a submodule. Those two will define different groups,
> and when recursing into the android submodule I need to choose from the
> Android specific groups. So my Metaproject's .gitmodules could look like
> this:
>
> [submodule "android"]
>         path = android
>         url = git://...
>         groups = default,mobile
>         subgroups = devel
>
> "groups" tells git what superproject groups the android submodule
> belongs to, and "subgroups" tells git what android submodules are
> to be checked out when running recursively into it. If you do not
> configure "subgroups", the whole android submodule is updated when
> one of the groups "default" or "mobile" is chosen in the superproject.

I like the concept of subgroups as it allows to have some control over subsubmodules you may want to aggregate from a third party via the middleman submodule.

I'd prefer to delay that feature though by not giving a high priority. Also would you go with subsubgroups, too? When does the recursion end? In case we have more than the union of groups, but also prohibitive terms available, could subgroups clash with the submodules groups spec?

Previous: Jens LehmannNext: Jens Lehmann
Message 10 of 24 in “Submodule Groups”
  1. 0/5 Submodule GroupsStefan Beller, Nov 25, 2015
  2. 1/5 submodule-config: keep submodule groups aroundStefan Beller, Nov 25, 2015
  3. 2/5 git submodule add can add a submodule with groupsStefan Beller, Nov 25, 2015
  4. 3/5 git submodule init to pass on groupsStefan Beller, Nov 25, 2015
  5. 4/5 submodule--helper: module_list and update-clone have --groups optionStefan Beller, Nov 25, 2015
  6. 5/5 builtin/clone: support submodule groupsStefan Beller, Nov 25, 2015
  7. Jens LehmannNov 25, 2015
  8. Stefan BellerNov 25, 2015
  9. Jens LehmannNov 25, 2015
  10. Stefan BellerNov 25, 2015
  11. Jens LehmannNov 25, 2015
  12. Stefan BellerNov 25, 2015
  13. [PATCHv2] builtin/clone: support submodule groupsStefan Beller, Nov 26, 2015
  14. Stefan BellerNov 26, 2015
  15. Trevor SaundersNov 26, 2015
  16. Stefan BellerNov 30, 2015
  17. Michael J GruberDec 1, 2015
  18. Stefan BellerDec 1, 2015
  19. Jens LehmannNov 25, 2015
  20. Stefan BellerNov 25, 2015
  21. Jens LehmannNov 25, 2015
  22. Stefan BellerNov 30, 2015
  23. Jens LehmannDec 1, 2015
  24. Jens LehmannNov 25, 2015

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.