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
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jan 9, 2023, 21:24 UTC
Message-ID
<230109.861qo31jr1.gmgdl@evledraar.gmail.com>
In-Reply-To
<CAPig+cTJ7CQpeo6v6j0L1beoTKyKnXcii2vYqRwy40R01vCo+A@mail.gmail.com>
On Mon, Jan 09 2023, Eric Sunshine wrote:
Show 30 quoted lines
> On Mon, Jan 9, 2023 at 2:58 PM <rsbecker@nexbridge.com> wrote:
>> On January 9, 2023 2:17 PM, Eric Sunshine wrote:
>> >On Mon, Jan 9, 2023 at 6:20 AM <rsbecker@nexbridge.com> wrote:
>> >> git switch is still marked as EXPERIMENTAL in the online help. I don't
>> >> think moving broadly to switch from checkout in the documentation
>> >> should happen until the EXPERIMENTAL designation is dropped. After that, then
>> >"switch -c"
>> >> should be used everywhere instead of checkout (except for in the
>> >> checkout documentation).
>> >
>> >Such a point probably should have been raised when 328c6cb853 (doc:
>> >promote "git switch", 2019-03-29) was submitted, but since 328c6cb853 was
>> >merged nearly four years ago and has been pointing people at git-switch all this
>> >time, it's probably too late to use it as an argument now.
>>
>> I agree. Perhaps it is time to drop the "EXPERIMENTAL" notices from 'git switch', in that case.
>
> Perhaps. Perhaps not. As I recall, both Felipe and Ævar expressed
> rather serious concerns that git-switch is not yet ready as a proper
> git-checkout replacement. Samples of their concerns can be found at
> [1] and [2], for instance.
>
> By the way, git-worktree is even older and probably more widely used
> than git-switch, yet it is still marked "experimental", as well, and
> perhaps rightly so. As far as I understand, for instance, it still
> isn't compatible with submodules (though there may have been some
> recent work from one of the Googlers in that area?).
>
> [1]: https://lore.kernel.org/git/211021.86wnm6l1ip.gmgdl@evledraar.gmail.com/
> [2]: https://lore.kernel.org/git/CAPiPmQnb=XMaF2+YkryEbiX8zA=jwa5y=fbAGk9jpCExpbS4Rw@mail.gmail.com/T/

I think deciding on the "EXPERIMENTAL" would be nice, and it should arguably precede wider use of "git switch" in the docs.

But on the other hand we already provide examples of it outside its own docs, so perhaps a change such as the one being proposed here is something we should just accept.

Discussions such as these might also suggest that thinking we can change its fundamental behavior at this point are wishful thinking, i.e. maybe too many users rely on it, and didn't read the disclaimer.

Previous: Eric SunshineNext: Yutaro Ohno via GitGitGadget
Message 11 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.