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

Re: [PATCH v1] git-clone.txt: add the --recursive option

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 14, 2021, 17:46 UTC
Message-ID
<xmqqbl4v2gpu.fsf@gitster.g>
In-Reply-To
<d02c7f3b-221d-fbab-827a-a950bf28856c@gmail.com>
Alban Gruin <alban.gruin@gmail.com> writes:
> Junio did mention[0] that --recursive was no longer in the manual, but
> not that it was once hidden from the option list.
Please allow me to summarize the discussion so far.

We want our subcommands to take "--recurse-submodules=<arg>" uniformly, while accepting any unique prefix, e.g. --recurs=<arg>, as its short-hand.

For "git clone", we kept "--recurse=<it>" in the options[] table as a HIDDEN entry as part of our deprecation plan. This nicely hid the deprecated "--recurse=<it>" from "git clone -h".

But it backfired because "git cmd --recur=<it>" was not a "unique prefix" (as it matched both) and triggered a disambiguation error. To solve it, we introduced OPT_ALIAS() to tell the machinery that allows unique prefix that these two are the same thing. As a side effect, because the use of OPT_ALIAS() did not have HIDDEN bit, we started showing the deprecated "--recurse" in "git clone -h" output.

Is that where we are?
I am wondering if it is just a matter of either
 * removing the "recursive" alias from the options table.  Because
   we accept unique prefix, --recurse=<arg> the user types will be
   taken as --recurse-submodules=<arg> anyway (until "git clone"
   learns another option --recurse-xyzzy=<arg>, at which time it
   will become ambiguous and error out, that is).
or
 * adding the PARSE_OPT_HIDDEN bit to the OPT_ALIAS() element for
   the deprecated "recurse" option.
and all would be fine?

Between adding "--recursive" to the manual and describing it as a deprecated synonym for "--recurse-submodules", and not doing so, I do not have a strong preference.

Thanks.
Previous: Alban GruinNext: Eric Sunshine
Message 6 of 10 in “git-clone.txt: add the --recursive option”
  1. git-clone.txt: add the --recursive optionAlban Gruin, Sep 13, 2021
  2. Eric SunshineSep 13, 2021
  3. Alban GruinSep 13, 2021
  4. Eric SunshineSep 13, 2021
  5. Alban GruinSep 14, 2021
  6. Junio C HamanoSep 14, 2021
  7. Eric SunshineSep 14, 2021
  8. Junio C HamanoSep 14, 2021
  9. Re* [PATCH v1] git-clone.txt: add the --recursive optionJunio C Hamano, Sep 14, 2021
  10. Junio C HamanoSep 13, 2021

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.