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

Re: [RFC PATCH] switch: provide configurable detach

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 7, 2026, 00:50 UTC
Message-ID
<xmqqh5pn8ugs.fsf@gitster.g>
In-Reply-To
<f0276575-9c75-45fb-8fcc-b465619d1b97@app.fastmail.com>
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
Show 13 quoted lines
> On the other hand, the BreakingChanges document does call
> git-checkout(1) “superseded”.  And in that light I do understand why
> people want to actively avoid git-checkout(1), including implementing
> replacements for all relevant checkout-use cases in git-switch(1).
>
>     Superseded features that will not be deprecated
>
>     [...]
>
>     • The features git-checkout(1) offers are covered by the pair of
>       commands git-restore(1) and git-switch(1). Because the use of
>       git-checkout(1) is still widespread, and it is not expected that
>       this will change anytime soon, all three commands will stay.

Perhaps a good first step would be to stop calling checkout "superseded". As they stand, all three are equally viable. In other words, I would not exactly call "switch/restore" a failed experiment, but it wasn't a clear success story, either.

I think "still" and "anytime soon" in the above paragraph are doing disservice by implying that somehow we want to remove checkout but we cannot yet, when the reality is that we wanted to be able to replace checkout with switch/restore in the distant past, but that was a misguided attempt and did not work very well.

It is not like switch/restore pair did not work well or anything, and in that sense switch/restore themselves are by no means failures, but it was a failed experiment to introduce these two as a way to replace and kill checkout. For those users to whom both "checking out files" and "checkout out a branch" appear as clear concepts, there is no reason to abandon checkout.

Previous: Kristoffer Haugsbakk
Message 9 of 9 in “switch: provide configurable detach”
  1. switch: provide configurable detachThibaud CANALE, Apr 4, 2026
  2. PabloApr 4, 2026
  3. Thibaud CANALEApr 4, 2026
  4. D. Ben KnobleApr 4, 2026
  5. Thibaud CANALEApr 4, 2026
  6. switch: provide configurable detachThibaud CANALE, Apr 4, 2026
  7. Junio C HamanoApr 6, 2026
  8. Kristoffer HaugsbakkApr 6, 2026
  9. Junio C HamanoApr 7, 2026

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.