git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Henrie <alexhenrie24@gmail.com>
To: git@vger.kernel.org, Jens.Lehmann@web.de, gitster@pobox.com
Cc: Alex Henrie <alexhenrie24@gmail.com>
Subject: [PATCH] submodule: deprecate --recurse-submodules=""
Date: Tue, 22 Aug 2023 21:28:37 -0600	[thread overview]
Message-ID: <20230823032839.731375-1-alexhenrie24@gmail.com> (raw)

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


             reply	other threads:[~2023-08-23  3:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  3:28 Alex Henrie [this message]
2023-08-23 19:37 ` [PATCH] submodule: deprecate --recurse-submodules="" Taylor Blau
2023-08-23 19:53   ` Alex Henrie
2023-08-23 19:57     ` Taylor Blau
2023-08-23 20:26   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230823032839.731375-1-alexhenrie24@gmail.com \
    --to=alexhenrie24@gmail.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).