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

Re: [PATCH v2] submodule--helper: fix initialization of warn_if_uninitialized

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 25, 2022, 18:25 UTC
Message-ID
<xmqq35i1vx3y.fsf@gitster.g>
In-Reply-To
<pull.1258.v2.git.git.1650890741430.gitgitgadget@gmail.com>
"Orgad Shaneh via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 22 quoted lines
> The member is set to true only when pathspec was given, and is
> used when a submodule that matched the pathspec is found
> uninitialized to give diagnostic message.  "submodule update"
> without pathspec is supposed to iterate over all submodules
> (i.e. without pathspec limitation) and update only the
> initialized submodules, and finding uninitialized submodules
> during the iteration is a totally expected and normal thing that
> should not be warned.
> ...
>  builtin/submodule--helper.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index 2c87ef9364f..1a8e5d06214 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -2026,7 +2026,6 @@ struct update_data {
>  	.references = STRING_LIST_INIT_DUP, \
>  	.single_branch = -1, \
>  	.max_jobs = 1, \
> -	.warn_if_uninitialized = 1, \
>  }

Is this a fix we can protect from future breakge by adding a test or tweaking an existing test? It is kind of surprising if we did not have any test that runs "git submodule update" in a superproject with initialized and uninitialized submodule(s) and make sure only the initialized ones are updated. It may be the matter of examining the warning output that is currently ignored in such a test, if there is one.

Thanks.
Previous: Orgad Shaneh via GitGitGadgetNext: Junio C Hamano
Message 5 of 11 in “submodule--helper: fix initialization of warn_if_uninitialized”
  1. submodule--helper: fix initialization of warn_if_uninitializedOrgad Shaneh via GitGitGadget, Apr 24, 2022
  2. Junio C HamanoApr 25, 2022
  3. Orgad ShanehApr 25, 2022
  4. submodule--helper: fix initialization of warn_if_uninitializedOrgad Shaneh via GitGitGadget, Apr 25, 2022
  5. Junio C HamanoApr 25, 2022
  6. Junio C HamanoApr 25, 2022
  7. Glen ChooApr 27, 2022
  8. Glen ChooApr 27, 2022
  9. Glen ChooApr 27, 2022
  10. Glen ChooApr 27, 2022
  11. Junio C HamanoApr 27, 2022

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.