Re: git-switch history and checkout compatibility
- From
- Namikaze Minato <lloydsensei+git@gmail.com>
- Date
- Aug 1, 2023, 17:23 UTC
- Message-ID
- <CACmJb3wTsWdqDGrkYC0p+eB-XYBotVcFAKcXJF3ftYdiiRvEdw@mail.gmail.com>
- In-Reply-To
- <xmqqa5wjee25.fsf@gitster.g>
On Wed, 28 Jun 2023 at 18:39, Junio C Hamano <gitster@pobox.com> wrote:
> * I suspect that requiring an explicit "--detach" is deliberate, as > they were trying to make "newbie friendlier" version of checkout.
Yes, I also believe this is deliberate. I do not think however it makes it newbie-friendly. As I said, on the contrary, I am having a hard time to get newbies to start using switch precisely because it behaves differently from checkout.
Show 6 quoted lines
> * I am on the fence about the latter one. While I think it is a
> bug if "switch -" and "switch @{-1}" did not work exactly like
> "checkout @{-1}", combined with the previous point of requiring
> to be explicit when detaching HEAD, "switch -" that tries to go
> back to a detached state may be justifiable---it stops you in
> order to avoid accidental detaching of HEAD.You are right, it may be justifiable. But unexpected behavior for both newbies and experts may not be desirable.
> Personally, I think those who are familiar with and expert enough on > Git and do not feel uneasy working on detached HEAD can and should > just use "checkout" not "switch/restore", but that may be just me.
Isn't checkout supposed to become deprecated at some point? Does it mean I can safely ignore the fact that switch exists and continue advocating for checkout instead? I am missing the point for the introduction of git-switch entirely then. And as you said you were not among the primary advocates to add it, I guess we should wait for someone else to reply about this?
And I still would love to have a checkout.autoDetach or switch.autoDetach option :)
In any case, thank you already for this reply <3 Minato