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

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:50

Richard Hansen [off-list ref] writes:
quoted hunk
Signed-off-by: Richard Hansen <redacted>
---
 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.

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

From: Richard Hansen <hidden>
Date: 2016-06-15 22:57:50

On 2013-06-19 13:14, Junio C Hamano wrote:
<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.
Ah, so your personal definition of "ref" matches my personal definition
of "ref", and this definition doesn't match gitglossary(7).  :)
"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.
I agree with all of this; the issue is the definition of "ref" in
gitglossary(7).  That definition should be fixed.  In the meantime, I'll
rework the patch series to avoid using the word "ref" when defining
committish and tree-ish.

-Richard

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

From: Ramkumar Ramachandra <hidden>
Date: 2016-06-15 22:57:50

Richard Hansen wrote:
In the meantime, I'll
rework the patch series to avoid using the word "ref" when defining
committish and tree-ish.
This is a good way forward.  I'm curious about what you're planning on
substituting it with though: the "extended SHA-1 expression" that
Jonathan hinted at?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help