diff mbox series

[3/5] refs.h: HEAD is not that special

Message ID 20231215203245.3622299-4-gitster@pobox.com (mailing list archive)
State Accepted
Commit 7122f4f7479c59da4230a1a3a129fc618cb01eee
Headers show
Series make room for "special ref" | expand

Commit Message

Junio C Hamano Dec. 15, 2023, 8:32 p.m. UTC
In-code comment explains pseudorefs but used a wrong nomenclature
"special ref".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 refs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Koppe Dec. 16, 2023, 10:03 a.m. UTC | #1
On 15/12/2023 20:32, Junio C Hamano wrote:
> In-code comment explains pseudorefs but used a wrong nomenclature
> "special ref".
> 
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>   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

gitglossary thinks that HEAD is not a pseudoref:

"Pseudorefs are a class of files under $GIT_DIR which behave like refs 
for the purposes of rev-parse, but which are treated specially by git. 
Pseudorefs both have names that are all-caps, and always start with a 
line consisting of a SHA‐1 followed by whitespace. So, HEAD is not a 
pseudoref, because it is sometimes a symbolic ref."

(Also, the "sometimes" there actually is "whenever you're on a branch", 
which is most of the time for most people.)

Regards,
Andy
diff mbox series

Patch

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