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 8, 2023, 00:07 UTC
Message-ID
<ZDCwT3mhaGHyydng@google.com>
In-Reply-To
<xmqqcz4fi7bd.fsf@gitster.g>
On Fri, Apr 07, 2023 at 04:47:02PM -0700, Junio C Hamano wrote:
Show 11 quoted lines
> 
> Emily Shaffer <nasamuffin@google.com> writes:
> 
> > `git switch` `git checkout`, `git reset`, and `git read-tree` allow a user to choose to
> > recurse into submodules. All three of these commands' short usage seems
> > to indicate that `--recurse-submodules` should take an argument. In
> > practice, ...
> 
> Did you add 'git switch' at the last minute in so much of a hurry
> that you forgot to put a comma after it, or rewrap the paragraph?
> ;-)

It was 'git checkout', if you must know ;) and in such a hurry that I also neglected to s/three/four/g. Will fix it with the reroll.

Show 14 quoted lines
> 
> I do agree with you that "git checkout -h" and "git reset -h" that
> list
> 
> 	--recurse-submodules[=<checkout>]
> 	--recurse-submodules[=<reset>]
> 
> are being unnecessarily confusing by not saying anything about what
> these placeholders are to be filled with.  
> 
> This however is a breaking change.  Even though there is no hint
> that <checkout> and <reset> placeholders above take either Boolean
> true or false in the documentation, they may have picked up a habit
> to use the undocumented form from some random website.
Ah, yeah, I see what you mean, from my locally-built version:
  g checkout --recurse-submodules=false master
  error: option `recurse-submodules' takes no value
Show 21 quoted lines
> I am not
> sure it is safe to change the behaviour right under them, like this
> patch does, and I wonder if we should do this in two steps, with its
> first step doing:
> 
>  * "--[no-]recurse-submodules" from the command line gets no
>    warning, as that is the way we recommend users to use the
>    feature.
> 
>  * "--recurse-submodules=$true" and "--recurse-submodules=$false"
>    (for various ways to spell true and false) get warning that tells
>    the users that versions of Git in a year or more in the future
>    will stop supporting the Boolean argument form of the option and
>    instructs them to use "--[no-]recurse-submodules" instead.
> 
> We may have to also mention in the documentation that historically
> the code accepted a Boolean value as an optional argument for the
> option by mistake, but we are deprecating that form.
> 
> And after the second step, the code will end up looking like what
> this patch shows.

I'd be happy to do so with a reroll, probably on Monday. It's true that while these are user-facing commands which we don't guarantee backwards compatibility for, there's not a reason to subject users to that kind of pain unnecessarily.

Thanks for the quick response.
 - Emily
Previous: Emily ShafferNext: Junio C Hamano
Message 7 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.