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