Re: [PATCH 24/34] checkout: reject if the branch is already checked out elsewhere
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 3, 2014, 15:54 UTC
- Message-ID
- <xmqqegsgloeq.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <CACsJy8DLd4biEHo+FWYLqc4HKezHfv1ymWSQ8kLHLTQv=YKc3A@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 14 quoted lines
> On Wed, Dec 3, 2014 at 12:30 AM, Junio C Hamano <gitster@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 archive. But the idea is simple: > > - we delay detaching HEAD until we need to update the associated ref > at commit/reset time > - currently refs/tags/* are read-only. we generalize it to allow this > 'read-only' attribute on some refs/heads/* as well. Because we can't > really add attributes to refs, config var could be used.
It could be some annotation in HEAD instead, e.g.
$ cat .git/HEAD
ref: refs/heads/frotz
options: read-only
$ exitand it may make more sense as this read-only-ness is closely tied to the state of HEAD, i.e. whatever operation that manipulates the HEAD, it needs to be very much aware of the read-only-ness, and it is much less likely to go out of sync, compared to a solution where you store this bit to anywhere else, e.g. config.