Re: [PATCH 2/2] Make HEAD a PSEUDOREF rather than PER_WORKTREE.
- From
Han-Wen Nienhuys <hanwen@google.com>
- Date
- Jul 7, 2020, 09:24 UTC
- Message-ID
- <CAFQ2z_Nvieyfy4AWz8=sRjsbuXgv1HLVosH78p4Axj5vce5yNQ@mail.gmail.com>
- In-Reply-To
- <xmqqeepo9yjb.fsf@gitster.c.googlers.com>
On Mon, Jul 6, 2020 at 10:30 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> > This is consistent with the definition of REF_TYPE_PSEUDOREF > > (uppercase in the root ref namespace). > > I wonder if some special casing we saw for "HEAD" in 1/2 (e.g. we no > longer do this to pseudorefs in this codepath but HEAD is different > and will continue to be dealt with in the codepath) needs adjustment > after this change? HEAD still needs to be able to have a different > value (either detached or pointing to another ref) per worktree, but > it is unclear where that knowledge now resides in the new code. Are > we declaring that all pseudorefs are per worktree (which I think is > not wrong)?
the source code already says
enum ref_type {
REF_TYPE_PER_WORKTREE, /* refs inside refs/ but not shared */
REF_TYPE_PSEUDOREF, /* refs outside refs/ in current worktree */but considers HEAD a REF_TYPE_PER_WORKTREE, counter to the comment.
IIRC, this change actually has almost no effect, because most code treats both enum values as equivalent. (see eg. builtin/reflog.c), except for the code that the preceding commit changes.
-- Han-Wen Nienhuys - Google Munich I work 80%. Don't expect answers from me on Fridays. -- Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Paul Manicle, Halimah DeLaine Prado