[PATCH 4/5] refs: stop calling root refs pseudorefs
- From
Andy Koppe <andy.koppe@gmail.com>
- Date
- Oct 22, 2026, 21:28 UTC
- Message-ID
- <20261022212903.177261-5-andy.koppe@gmail.com>
- In-Reply-To
- <20261022212903.177261-1-andy.koppe@gmail.com>
Some messages and comments in the code still use "pseudoref" in its old sense of any ref outside of "refs/", whereas the glossary now calls those root refs and restricts pseudorefs to FETCH_HEAD and MERGE_HEAD.
Replace "pseudoref" with "root ref" in the help text for "git for-each-ref --include-root-refs", in comments in refs.h, and in comments in the bash completion script, including the one for __git_pseudoref_exists(), which is also used for root refs. The function itself is not renamed. There is no obvious term covering both root refs and pseudorefs, and the old name might need to be kept for third-party completion scripts.
Update the description of pseudorefs in refs.h to match the glossary.
Signed-off-by: Andy Koppe <andy.koppe@gmail.com> --- builtin/for-each-ref.c | 2 +- contrib/completion/git-completion.bash | 7 ++++--- refs.h | 13 ++++++------- revision.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-)
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(), }; diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index c3a49e2e22..e12ac0359c 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -147,8 +147,9 @@ __git_eread () test -r "$1" && IFS=$'\r\n' read -r "$2" <"$1" } -# Runs git in $__git_repo_path to determine whether a pseudoref exists. -# 1: The pseudo-ref to search +# Runs git in $__git_repo_path to determine whether a root ref or +# pseudoref exists. +# 1: The ref to check __git_pseudoref_exists () { local ref=$1 @@ -954,7 +955,7 @@ __git_refs () esac } -# Completes refs, short and long, local and remote, symbolic and pseudo. +# Completes refs, short and long, local and remote, symbolic, root and pseudo. # # Usage: __git_complete_refs [<option>]... # --remote=<remote>: The remote to list refs from, can be the name of a diff --git a/refs.h b/refs.h index ee3b8a62ef..3be7ef3b0e 100644 --- a/refs.h +++ b/refs.h @@ -85,7 +85,7 @@ enum ref_transaction_error { * Even with RESOLVE_REF_ALLOW_BAD_NAME, names that escape the refs/ * directory and do not consist of all caps and underscores cannot be * resolved. The function returns NULL for such ref names. - * Caps and underscores refers to the pseudorefs, such as HEAD, + * Caps and underscores refers to root refs and pseudorefs, such as HEAD, * FETCH_HEAD and friends, that all live outside of the refs/ directory. */ #define RESOLVE_REF_READING 0x01 @@ -448,8 +448,8 @@ enum refs_for_each_flag { REFS_FOR_EACH_OMIT_DANGLING_SYMREFS = (1 << 2), /* - * Include root refs i.e. HEAD and pseudorefs along with the regular - * refs. + * Include root refs, such as HEAD and ORIG_HEAD, along with the + * regular refs. */ REFS_FOR_EACH_INCLUDE_ROOT_REFS = (1 << 3), }; @@ -1306,10 +1306,9 @@ void update_ref_namespace(enum ref_namespace namespace, char *ref); int is_root_ref(const char *refname); /* - * Pseudorefs are refs that have different semantics compared to - * "normal" refs. These refs can thus not be stored in the ref backend, - * but must always be accessed via the filesystem. The following refs - * are pseudorefs: + * Pseudorefs are names that can be used like refs, but have different + * semantics. They cannot be stored in the ref backend, but must always + * be accessed via the filesystem. The following are pseudorefs: * * - FETCH_HEAD may contain multiple object IDs, and each one of them * carries additional metadata like where it came from. diff --git a/revision.c b/revision.c index a83e499047..d6dd56faf1 100644 --- a/revision.c +++ b/revision.c @@ -2000,7 +2000,7 @@ static const char *lookup_other_head(struct object_id *oid) return other_head[i]; } - 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")); } static void prepare_show_merge(struct rev_info *revs)
-- 2.56.0