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

Re: [PATCH 2/4] glossary: define committish (a.k.a. commit-ish)

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 20, 2013, 10:55 UTC
Message-ID
<CALkWK0nqOSmFaYhbW3anmBvgy2=DZs7qU0kz7=eEO5R99uLAqQ@mail.gmail.com>
In-Reply-To
<51C2409F.1070801@bbn.com>
Richard Hansen wrote:
>   * Aren't HEAD, FETCH_HEAD, ORIG_HEAD also refs?

HEAD is a symbolic ref [*1*], FETCH_HEAD is not a ref [*2*], and ORIG_HEAD is a ref.

>     ref
>         A binding of a name to an object or other ref (in which case it
>         is a symref).  Refs are stored in the repository.

What is "binding of a name"? It's a file that contains exactly one line: a 40-character SHA-1 hex. End of story. Like I explained in [*1*], I see no advantage in grouping symbolic refs with refs.

>         The ref namespace is hierarchical.  Different subhierarchies
>         are used for different purposes (e.g. the refs/heads/ hierarchy
>         is used to represent local branches).
Good.
[Footnotes]

*1*: HEAD is the one and only symbolic ref, unless you create more by hand using `git symbolic-ref`. Unfortunately, no other symbolic ref can ever be on the same footing as HEAD: the sources hard-code "HEAD" in a large number of places, and reworking it to truly support symbolic refs is probably not worth the pain at all. If you want to convince yourself that this is true, run `git symbolic-ref H HEAD` and then try to resolve H@{u}: HEAD@{u} resolves fine, doesn't it?

*2*: It's not an "ordinary file" like COMMIT_EDITMSG either, in that rev-parse can operate on it. It is not a ref because it contains references to several objects; cat it and see for yourself.

Previous: Junio C HamanoNext: Ramkumar Ramachandra
Message 21 of 24 in “documentation cleanups for <rev>^{<type>}”
  1. 0/4 documentation cleanups for <rev>^{<type>}Richard Hansen, Jun 19, 2013
  2. 1/4 glossary: add 'treeish' as a synonym for 'tree-ish'Richard Hansen, Jun 19, 2013
  3. Junio C HamanoJun 19, 2013
  4. Richard HansenJun 19, 2013
  5. Junio C HamanoJun 19, 2013
  6. Richard HansenJun 19, 2013
  7. 2/4 glossary: define committish (a.k.a. commit-ish)Richard Hansen, Jun 19, 2013
  8. Ramkumar RamachandraJun 19, 2013
  9. Richard HansenJun 19, 2013
  10. Ramkumar RamachandraJun 19, 2013
  11. Richard HansenJun 19, 2013
  12. Richard HansenJun 19, 2013
  13. Jonathan NiederJun 19, 2013
  14. Junio C HamanoJun 19, 2013
  15. Richard HansenJun 19, 2013
  16. Junio C HamanoJun 19, 2013
  17. Richard HansenJun 19, 2013
  18. Junio C HamanoJun 19, 2013
  19. Richard HansenJun 19, 2013
  20. Junio C HamanoJun 20, 2013
  21. Ramkumar RamachandraJun 20, 2013
  22. Ramkumar RamachandraJun 20, 2013
  23. 3/4 glossary: more precise definition of tree-ish (a.k.a. treeish)Richard Hansen, Jun 19, 2013
  24. 4/4 revisions.txt: fix and clarify <rev>^{<type>}Richard Hansen, Jun 19, 2013

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.