Re: [PATCH v3 0/3] Remove special casing for PSEUDOREF updates
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 5, 2020, 01:45 UTC
- Message-ID
- <xmqq1rklrhle.fsf@gitster.c.googlers.com>
- In-Reply-To
- <xmqqh7tjv6hb.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 8 quoted lines
>> Which other refs that aren't really refs should also be supported? The
>> JGit source code suggests that MERGE_HEAD should also be special
>> cased?
>
> I'd think all .git/${SOMETHING}_HEAD are of transitory nature that
> can be left as simple on-disk files that are read (and preferrably
> written---except for FETCH_HEAD for obvious reasons) as if they are
> loose refs handled by files backend.Sorry for flipping and flopping. The above goes directly against the spirit of 09743417 (Modify pseudo refs through ref backend storage, 2020-07-27). I still think .git/${SOMETHING}_HEAD except for FETCH_HEAD should be written and read via the ref subsystem, but I was wrong to say that it should always be done via the files backend. There is no reason to insist on the use of files backend here.
Show 5 quoted lines
> It probably makes sense not to > even write reflog entries for them---it is not like the MERGE_HEAD > I see now in .git/ directory is an updated version of MERGE_HEAD I > had there yesterday. "git log -g MERGE_HEAD" gives no interesting > information.
This still is true, but that is pretty much orthogonal to which backend is used.
Show 11 quoted lines
> If the octopus merge does not finish correctly (e.g. due to > conflicts), with "git reset --hard", we can recover to the original > state and re-attempt the opeation with "git merge FETCH_HEAD". Such > a merge using FETCH_HEAD will produce an octopus merge. > > Which means that at least "git merge", FETCH_HEAD is not just a > regular ref where you can ask what object it points at and it gives > you a single object name back. > > But to other commands like "git log master..FETCH_HEAD", it acts as > if there is only one object recorded.
All of which means FETCH_HEAD is special and we may not want to burden the special casing of it to newer backends.