Re: [RFC/PATCH] worktree: replace "checkout --to" with "worktree new"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 30, 2015 at 6:02 PM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> On Tue, Jun 30, 2015 at 5:23 AM, Duy Nguyen <pclouds@xxxxxxxxx> wrote:
>> On Tue, Jun 30, 2015 at 11:56 AM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
>>> The command "git checkout --to <path>" is something of an anachronism,
>>> encompassing functionality somewhere between "checkout" and "clone".
>>> The introduction of the git-worktree command, however, provides a proper
>>> and intuitive place to house such functionality. Consequently,
>>> re-implement "git checkout --to" as "git worktree new".
>>
>> "git worktree new" definitely makes sense (maybe stick with verbs like
>> "create", I'm not sure if we have some convention in existing
>> commands), but should we remove "git checkout --to"? I could do "git
>> co -b foo --to bar" for example.
>
> You can still do that with "git worktree new bar -b foo", which is
> effectively the same as "git checkout --to bar -b foo" (with
> s/checkout/worktree/ and s/--to/new/ applied), though perhaps you
> don't find it as obvious or natural.

I had never understood why you chose to plug the linked-worktree
functionality into git-checkout via --to, but this usage pattern
(creating a new branch and checking it out into a new worktree as one
operation) goes a long way toward explaining why you consider
git-checkout a proper home for linked-worktree creation. I don't think
that justification was ever mentioned when the series was being
presented (or, if it was, I must have missed it). Now it makes much
more sense, and I can better appreciate your desire to keep "git
checkout --to" as an alias for "git worktree add". Thanks for
explaining it.

(Having said that, replacing "git checkout --to" with "git worktree
add" still seems a preferable first step, while keeping open the door
to re-add "git checkout --to" later if we become convinced that it's
worthwhile.)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]