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

[PATCH] submodule: deprecate --recurse-submodules=""

From
Alex Henrie <alexhenrie24@gmail.com>
Date
Aug 23, 2023, 03:28 UTC
Message-ID
<20230823032839.731375-1-alexhenrie24@gmail.com>

The unusual syntax --recurse-submodules="" (that is, --recurse-submodules with an empty string argument) has been an undocumented synonym of --recurse-submodules without an argument since commit 8f0700dd33 (fetch/pull: Add the 'on-demand' value to the --recurse-submodules option, 2011-03-06). Deprecate that syntax to avoid confusion with the submodule.recurse config option, where submodule.recurse="" is equivalent to --no-recurse-submodules.

The same thing was done for --rebase-merges="" in commit 33561f5170 (rebase: deprecate --rebase-merges="", 2023-03-25).

Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
---
 submodule-config.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/submodule-config.c b/submodule-config.c
index 6a48fd12f6..8acb42744d 100644
--- a/submodule-config.c
+++ b/submodule-config.c
@@ -332,11 +332,17 @@ int option_fetch_parse_recurse_submodules(const struct option *opt,
 
 	if (unset) {
 		*v = RECURSE_SUBMODULES_OFF;
+	} else if (!arg) {
+		*v = RECURSE_SUBMODULES_ON;
 	} else {
-		if (arg)
-			*v = parse_fetch_recurse_submodules_arg(opt->long_name, arg);
-		else
-			*v = RECURSE_SUBMODULES_ON;
+		if (!*arg) {
+			warning(_("--recurse-submodules with an empty string "
+				  "argument is deprecated and will stop "
+				  "working in a future version of Git. Use "
+				  "--recurse-submodules without an argument "
+				  "instead, which does the same thing."));
+		}
+		*v = parse_fetch_recurse_submodules_arg(opt->long_name, arg);
 	}
 	return 0;
 }
-- 
2.41.0
Next: Taylor Blau
Message 1 of 5 in “submodule: deprecate --recurse-submodules=""”
  1. submodule: deprecate --recurse-submodules=""Alex Henrie, Aug 23, 2023
  2. Taylor BlauAug 23, 2023
  3. Alex HenrieAug 23, 2023
  4. Taylor BlauAug 23, 2023
  5. Junio C HamanoAug 23, 2023

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.