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

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

From
Emily Shaffer <nasamuffin@google.com>
Date
Apr 10, 2023, 16:41 UTC
Message-ID
<ZDQ8MdTPhCleBNeJ@google.com>
In-Reply-To
<xmqqy1n3fat2.fsf@gitster.g>
On Fri, Apr 07, 2023 at 05:59:53PM -0700, Junio C Hamano wrote:
Show 25 quoted lines
> 
> 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.
Oh, totally. Yes, this sounds quite easy, I'll send a reroll today.
 - Emily
Previous: Junio C HamanoNext: Emily Shaffer
Message 6 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.