From: Alex Henrie <alexhenrie24@gmail.com>
To: Taylor Blau <me@ttaylorr.com>
Cc: git@vger.kernel.org, Jens.Lehmann@web.de, gitster@pobox.com
Subject: Re: [PATCH] submodule: deprecate --recurse-submodules=""
Date: Wed, 23 Aug 2023 13:53:22 -0600 [thread overview]
Message-ID: <CAMMLpeRam03bmO0jnsbKQB7174xv12HJzTtC-6dHFbQDMKB5gA@mail.gmail.com> (raw)
In-Reply-To: <ZOZf4/DYOKqQLjR+@nand.local>
On Wed, Aug 23, 2023 at 1:37 PM Taylor Blau <me@ttaylorr.com> wrote:
>
> On Tue, Aug 22, 2023 at 09:28:37PM -0600, Alex Henrie wrote:
> > + 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."));
>
> This advice says to use `--recurse-submodules` as a non-deprecated
> synonym for `--recurse-submodules=""`, but I am not so sure that is
> correct advice.
>
> In the pre-image of this patch, having arg be set to the empty string
> would cause us to fall into the path that executes
>
> *v = parse_fetch_recurse_submodules_arg(opt->long_name, arg);
>
> which calls `parse_fetch_recurse()` -> `git_parse_maybe_bool()` ->
> `git_parse_maybe_bool_text()` which given the empty string will return
> 0.
>
> So here we'd be doing the equivalent of
>
> *v = RECURSE_SUBMODULES_OFF;
>
> when trying to parse `--recurse-submodules=""`. Should this advice
> instead say "[...] Use --no-recurse-submodules without an argument,
> which does the same thing"?
You're right; I misunderstood the situation here.
--recurse-submodules="" is indeed equivalent to
--no-recurse-submodules, and that's what the advice should recommend.
On the other hand, given that the empty string does the same thing
both in a config file and on the command line, maybe it's not a
problem to allow the empty string on the command line. Personally I
think I'd still prefer to ask the user to use a more explicit syntax.
Thoughts?
-Alex
next prev parent reply other threads:[~2023-08-23 19:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 3:28 [PATCH] submodule: deprecate --recurse-submodules="" Alex Henrie
2023-08-23 19:37 ` Taylor Blau
2023-08-23 19:53 ` Alex Henrie [this message]
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=CAMMLpeRam03bmO0jnsbKQB7174xv12HJzTtC-6dHFbQDMKB5gA@mail.gmail.com \
--to=alexhenrie24@gmail.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.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).