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

Re: [PATCH v2] Doc: document push.recurseSubmodules=only

From
Glen Choo <chooglen@google.com>
Date
Nov 16, 2022, 21:21 UTC
Message-ID
<kl6lpmdmvbnk.fsf@chooglen-macbookpro.roam.corp.google.com>
In-Reply-To
<20221115184702.169258-1-jonathantanmy@google.com>
Jonathan Tan <jonathantanmy@google.com> writes:
Show 13 quoted lines
>> When we pass this magic, undocumented value, "git push" will warn about
>> about "only" and override it with "on-demand". We always pass it when we
>> recurse into submodules, and we assume that no user will pass it, thus
>> we get the warning iff we are recursing into submodules.
>> 
>> In that case, it sounds like "--recurse-submodules=only-is-on-demand" is
>> a synonym for "this is a submodule that is being recursed into". In that
>> case, wouldn't it be more self-documenting to have a hidden CLI flag
>> that expresses exactly that ? e.g. we could add a PARSE_OPT_HIDDEN flag
>> called "--is-recursing" and check that boolean value. This seems clearer
>> to me at least.
>
> Hmm...--recurse-submodules=only-is-on-demand is hidden too, right?

I suppose so, but as a matter of personal taste, when encountering a hidden CLI option, I'd prefer to see the option's documentation when I grep:

  OPT_HIDDEN_BOOL(0, "is-recursing", &is_recursing, "internal only,
    override recurseSubmodules = only")
than:
  if (!strcmp(arg, "only-is-on-demand")) {
    /* etc */
  }
>                                                                    One
> advantage of doing this instead of a separate arg is that neither the
> caller nor "git push" needs to think about what happens if both --recurse-
> submodules=something and --is-recursing are both specified.

That's true, and I suppose it prevents the temptation to reuse --is-recursing for things it wasn't meant for. But in that case, couldn't we say the same thing if we renamed "--is-recursing" to "--recurse-only-is-on-demand"?

At any rate, do treat this as just a suggestion. I won't block this if both you and Taylor find this clear enough :)

Previous: Jonathan TanNext: Taylor Blau
Message 9 of 10 in “submodule: explicitly specify on-demand upon push”
  1. submodule: explicitly specify on-demand upon pushJonathan Tan, Nov 8, 2022
  2. Taylor BlauNov 8, 2022
  3. Jonathan TanNov 8, 2022
  4. Glen ChooNov 9, 2022
  5. Doc: document push.recurseSubmodules=onlyJonathan Tan, Nov 14, 2022
  6. Taylor BlauNov 14, 2022
  7. Glen ChooNov 15, 2022
  8. Jonathan TanNov 15, 2022
  9. Glen ChooNov 16, 2022
  10. Taylor BlauNov 16, 2022

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.