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

Re: [PATCH 0/4] Submodule Groups

From
Stefan Beller <sbeller@google.com>
Date
Jan 21, 2016, 22:30 UTC
Message-ID
<CAGZ79kYVE7a=kXi__+Y3C7cuQUhY78o0unuw7vU4hrO71q1dwA@mail.gmail.com>
In-Reply-To
<xmqq37tqy3t4.fsf@gitster.mtv.corp.google.com>
On Thu, Jan 21, 2016 at 2:18 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 21 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>> Instead of having a submodule -> set assignment, we could do it the
>> other way round:
>>
>>      [submodule "gcc"]
>>          ...
>>
>>      [submodule-set "default"]
>>         submodule = gcc
>>         submodule = foo
>>         submodule = by/path/*
>>
>> This may be more handy from our perspective (while designing it and
>> writing the code),
>> but I'd assume this is less useful for the user. How often does a user ask:
>> "How many/Which submodules are in $GROUP" as opposed to "What about
>> submodule foo,
>> is that part of group $GROUP?"
>
> I suspect that we will end up needing to support both styles.

I think having both is bad as it may contradict each other? What is supposed to happen here:

     [submodule "frotz"]
         group = default
     [submoduleGroup "default"]
         member = !:frotz

Initially I disliked your proposal of : and * to indicate name and groups, but the example you gave is very clear and understandable on the syntax level.

Show 22 quoted lines
>  The
> latter style is easier when you want to express a larger set as a
> collection of groups, e.g.
>
>     [submodule "gcc"]
>         group = development-tools
>
>     [submodule "emacs"]
>         group = editors
>
>     [submodule "frotz"]
>         group = games
>
>     [submoduleGroup "default"]
>         member = *development-tools
>         member = *editors
>         member = :frotz
>         member = !*xyzzy
>
> might be a way to say "the default group includes everything in the
> 'development-tools' or 'editors' group, plus 'frotz' module, but do
> not include modules in the xyzzy group" or something like that.
> I forgot to say that I personally do not think we need to support
> such synthetic groups from day one.

So groups of groups, we discovered recursion today. :) Having this discussion makes me realize, the groups handling logic will be more complex than I anticipated for the first RFC patch series.

The two basic questions the logic has to answer is:
 * Give me all the submodules that fit these specifiers (i.e. the
    --init-submodules collection from clone)
 * Given submodule X, does it fit the specifier ( a new uninitialized
    submodule during a later update)

The second question can be answered by answering the first question and then checking if X is in the set. However that may be not the most efficient solution.

Previous: Junio C HamanoNext: Junio C Hamano
Message 25 of 27 in “Submodule Groups”
  1. 0/4 Submodule GroupsStefan Beller, Jan 20, 2016
  2. 1/4 git submodule: Teach add to accept --groupStefan Beller, Jan 20, 2016
  3. Junio C HamanoJan 20, 2016
  4. Stefan BellerJan 20, 2016
  5. Junio C HamanoJan 21, 2016
  6. Stefan BellerJan 21, 2016
  7. Junio C HamanoJan 21, 2016
  8. 2/4 submodule-config: keep groups aroundStefan Beller, Jan 20, 2016
  9. Junio C HamanoJan 20, 2016
  10. Stefan BellerJan 21, 2016
  11. Junio C HamanoJan 21, 2016
  12. 3/4 submodule update: Initialize all group-selected submodules by defaultStefan Beller, Jan 20, 2016
  13. Junio C HamanoJan 20, 2016
  14. Stefan BellerJan 21, 2016
  15. Junio C HamanoJan 21, 2016
  16. Stefan BellerJan 21, 2016
  17. Junio C HamanoJan 21, 2016
  18. Junio C HamanoJan 21, 2016
  19. 4/4 builtin/clone: support submodule groupsStefan Beller, Jan 20, 2016
  20. Junio C HamanoJan 20, 2016
  21. Sebastian SchuberthJan 21, 2016
  22. Stefan BellerJan 21, 2016
  23. Junio C HamanoJan 21, 2016
  24. Junio C HamanoJan 21, 2016
  25. Stefan BellerJan 21, 2016
  26. Junio C HamanoJan 21, 2016
  27. Sebastian SchuberthJan 22, 2016

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.