Skip to content

Commit 74b50a5

Browse files
pks-tgitster
authored andcommitted
Documentation/glossary: define root refs as refs
Except for the pseudorefs MERGE_HEAD and FETCH_HEAD, all refs that live in the root of the ref hierarchy behave the exact same as normal refs. They can be symbolic refs or direct refs and can be read, iterated over and written via normal tooling. All of these refs are stored in the ref backends, which further demonstrates that they are just normal refs. Extend the definition of "ref" to also cover such root refs. The only additional restriction for root refs is that they must conform to a specific naming schema. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 29be36a commit 74b50a5

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

Documentation/glossary-content.txt

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -550,20 +550,38 @@ The following pseudorefs are known to Git:
550550
to the result.
551551

552552
[[def_ref]]ref::
553-
A name that begins with `refs/` (e.g. `refs/heads/master`)
554-
that points to an <<def_object_name,object name>> or another
555-
ref (the latter is called a <<def_symref,symbolic ref>>).
553+
A name that that points to an <<def_object_name,object name>> or
554+
another ref (the latter is called a <<def_symref,symbolic ref>>).
556555
For convenience, a ref can sometimes be abbreviated when used
557556
as an argument to a Git command; see linkgit:gitrevisions[7]
558557
for details.
559558
Refs are stored in the <<def_repository,repository>>.
560559
+
561560
The ref namespace is hierarchical.
562-
Different subhierarchies are used for different purposes (e.g. the
563-
`refs/heads/` hierarchy is used to represent local branches).
561+
Ref names must either start with `refs/` or be located in the root of
562+
the hierarchy. For the latter, their name must follow these rules:
564563
+
565-
There are a few special-purpose refs that do not begin with `refs/`.
566-
The most notable example is `HEAD`.
564+
- The name consists of only upper-case characters or underscores.
565+
566+
- The name ends with "`_HEAD`" or is equal to "`HEAD`".
567+
+
568+
There are some irregular refs in the root of the hierarchy that do not
569+
match these rules. The following list is exhaustive and shall not be
570+
extended in the future:
571+
+
572+
- `AUTO_MERGE`
573+
574+
- `BISECT_EXPECTED_REV`
575+
576+
- `NOTES_MERGE_PARTIAL`
577+
578+
- `NOTES_MERGE_REF`
579+
580+
- `MERGE_AUTOSTASH`
581+
+
582+
Different subhierarchies are used for different purposes. For example,
583+
the `refs/heads/` hierarchy is used to represent local branches whereas
584+
the `refs/tags/` hierarchy is used to represent local tags..
567585

568586
[[def_reflog]]reflog::
569587
A reflog shows the local "history" of a ref. In other words,

0 commit comments

Comments
 (0)