Re: [PATCH] doc: use "git switch -c" rather than "git checkout -b" consistently
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jan 9, 2023, 04:48 UTC
- Message-ID
- <CAPig+cQe_VMW2KV+ZyZwosFw07Q+hePryDVushRJ-jFfD4yzpw@mail.gmail.com>
- In-Reply-To
- <xmqqbkn8wcqo.fsf@gitster.g>
On Sun, Jan 8, 2023 at 11:36 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> > From: Yutaro Ohno <yutaro.ono.418@gmail.com> > > Subject: Re: [PATCH] doc: use "git switch -c" rather than "git checkout -b" consistently > > Hmph. When two things work equally well, is it a good idea to > describe only one "consistently", or mention both that can be used > pretty much interchangeably in different places? I am not 100% sure > "consistently" is a good thing here. > > Thoughts from others?
Perhaps if the patch was sold as filling in a gap left by 328c6cb853 (doc: promote "git switch", 2019-03-29) it would be more palatable.
It does feel a bit strange that within the git-checkout documentation, this patch is replacing an example invocation of git-checkout with an invocation of git-switch. However, as the list of commands the patch touches is given merely as examples one might use, then I could see git-switch being prepended to the list rather than entirely replacing git-checkout. For instance:
If we have not yet moved away from commit `f`,
any of these will create a reference to it: ------------
$ git switch -c foo <1>
$ git checkout -b foo <1>
$ git branch foo <2>
$ git tag foo <3>
------------