git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Andy Koppe <andy.koppe@gmail.com>
Date
Dec 16, 2023, 10:03 UTC
Message-ID
<1bcd61c3-567f-4b3d-aaee-d29a6091a28d@gmail.com>
In-Reply-To
<20231215203245.3622299-4-gitster@pobox.com>
On 15/12/2023 20:32, Junio C Hamano wrote:
Show 21 quoted lines
> 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

Previous: Junio C HamanoNext: Junio C Hamano
Message 15 of 26 in “make room for "special ref"”
  1. 0/5 make room for "special ref"Junio C Hamano, Dec 15, 2023
  2. 2/5 git-bisect.txt: BISECT_HEAD is not that specialJunio C Hamano, Dec 15, 2023
  3. 1/5 git.txt: HEAD is not that specialJunio C Hamano, Dec 15, 2023
  4. Ramsay JonesDec 15, 2023
  5. Junio C HamanoDec 15, 2023
  6. Junio C HamanoDec 15, 2023
  7. doc: format.notes specify a ref under refs/notes/ hierarchyJunio C Hamano, Dec 15, 2023
  8. Patrick SteinhardtDec 18, 2023
  9. Junio C HamanoDec 18, 2023
  10. Jiang XinDec 19, 2023
  11. Ramsay JonesDec 15, 2023
  12. Patrick SteinhardtDec 18, 2023
  13. Junio C HamanoDec 18, 2023
  14. 3/5 refs.h: HEAD is not that specialJunio C Hamano, Dec 15, 2023
  15. Andy KoppeDec 16, 2023
  16. 4/5 docs: AUTO_MERGE is not that specialJunio C Hamano, Dec 15, 2023
  17. 5/5 docs: MERGE_AUTOSTASH is not that specialJunio C Hamano, Dec 15, 2023
  18. Andy KoppeDec 16, 2023
  19. Junio C HamanoDec 15, 2023
  20. Ramsay JonesDec 15, 2023
  21. Junio C HamanoDec 16, 2023
  22. Patrick SteinhardtDec 18, 2023
  23. Andy KoppeDec 16, 2023
  24. Patrick SteinhardtDec 18, 2023
  25. Andy KoppeDec 16, 2023
  26. Patrick SteinhardtDec 18, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.