Re: [PATCH 24/34] checkout: reject if the branch is already checked out elsewhere

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

 



Duy Nguyen <pclouds@xxxxxxxxx> writes:

> On Sun, Nov 30, 2014 at 12:18:40PM -0500, Mark Levedahl wrote:
>> On 11/30/2014 03:24 AM, Nguyễn Thái Ngọc Duy wrote:
>> > One branch obviously can't be checked out at two places (but detached
>> > heads are ok). Give the user a choice in this case: --detach, -b
>> > new-branch, switch branch in the other checkout first or simply 'cd'
>> > and continue to work there.
>> >
>> 
>> This seems too restrictive and is not "obvious" to me: I currently use 
>> git-new-workdir to have multiple checkouts of the same branch, with no 
>> ill effect. While those who do not understand what is going on 
>> underneath might be confused by one checkout suddenly showing 
>> uncommitted diffs, I don't accept that as a reason to outright prevent 
>> such use. I suggest, at the very least, that this behavior be overridden 
>> by a --force flag?
>
> Prevention is a strong word. It's more about safety for the mere
> mortals. It's certainly possible to do something like this patch
> (--force can't be reused, it already carries some other meaning).
> Should I add this one in the next (hic) reroll?

Sorry, what is a hic?

If this were an existing feature like git-new-workdir, even though
it is from contrib, making it impossible to do something that used
to be possible, even if that something is what mere mortals would
never want to to to avoid risking confusion, would be a regression
that needs an escape hatch.

But this is a new feature.  I am not sure why you need to make this
overridable in the first place.  Those who want to have multiple
checkouts of the same commit can just detach HEAD at the same commit
in multiple working trees, as the first thing they need to do would
be to run "git reset --hard $branch" to synchronize the HEAD and the
working tree state to work in the other out-of-sync repositories
either case anyway.
--
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]