Re: [PATCH 24/34] checkout: reject if the branch is already checked out elsewhere
- From
Mark Levedahl <mlevedahl@gmail.com>
- Date
- Dec 2, 2014, 05:04 UTC
- Message-ID
- <547D487B.4040502@gmail.com>
- In-Reply-To
- <xmqq1tojqnfg.fsf@gitster.dls.corp.google.com>
On 12/01/2014 12:39 PM, Junio C Hamano wrote:
Show 11 quoted lines
> 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.
Yes, detached HEADS allow multiple checkouts, but now the user needs another system to record what $branch was for each checked out tree or needs to resort to forensics using various git-branch / git-log invocations to find the most-likely value. So, I do not find detached HEADS useful in general, and specifically not for this case. Duy's latest addition ('--ignore-other-worktrees') would, so far as I see, allow this feature to replace git-new-workdir in my uses, but without the addition it cannot.
Mark