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

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

 



On Thu, Jul 2, 2015 at 3:00 PM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> On Thu, Jul 2, 2015 at 2:45 PM, Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
>> There's another instance: 3473ad0 (checkout: don't require a work tree
>> when checking out into a new one, 2014-11-30) added this:
>>
>>     if (!new_worktree)
>>         setup_work_tree();
>>
>> which the "worktree add" patch changed to:
>>
>>     setup_work_tree();
>>
>> which doesn't hurt (since setup_work_tree() protects itself against
>> multiple invocations) but isn't semantically clean. If I understand
>> correctly, I think a better approach would be to move the
>> setup_work_tree() call to worktree.c just before it invokes
>> git-checkout, and revert 3473ad0 entirely (including this bit):
>>
>>     - { "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE },
>>     +{ "checkout", cmd_checkout, RUN_SETUP },
>>
>> so that git-checkout once again requires a worktree.
>
> I mis-stated that a bit. The bit about "multiple invocations" isn't
> relevant. The point is that I think that 3473ad0 can simply be
> reverted as long as worktree.c calls setup_work_tree() before invoking
> git-checkout.

Please ignore my idiocy. Of course worktree.c can't call
setup_work_tree() on behalf of the sub git-checkout invocation.
Reverting 3473ad0 is the correct thing to do with the introduction of
"worktree add" since it removes the special case of having to be able
to run git-checkout without a worktree.
--
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]