git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Denton Liu <liu.denton@gmail.com>, phillip.wood@dunelm.org.uk
Cc: Git Mailing List <git@vger.kernel.org>,
	Eric Sunshine <sunshine@sunshineco.com>
Subject: Re: [PATCH v2] checkout: teach --worktree
Date: Wed, 24 Jun 2020 11:20:06 +0100	[thread overview]
Message-ID: <dd17f82a-f5b3-d57e-d296-c1b5ecc8c1f5@gmail.com> (raw)
In-Reply-To: <20200623155538.GA2014954@generichostname>

Hi Denton

On 23/06/2020 16:55, Denton Liu wrote:
> Hi Phillip,
> 
> Sorry for the late reply.
> 
> On Tue, Jun 16, 2020 at 05:01:53PM +0100, Phillip Wood wrote:
>> I'm afraid I'm not sure that adding another option to `git checkout` is a
>> good idea. The behavior of `git checkout` is already complicated enough
>> which is why we ended up with switch and restore separating out branch
>> switching from file updating.
> 
> I think that since this option clearly applies only for a
> restore-type action and there are checks in place to ensure that
> the user is not attempting to use it for a switch-type action, it
> doesn't introduce much more complexity than the `git restore --worktree`
> option does.

It introduces more complexity to checkout by existing. The point I was
trying to make was that checkout is complicated to use and adding more
features makes that problem worse. As to being obvious that it applies
to a restore-type action, when I first saw the patch subject line my
immediate thought was that it was going to be doing something with
worktrees.

I am worried that people will think 'checkout --worktree' is the same as
'restore --worktree' but it isn't it's the same as 'restore --overlay
--worktree'. Having subtle differences like this between commands is
confusing for users and wastes our time answering queries about the
difference on the mailing list. It is not possible to make 'checkout
--worktree' imply --no-overlay as that would be inconsistent with
'checkout <pathspec>'

> 
>> Given `git restore` provides a way to update the worktree without touching
>> the index I'm not convinced we should be further complicating `git checkout`
>> especially as it defaults to --overlay unless -p is given which is confusing
>> in itself.
> 
> I don't think it'll hurt to provide more than one way of doing it.

I disagree, it is confusing to users if they see one person saying "use
checkout" and another "use restore". They will wonder if there is a
difference between them and which one is better. It's to be expected
that there will be some overlap in functionality between commands as git
grows and adds new commands but in this case we're adding functionality
that already exists. There was a lot of thought and discussion put into
designing and implementing 'switch' and 'restore' to make more
predictable and easier for users to understand, adding more options to
'checkout' under cuts that by muddying the waters on which command
should be used.

> As a
> pretty long-time user of git, I've been having trouble picking up the
> switch/restore commands in favour of good ol' checkout due to muscle
> memory. I agree that I should try and switch over to these new commands
> but old habits die hard and I think it would be much easier to just
> provide this option to checkout.

While I have sympathy with that (I still use checkout myself a lot of
the time) it's hard to argue you have a muscle memory for an option that
does not exist!

Best Wishes

Phillip

> Thanks,
> 
> Denton
> 


      reply	other threads:[~2020-06-24 10:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-13 14:25 [PATCH] checkout: teach --worktree Denton Liu
2020-06-14  2:51 ` Eric Sunshine
2020-06-14  7:44   ` Denton Liu
2020-06-14  8:02     ` Denton Liu
2020-06-14 21:37   ` Junio C Hamano
2020-06-14  8:49 ` [PATCH v2] " Denton Liu
2020-06-16 16:01   ` Phillip Wood
2020-06-23 15:55     ` Denton Liu
2020-06-24 10:20       ` Phillip Wood [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd17f82a-f5b3-d57e-d296-c1b5ecc8c1f5@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=liu.denton@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).