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

Re: [PATCH] usage: clarify --recurse-submodules as a boolean

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2023, 00:59 UTC
Message-ID
<xmqqy1n3fat2.fsf@gitster.g>
In-Reply-To
<ZDCztVHuZoCstNar@google.com>
Emily Shaffer <nasamuffin@google.com> writes:
Show 6 quoted lines
> 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.

Previous: Emily ShafferNext: Emily Shaffer
Message 5 of 11 in “usage: clarify --recurse-submodules as a boolean”
  1. usage: clarify --recurse-submodules as a booleanEmily Shaffer, Apr 7, 2023
  2. Junio C HamanoApr 7, 2023
  3. Junio C HamanoApr 8, 2023
  4. Emily ShafferApr 8, 2023
  5. Junio C HamanoApr 8, 2023
  6. Emily ShafferApr 10, 2023
  7. Emily ShafferApr 8, 2023
  8. Junio C HamanoApr 10, 2023
  9. usage: clarify --recurse-submodules as a booleanEmily Shaffer, Apr 10, 2023
  10. Junio C HamanoApr 10, 2023
  11. Junio C HamanoMay 5, 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.