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
Junio C Hamano <gitster@pobox.com>
Date
Jun 19, 2013, 17:14 UTC
Message-ID
<7vhagu10ql.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1371607780-2966-3-git-send-email-rhansen@bbn.com>
Richard Hansen <rhansen@bbn.com> writes:
Show 24 quoted lines
> Signed-off-by: Richard Hansen <rhansen@bbn.com>
> ---
>  Documentation/glossary-content.txt | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/Documentation/glossary-content.txt b/Documentation/glossary-content.txt
> index 01365d9..a3cc003 100644
> --- a/Documentation/glossary-content.txt
> +++ b/Documentation/glossary-content.txt
> @@ -82,6 +82,17 @@ to point at the new commit.
>  	to the top <<def_directory,directory>> of the stored
>  	revision.
>  
> +[[def_committish]]committish (also commit-ish)::
> +	A <<def_ref,ref>> pointing to an <<def_object,object>> that
> +	can be recursively dereferenced to a
> +	<<def_commit_object,commit object>>.
> +	The following are all committishes:
> +	a ref pointing to a commit object,
> +	a ref pointing to a <<def_tag_object,tag object>> that points
> +	to a commit object,
> +	a ref pointing to a tag object that points to a tag object
> +	that points to a commit object, etc.
> +

<object-type>-ish does not have anything to do with a ref. Even when an object is dangling in your object store without being reachable from any of your refs, it keeps its own "ish"-ness.

"ish"-ness is a property of the object itself.
 * A commit object has a single top-level tree, and when a command
   wants a tree object, you can often pass it a commit (historically
   some commands were more strict and refused to work on a commit
   when they wanted a tree).  In other words, a commit can be used
   in place for a tree.  A commit object is a tree-ish.
 * A tag object, when it points (recursively) at a commit object,
   can often be used in place for a commit object.  Such a tag
   object is a commit-ish.
 * A tag object, when it points (recursively) at a tree object, can
   often be used in place for a tree object.  Such a tag object is a
   tree-ish.  Note that such a tag object cannot be a commit-ish.
Previous: Jonathan NiederNext: Richard Hansen
Message 14 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.