From: Junio C Hamano <gitster@pobox.com>
To: Emily Shaffer <nasamuffin@google.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] usage: clarify --recurse-submodules as a boolean
Date: Fri, 07 Apr 2023 17:59:53 -0700 [thread overview]
Message-ID: <xmqqy1n3fat2.fsf@gitster.g> (raw)
In-Reply-To: <ZDCztVHuZoCstNar@google.com> (Emily Shaffer's message of "Fri, 7 Apr 2023 17:22:13 -0700")
Emily Shaffer <nasamuffin@google.com> writes:
> I think we do because config_update_recurse_submodules is static to
> submodule.c - that is, builtin/checkout.c and friends don't have access
> to set it manually with OPT_BOOL. Using the callback just to set static
> state we don't naturally have access to is pretty awful, though, so I'd
> be in favor of plumbing it through like other options we might be
> passing to the submodule machinery.
Yes, the cleanest way to interface into that part of the submodule
machinery that wants to use a hidden static state would be to
(1) implement a setter interface in the submodule machinery for
that hidden static state, and
(2) use the bog-standard OPT_BOOL() on an on-stack variable of
cmd_checkout() and friends, and use that setter interface after
parse_options() returns.
Then you can avoid the "pretty awful" arrangement today's code has.
Note that such a clean-up can be done independent of how an option
that yields a Boolean value can be spelled, i.e. whether we'd accept
--frotz=yes or only take --[no-]frotz.
next prev parent reply other threads:[~2023-04-08 1:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 22:18 [PATCH] usage: clarify --recurse-submodules as a boolean Emily Shaffer
2023-04-07 23:47 ` Junio C Hamano
2023-04-08 0:03 ` Junio C Hamano
2023-04-08 0:22 ` Emily Shaffer
2023-04-08 0:59 ` Junio C Hamano [this message]
2023-04-10 16:41 ` Emily Shaffer
2023-04-08 0:07 ` Emily Shaffer
2023-04-10 23:07 ` Junio C Hamano
2023-04-10 22:52 ` [PATCH v2] " Emily Shaffer
2023-04-10 23:10 ` Junio C Hamano
2023-05-05 17:30 ` 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=xmqqy1n3fat2.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=nasamuffin@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.