Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Andy Koppe <andy.koppe@gmail.com>
Cc: git@vger.kernel.org,  Patrick Steinhardt <ps@pks.im>,
	 Karthik Nayak <karthik.188@gmail.com>,
	 Julia Evans <julia@jvns.ca>
Subject: Re: [PATCH v3 4/5] refs: stop calling root refs pseudorefs
Date: Fri, 06 Nov 2026 15:16:31 -0800	[thread overview]
Message-ID: <xmqqmrrlczzk.fsf@gitster.g> (raw)
In-Reply-To: <2c3f3ab1951cad3771f5856ed8146286bfb0f5db.1794000450.git.andy.koppe@gmail.com> (Andy Koppe's message of "Fri, 6 Nov 2026 21:31:07 +0000")

Andy Koppe <andy.koppe@gmail.com> writes:

> diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
> index 4a2fc421db..6ff32e919c 100644
> --- a/builtin/for-each-ref.c
> +++ b/builtin/for-each-ref.c
> @@ -48,7 +48,7 @@ int for_each_ref_core(int argc, const char **argv, const char *prefix, struct re
>  		OPT_NO_CONTAINS(&filter.no_commit, N_("print only refs which don't contain the commit")),
>  		OPT_BOOL(0, "ignore-case", &icase, N_("sorting and filtering are case insensitive")),
>  		OPT_BOOL(0, "stdin", &from_stdin, N_("read reference patterns from stdin")),
> -		OPT_BOOL(0, "include-root-refs", &include_root_refs, N_("also include HEAD ref and pseudorefs")),
> +		OPT_BOOL(0, "include-root-refs", &include_root_refs, N_("also include root refs")),
>  		OPT_END(),

Correct.  Not just HEAD, but all root refs are included, e.g., ORIG_HEAD.

> -	die(_("--merge requires one of the pseudorefs MERGE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD or REBASE_HEAD"));
> +	die(_("--merge requires one of MERGE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD or REBASE_HEAD"));

If we do not want to think deeply only on this one, just stop after
replacing pseudoref with root ref, but do not drop pseudoref and be
content.  Otherwise you would end up confusing users this way:

    let's see the --merge option I read recently about.

        $ git log --merge
        fatal: --merge requires one of MERGE_HEAD, ...

    oh, do I have to give one of these?

        $ git log --merge MERGE_HEAD
        fatal: ambiguous argument 'MERGE_HEAD': unknown revision or ...

    puzzled. why doesn't it work?

It might work to say "one of root refs to exist (e.g., MERGE_HEAD,
...)", or give it a more operational message, like this:

    --merge works only in the middle of a merge, rebase, etc.

THanks.

  reply	other threads:[~2026-11-06 23:16 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 21:28 [PATCH 0/5] root refs vs pseudorefs Andy Koppe
2026-10-22 21:28 ` [PATCH 1/5] doc: glossary: add root ref and clarify pseudorefs Andy Koppe
2026-10-22 22:07   ` Junio C Hamano
2026-10-23  7:41   ` Patrick Steinhardt
2026-11-01 23:18     ` Andy Koppe
2026-10-22 21:28 ` [PATCH 2/5] doc: glossary: update per-worktree refs Andy Koppe
2026-10-23  7:41   ` Patrick Steinhardt
2026-11-01 23:26     ` Andy Koppe
2026-10-22 21:28 ` [PATCH 3/5] doc: stop calling root refs pseudorefs Andy Koppe
2026-10-23  7:41   ` Patrick Steinhardt
2026-11-01 23:44     ` Andy Koppe
2026-10-22 21:28 ` [PATCH 4/5] refs: " Andy Koppe
2026-10-23  7:41   ` Patrick Steinhardt
2026-11-01 23:46     ` Andy Koppe
2026-10-22 21:28 ` [PATCH 5/5] t: " Andy Koppe
2026-10-22 22:18 ` [PATCH 0/5] root refs vs pseudorefs Junio C Hamano
2026-10-23 13:21 ` Julia Evans
2026-11-01 23:07   ` Andy Koppe
2026-11-01 23:03 ` [PATCH v2 " Andy Koppe
2026-11-02 18:19   ` Julia Evans
2026-11-02 19:47     ` Andy Koppe
2026-11-02 21:00       ` Julia Evans
2026-11-02 22:19         ` Andy Koppe
2026-11-03 14:36           ` Julia Evans
2026-11-06 22:02             ` Andy Koppe
2026-11-02 21:49     ` Junio C Hamano
2026-11-01 23:03 ` [PATCH v2 1/5] doc: glossary: add root ref and clarify pseudorefs Andy Koppe
2026-11-03 11:29   ` Patrick Steinhardt
2026-11-03 18:30     ` Junio C Hamano
2026-11-01 23:03 ` [PATCH v2 2/5] doc: glossary: update per-worktree refs Andy Koppe
2026-11-03 11:29   ` Patrick Steinhardt
2026-11-01 23:03 ` [PATCH v2 3/5] doc: stop calling root refs pseudorefs Andy Koppe
2026-11-03 11:30   ` Patrick Steinhardt
2026-11-01 23:03 ` [PATCH v2 4/5] refs: " Andy Koppe
2026-11-01 23:03 ` [PATCH v2 5/5] t: " Andy Koppe
2026-11-06 21:31 ` [PATCH v3 0/5] root refs vs pseudorefs Andy Koppe
2026-11-06 21:31   ` [PATCH v3 1/5] doc: glossary: add root ref and clarify pseudorefs Andy Koppe
2026-11-06 22:13     ` Junio C Hamano
2026-11-06 21:31   ` [PATCH v3 2/5] doc: glossary: update per-worktree refs Andy Koppe
2026-11-06 22:16     ` Junio C Hamano
2026-11-06 21:31   ` [PATCH v3 3/5] doc: stop calling root refs pseudorefs Andy Koppe
2026-11-06 23:08     ` Junio C Hamano
2026-11-06 21:31   ` [PATCH v3 4/5] refs: " Andy Koppe
2026-11-06 23:16     ` Junio C Hamano [this message]
2026-11-06 21:31   ` [PATCH v3 5/5] t: " Andy Koppe

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=xmqqmrrlczzk.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=andy.koppe@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=julia@jvns.ca \
    --cc=karthik.188@gmail.com \
    --cc=ps@pks.im \
    /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