Skip to content

Commit 2036cb9

Browse files
dturner-twgitster
authored andcommitted
refs: introduce pseudoref and per-worktree ref concepts
Add glossary entries for both concepts. Pseudorefs and per-worktree refs do not yet have special handling, because the files refs backend already handles them correctly. Later, we will make the LMDB backend call out to the files backend to handle per-worktree refs. Signed-off-by: David Turner <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 89dea97 commit 2036cb9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Documentation/glossary-content.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,27 @@ exclude;;
411411
core Git. Porcelains expose more of a <<def_SCM,SCM>>
412412
interface than the <<def_plumbing,plumbing>>.
413413

414+
[[def_per_worktree_ref]]per-worktree ref::
415+
Refs that are per-<<def_working_tree,worktree>>, rather than
416+
global. This is presently only <<def_HEAD,HEAD>>, but might
417+
later include other unusual refs.
418+
419+
[[def_pseudoref]]pseudoref::
420+
Pseudorefs are a class of files under `$GIT_DIR` which behave
421+
like refs for the purposes of rev-parse, but which are treated
422+
specially by git. Pseudorefs both have names that are all-caps,
423+
and always start with a line consisting of a
424+
<<def_SHA1,SHA-1>> followed by whitespace. So, HEAD is not a
425+
pseudoref, because it is sometimes a symbolic ref. They might
426+
optionally contain some additional data. `MERGE_HEAD` and
427+
`CHERRY_PICK_HEAD` are examples. Unlike
428+
<<def_per_worktree_ref,per-worktree refs>>, these files cannot
429+
be symbolic refs, and never have reflogs. They also cannot be
430+
updated through the normal ref update machinery. Instead,
431+
they are updated by directly writing to the files. However,
432+
they can be read as if they were refs, so `git rev-parse
433+
MERGE_HEAD` will work.
434+
414435
[[def_pull]]pull::
415436
Pulling a <<def_branch,branch>> means to <<def_fetch,fetch>> it and
416437
<<def_merge,merge>> it. See also linkgit:git-pull[1].

0 commit comments

Comments
 (0)