From: Junio C Hamano Date: Sun, 12 Nov 2023 06:04:57 GMT Subject: Re: [PATCH] checkout: add config variable checkout.autoDetach Message-ID: In-Reply-To: <20231111224253.1923-1-andy.koppe@gmail.com> Andy Koppe writes: > The git-checkout command without pathspecs automatically detaches HEAD > when switching to something other than a branch, whereas git-switch > requires the --detach option to do so. > > Add configuration variable checkout.autoDetach to choose the behavior > for both: true for automatic detaching, false for requiring --detach. > > Amend their documentation and tests accordingly. > > Signed-off-by: Andy Koppe > --- "switch" was meant to be an experimental command to sort out this kind of UI ideas, and I think the fact that it requires a more explicit "--detach", where experienced users might just say "git checkout that-branch^0", has established itself as a more friendly and good thing to help new users. I do not know how others react to this kind of proliferation of configuration variables, but I do not mind this particular variable existing.