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

Re: [PATCH 3/4] submodule update: Initialize all group-selected submodules by default

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 20, 2016, 21:30 UTC
Message-ID
<xmqqr3hc3pmz.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1453260880-628-4-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 19 quoted lines
> All submodules which are selected via submodule groups
> ("submodule.groups") are initialized if they were not initialized
> before updating the submodules.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  builtin/submodule--helper.c | 30 +++++++++++++++++++++++++++++-
>  t/t7400-submodule-basic.sh  | 26 ++++++++++++++++++++++++++
>  2 files changed, 55 insertions(+), 1 deletion(-)
>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index 4684f16..def382e 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -577,6 +577,7 @@ static int module_clone(int argc, const char **argv, const char *prefix)
>  
>  struct submodule_update_clone {
>  	/* states */
> +	struct string_list *submodule_groups;

Again, do we need a field named submodule_groups in a struct whose name already makes it clear this is about submodule?

More importantly.

If this were used to implement "there are various groups defined, and the user tells us that submodules in this and that groups are to be automatically initialized", then naming the field with a name that is more specific than just "groups" makes tons of sense, but even in such a case, the best adjective to clarify what kind of "group" this field is about is not "this is a submodule group".

The answer I would give to a question "what kind of group this field is about?" would be "this is an auto-init group", so I'd have that 'auto-init' ness somewhere in its name.

Show 5 quoted lines
> @@ -633,6 +634,7 @@ static int update_clone_get_next_task(struct child_process *cp,
>  		const char *update_module = NULL;
>  		char *url = NULL;
>  		int needs_cloning = 0;
> +		int in_submodule_groups = 0;

Likewise. The significance of the membership in this group is totally unclear from this variable name. I read this boolean to be keeping track of "is this submodule to be auto initialized"?

Previous: Stefan BellerNext: Stefan Beller
Message 13 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.