From d9a4bb3385329c391096fce51fa0dedce838fc8b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 15 Dec 2023 12:32:41 -0800 Subject: git.txt: HEAD is not that special The introductory text in "git help git" that describes HEAD called it "a special ref". It is special compared to the more regular refs like refs/heads/master and refs/tags/v1.0.0, but not that special, unlike truly special ones like FETCH_HEAD. Rewrite a few sentences to also introduce the distinction between a regular ref that contain the object name and a symbolic ref that contain the name of another ref. Update the description of HEAD that point at the current branch to use the more correct term, a "symbolic ref". This was found as part of auditing the documentation and in-code comments for uses of "special ref" that refer merely a "pseudo ref". Signed-off-by: Junio C Hamano --- Documentation/git.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/git.txt b/Documentation/git.txt index 2535a30194..e27e9f8bfb 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -1025,10 +1025,11 @@ When first created, objects are stored in individual files, but for efficiency may later be compressed together into "pack files". Named pointers called refs mark interesting points in history. A ref -may contain the SHA-1 name of an object or the name of another ref. Refs -with names beginning `ref/head/` contain the SHA-1 name of the most +may contain the SHA-1 name of an object or the name of another ref (the +latter is called a "symbolic ref"). +Refs with names beginning `refs/head/` contain the SHA-1 name of the most recent commit (or "head") of a branch under development. SHA-1 names of -tags of interest are stored under `ref/tags/`. A special ref named +tags of interest are stored under `refs/tags/`. A symbolic ref named `HEAD` contains the name of the currently checked-out branch. The index file is initialized with a list of all paths and, for each -- cgit 1.2.3-korg From 2047b2c28cb456f60b6e6876e1fc0330e436fad5 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 15 Dec 2023 12:32:42 -0800 Subject: git-bisect.txt: BISECT_HEAD is not that special The description of "git bisect --no-checkout" called BISECT_HEAD a "special ref", but there is nothing special about it. It merely is yet another pseudoref. Signed-off-by: Junio C Hamano --- Documentation/git-bisect.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt index 191b4a42b6..aa02e46224 100644 --- a/Documentation/git-bisect.txt +++ b/Documentation/git-bisect.txt @@ -362,7 +362,7 @@ OPTIONS --no-checkout:: + Do not checkout the new working tree at each iteration of the bisection -process. Instead just update a special reference named `BISECT_HEAD` to make +process. Instead just update the reference named `BISECT_HEAD` to make it point to the commit that should be tested. + This option may be useful when the test you would perform in each step -- cgit 1.2.3-korg From 7122f4f7479c59da4230a1a3a129fc618cb01eee Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 15 Dec 2023 12:32:43 -0800 Subject: refs.h: HEAD is not that special In-code comment explains pseudorefs but used a wrong nomenclature "special ref". Signed-off-by: Junio C Hamano --- refs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.h b/refs.h index 23211a5ea1..ff113bb12a 100644 --- a/refs.h +++ b/refs.h @@ -56,7 +56,7 @@ struct worktree; * 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 special refs, such as HEAD, + * Caps and underscores refers to the pseudorefs, such as HEAD, * FETCH_HEAD and friends, that all live outside of the refs/ directory. */ #define RESOLVE_REF_READING 0x01 -- cgit 1.2.3-korg From dada38646ade5041948bbe49ec21e0f2ad674109 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 15 Dec 2023 12:32:44 -0800 Subject: docs: AUTO_MERGE is not that special A handful of manual pages called AUTO_MERGE a "special ref", but there is nothing special about it. It merely is yet another pseudoref. Signed-off-by: Junio C Hamano --- Documentation/git-diff.txt | 2 +- Documentation/git-merge.txt | 2 +- Documentation/user-manual.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/git-diff.txt b/Documentation/git-diff.txt index 08087ffad5..c065f023ec 100644 --- a/Documentation/git-diff.txt +++ b/Documentation/git-diff.txt @@ -103,7 +103,7 @@ Just in case you are doing something exotic, it should be noted that all of the in the above description, except in the `--merge-base` case and in the last two forms that use `..` notations, can be any . A tree of interest is the one pointed to -by the special ref `AUTO_MERGE`, which is written by the 'ort' merge +by the ref named `AUTO_MERGE`, which is written by the 'ort' merge strategy upon hitting merge conflicts (see linkgit:git-merge[1]). Comparing the working tree with `AUTO_MERGE` shows changes you've made so far to resolve textual conflicts (see the examples below). diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index e8ab340319..3e9557a44b 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -196,7 +196,7 @@ happens: can inspect the stages with `git ls-files -u`). The working tree files contain the result of the merge operation; i.e. 3-way merge results with familiar conflict markers `<<<` `===` `>>>`. -5. A special ref `AUTO_MERGE` is written, pointing to a tree +5. A ref named `AUTO_MERGE` is written, pointing to a tree corresponding to the current content of the working tree (including conflict markers for textual conflicts). Note that this ref is only written when the 'ort' merge strategy is used (the default). diff --git a/Documentation/user-manual.txt b/Documentation/user-manual.txt index d8dbe6b56d..5d32ff2384 100644 --- a/Documentation/user-manual.txt +++ b/Documentation/user-manual.txt @@ -1344,7 +1344,7 @@ $ git diff --theirs file.txt # same as the above. ------------------------------------------------- When using the 'ort' merge strategy (the default), before updating the working -tree with the result of the merge, Git writes a special ref named AUTO_MERGE +tree with the result of the merge, Git writes a ref named AUTO_MERGE reflecting the state of the tree it is about to write. Conflicted paths with textual conflicts that could not be automatically merged are written to this tree with conflict markers, just as in the working tree. AUTO_MERGE can thus be -- cgit 1.2.3-korg From bc62d27d5c2379505436cb8968c153c8b3a25d39 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 15 Dec 2023 12:32:45 -0800 Subject: docs: MERGE_AUTOSTASH is not that special A handful of manual pages called MERGE_AUTOSTASH a "special ref", but there is nothing special about it. It merely is yet another pseudoref. Signed-off-by: Junio C Hamano --- Documentation/merge-options.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt index d8f7cd7ca0..3eaefc4e94 100644 --- a/Documentation/merge-options.txt +++ b/Documentation/merge-options.txt @@ -191,7 +191,7 @@ endif::git-pull[] --autostash:: --no-autostash:: Automatically create a temporary stash entry before the operation - begins, record it in the special ref `MERGE_AUTOSTASH` + begins, record it in the ref `MERGE_AUTOSTASH` and apply it after the operation ends. This means that you can run the operation on a dirty worktree. However, use with care: the final stash application after a successful -- cgit 1.2.3-korg