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

Re: [RFC PATCH] switch: provide configurable detach

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Apr 4, 2026, 16:58 UTC
Message-ID
<CALnO6CA2_MjKENu3CK-zCfoG=edEuMm6rohBtJ_8JC9WgMudEw@mail.gmail.com>
In-Reply-To
<njuf62lav6akkmdyqutwk7pim5yutw5cuicjidwpe5eh6qnkqr@4ir6q4uhhvht>
On Sat, Apr 4, 2026 at 10:36 AM Thibaud CANALE <thican@thican.net> wrote:
>
> Its purpose is to provide for git-switch(1) same detach behavior on
> commit it than git-checkout(1) through configuration option
> `checkout.switchDetach`.

I considered contributing something similar at one point, though I would call it "switch.detach" ("<command>.<option>").

I think I eventually decided against sending a patch because I was concerned that such an option might make using git-switch in scripts more of a headache. If I'm using it intentionally because it will fail in some circumstances without --detach, now I've got to also do "-c switch.detach=false" or something to control for the new configuration.

On the one hand, I think that argument applies mostly to plumbing rather than porcelain commands. On the other, a command for switching branches whose behavior is reliable enough for scripts seems worthwhile. So, idk :)

-- 
D. Ben Knoble
Previous: Thibaud CANALENext: Thibaud CANALE
Message 4 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.