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

2014-12-03 Thread Mark Levedahl
On 12/02/2014 12:30 PM, Junio C Hamano wrote: Duy Nguyen pclo...@gmail.com writes: FWIW git-branch usually can show the original branch of detached head (must not always). I don't think we have a plumbing equivalent for it though. People can tail -1 $GIT_DIR/logs/HEAD| sed .. but that seems

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

2014-12-03 Thread Duy Nguyen
On Wed, Dec 3, 2014 at 12:30 AM, Junio C Hamano gits...@pobox.com wrote: I do like read-only ref concept where we can keep ref name (especially tags) in HEAD until the next commit. But it didn't go anywhere Remind me. That sounds somewhat interesting. Couldn't find anything in my mail

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

2014-12-03 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Wed, Dec 3, 2014 at 12:30 AM, Junio C Hamano gits...@pobox.com wrote: I do like read-only ref concept where we can keep ref name (especially tags) in HEAD until the next commit. But it didn't go anywhere Remind me. That sounds somewhat interesting.

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

2014-12-02 Thread Duy Nguyen
On Tue, Dec 2, 2014 at 12:39 AM, Junio C Hamano gits...@pobox.com wrote: Sorry, what is a hic? Off topic. It's the sound (in Vietnamese) when you inhale through your nose, e.g. like when you cry.. I know there's an equivalent in English, just can't remember it now. -- Duy -- To unsubscribe from

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

2014-12-02 Thread Duy Nguyen
On Tue, Dec 2, 2014 at 12:04 PM, Mark Levedahl mleved...@gmail.com wrote: On 12/01/2014 12:39 PM, Junio C Hamano wrote: 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,

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

2014-12-02 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: FWIW git-branch usually can show the original branch of detached head (must not always). I don't think we have a plumbing equivalent for it though. People can tail -1 $GIT_DIR/logs/HEAD| sed .. but that seems hacky. @{-1}, i.e. the last branch I checked

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

2014-12-01 Thread Duy Nguyen
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

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

2014-12-01 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com 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

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

2014-11-30 Thread Nguyễn Thái Ngọc Duy
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. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com ---

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

2014-11-30 Thread Mark Levedahl
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