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

Re: [PATCH] doc: use "git switch -c" rather than "git checkout -b" consistently

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jan 9, 2023, 04:48 UTC
Message-ID
<CAPig+cQe_VMW2KV+ZyZwosFw07Q+hePryDVushRJ-jFfD4yzpw@mail.gmail.com>
In-Reply-To
<xmqqbkn8wcqo.fsf@gitster.g>
On Sun, Jan 8, 2023 at 11:36 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> > From: Yutaro Ohno <yutaro.ono.418@gmail.com>
> > Subject: Re: [PATCH] doc: use "git switch -c" rather than "git checkout -b" consistently
>
> Hmph.  When two things work equally well, is it a good idea to
> describe only one "consistently", or mention both that can be used
> pretty much interchangeably in different places?  I am not 100% sure
> "consistently" is a good thing here.
>
> Thoughts from others?

Perhaps if the patch was sold as filling in a gap left by 328c6cb853 (doc: promote "git switch", 2019-03-29) it would be more palatable.

It does feel a bit strange that within the git-checkout documentation, this patch is replacing an example invocation of git-checkout with an invocation of git-switch. However, as the list of commands the patch touches is given merely as examples one might use, then I could see git-switch being prepended to the list rather than entirely replacing git-checkout. For instance:

    If we have not yet moved away from commit `f`,
    any of these will create a reference to it:
    ------------
    $ git switch -c foo     <1>
    $ git checkout -b foo   <1>
    $ git branch foo        <2>
    $ git tag foo           <3>
    ------------
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 14 in “doc: use "git switch -c" rather than "git checkout -b" consistently”
  1. doc: use "git switch -c" rather than "git checkout -b" consistentlyYutaro Ohno via GitGitGadget, Jan 8, 2023
  2. Junio C HamanoJan 9, 2023
  3. Eric SunshineJan 9, 2023
  4. Junio C HamanoJan 9, 2023
  5. Eric SunshineJan 9, 2023
  6. Yutaro OhnoJan 9, 2023
  7. rsbecker@nexbridge.comJan 9, 2023
  8. Eric SunshineJan 9, 2023
  9. rsbecker@nexbridge.comJan 9, 2023
  10. Eric SunshineJan 9, 2023
  11. Ævar Arnfjörð BjarmasonJan 9, 2023
  12. doc: add "git switch -c" as another option on detached HEADYutaro Ohno via GitGitGadget, Jan 9, 2023
  13. Eric SunshineJan 9, 2023
  14. Junio C HamanoJan 13, 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.