git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ramsay Jones <ramsay@ramsayjones.plus.com>
Cc: git@vger.kernel.org,  Patrick Steinhardt <ps@pks.im>
Subject: Re: [PATCH 0/5] make room for "special ref"
Date: Fri, 15 Dec 2023 16:44:47 -0800	[thread overview]
Message-ID: <xmqq7clfj7r4.fsf@gitster.g> (raw)
In-Reply-To: <321b8084-fddb-4b5d-86af-7f88cb3edf7b@ramsayjones.plus.com> (Ramsay Jones's message of "Fri, 15 Dec 2023 22:44:01 +0000")

Ramsay Jones <ramsay@ramsayjones.plus.com> writes:

> Yes, I was going to suggest exactly this, after Patrick pointed out
> that there were only two 'special psuedo-refs' (I had a vague feeling
> there were some more than that) FETCH_HEAD and MERGE_HEAD.

Glad to see that I am not alone.  We should be able to treat
MERGE_HEAD similarly.  It is used to communicate the list of "other
parents" from "git merge" that stops in the middle (either for merge
conflict, or in response to the "--no-commit" command line option)
to "git commit" that concludes such an unfinished merge.  Many
commands merely use the presence of MERGE_HEAD as a sign that a
merge is in progress (e.g. "git status"), which would not break if
we just started to record the first parent in a pseudoref MERGE_HEAD
and wrote the other octopus parents elsewhere, but some commands do
need all these parents from MERGE_HEAD (e.g. "git blame" that
synthesizes a fake starting commit out of the working tree state).

If we cannot get rid of all "special refs" anyway, however, I think
there is little that we can gain from doing such "make FETCH_HEAD
and MERGE_HEAD into a single-object pseudoref, and write other info
in separate files" exercise.  We can treat the current FETCH_HEAD
and MERGE_HEAD as "file that is not and is more than a ref", which
is what the current code is doing anyway, which means we would
declare that they have to stay to be files under $GIT_DIR/ and will
be accessed via the filesystem access.  At that point, calling them
"special ref" might even be more misleading than its worth and we
may be better off to admit that they are not even refs but a
datafile some commands can use to obtain input from, but the phrase
we use to refer to them, be it "special ref" or some random
datafile, does not make a fundamental change on anything.



  reply	other threads:[~2023-12-16  0:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-15 20:32 [PATCH 0/5] make room for "special ref" Junio C Hamano
2023-12-15 20:32 ` [PATCH 1/5] git.txt: HEAD is not that special Junio C Hamano
2023-12-15 21:57   ` Ramsay Jones
2023-12-15 22:06     ` Junio C Hamano
2023-12-15 22:19       ` Junio C Hamano
2023-12-15 22:28         ` [PATCH] doc: format.notes specify a ref under refs/notes/ hierarchy Junio C Hamano
2023-12-18  8:06           ` Patrick Steinhardt
2023-12-18 16:16             ` Junio C Hamano
2023-12-19 15:33               ` Jiang Xin
2023-12-15 22:37         ` [PATCH 1/5] git.txt: HEAD is not that special Ramsay Jones
2023-12-18  8:46   ` Patrick Steinhardt
2023-12-18 16:26     ` Junio C Hamano
2023-12-15 20:32 ` [PATCH 2/5] git-bisect.txt: BISECT_HEAD " Junio C Hamano
2023-12-15 20:32 ` [PATCH 3/5] refs.h: HEAD " Junio C Hamano
2023-12-16 10:03   ` Andy Koppe
2023-12-15 20:32 ` [PATCH 4/5] docs: AUTO_MERGE " Junio C Hamano
2023-12-15 20:32 ` [PATCH 5/5] docs: MERGE_AUTOSTASH " Junio C Hamano
2023-12-16 11:04   ` Andy Koppe
2023-12-15 21:21 ` [PATCH 0/5] make room for "special ref" Junio C Hamano
2023-12-15 22:44   ` Ramsay Jones
2023-12-16  0:44     ` Junio C Hamano [this message]
2023-12-18  8:41       ` Patrick Steinhardt
2023-12-16 10:20     ` Andy Koppe
2023-12-18  8:24       ` Patrick Steinhardt
2023-12-16 10:56 ` Andy Koppe
2023-12-18  8:56 ` Patrick Steinhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq7clfj7r4.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    --cc=ramsay@ramsayjones.plus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).