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

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

From
Orgad Shaneh via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 24, 2022, 06:26 UTC
Message-ID
<pull.1258.git.git.1650781575173.gitgitgadget@gmail.com>
From: Orgad Shaneh <orgads@gmail.com>

This field is supposed to be off by default, and it is only enabled when running `git submodule update <path>`, and path is not initialized.

Commit c9911c9358 changed it to enabled by default. This affects for example git checkout, which displays the following warning for each uninitialized submodule:

Submodule path 'sub' not initialized Maybe you want to use 'update --init'?

Amends c9911c9358e611390e2444f718c73900d17d3d60.
Signed-off-by: Orgad Shaneh <orgads@gmail.com>
---
    submodule--helper: fix initialization of warn_if_uninitialized
    
    This field is supposed to be off by default, and it is only enabled when
    running git submodule update <path>, and path is not initialized.
    
    Commit c9911c9358 changed it to enabled by default. This affects for
    example git checkout, which displays the following warning for each
    uninitialized submodule:
    
    Submodule path 'sub' not initialized
    Maybe you want to use 'update --init'?
    
    
    Amends c9911c9358e611390e2444f718c73900d17d3d60.
    
    Signed-off-by: Orgad Shaneh orgads@gmail.com
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1258%2Forgads%2Fsub-no-warn-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1258/orgads/sub-no-warn-v1
Pull-Request: https://github.com/git/git/pull/1258
 builtin/submodule--helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 2c87ef9364f..b28112e3040 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2026,7 +2026,7 @@ struct update_data {
 	.references = STRING_LIST_INIT_DUP, \
 	.single_branch = -1, \
 	.max_jobs = 1, \
-	.warn_if_uninitialized = 1, \
+	.warn_if_uninitialized = 0, \
 }
 
 static void next_submodule_warn_missing(struct submodule_update_clone *suc,

base-commit: 6cd33dceed60949e2dbc32e3f0f5e67c4c882e1e
-- 
gitgitgadget
Next: Junio C Hamano
Message 1 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.