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

Re: [RFC PATCH] switch: provide configurable detach

From
KHKristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Date
Apr 6, 2026, 17:48 UTC
Message-ID
<f0276575-9c75-45fb-8fcc-b465619d1b97@app.fastmail.com>
In-Reply-To
<xmqq7bqkcah8.fsf@gitster.g>
On Mon, Apr 6, 2026, at 18:36, Junio C Hamano wrote:
Show 11 quoted lines
> Thibaud CANALE <thican@thican.net> writes:
>>[snip]
>>  3 files changed, 46 insertions(+), 3 deletions(-)
>
> Sorry, but I am fairly negative on this change.
>
>[snip]
>
> FWIW, "git checkout" that knows what is and what is not a branch
> name and does not require "--detach" when detaching to anything that
> is not a branch name is always available and will not be going away.

On the one hand, I personally mostly use git-checkout(1) because I never use it to check out files and I like the detach behavior. So from that perspective I don’t understand Git users who interject when you provide examples for something and you (incidental to the example and point) use git-checkout(1) because that’s what you are used to. And they interject because git-checkout(1) is “obsolete” or something and you are setting a bad example (or something).

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.
https://git-scm.com/docs/BreakingChanges
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 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.