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

[PATCH/RFC 06/12] docs: clarify <object>, <commit>, <tree-ish>, etc

From
Mark Lodato <lodatom@gmail.com>
Date
Mar 13, 2010, 04:52 UTC
Message-ID
<1268455984-19061-7-git-send-email-lodatom@gmail.com>
In-Reply-To
<1268455984-19061-1-git-send-email-lodatom@gmail.com>

In git(1), give more precise definitions of <object>, <commit>, <tree-ish>, and so on. In particular, differentiate <object> (which may take generic revision specifiers) from <sha1>, which only accepts a 40-character hex SHA-1 ID.

Also note that <rev> is another way to say <commit-ish>.
Signed-off-by: Mark Lodato <lodatom@gmail.com>
---
 Documentation/git.txt |   38 +++++++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/Documentation/git.txt b/Documentation/git.txt
index f06e4de..55f3842 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -418,32 +418,36 @@ Identifier Terminology
 	Abbreviated or symbolic identifiers cannot be used.
 
 <object>::
-	Indicates the object name for any type of object.
+	Indicates the object name for any type of object.  Symbolic name or
+	abbreviated SHA-1 identifiers may be used (see "SPECIFYING REVISIONS"
+	in linkgit:git-rev-parse[1] for details).
 
 <tag>::
-	Indicates a tag object name.  This is an annotated tag object, as
+	Indicates a tag-type <object>.  This is an annotated tag object, as
 	opposed to <tagname>, which can refer to any type of object.
 
-<blob>::
-	Indicates a blob object name.
+<commit>::
+	Indicates a commit-type <object>.
 
 <tree>::
-	Indicates a tree object name.
-
-<commit>::
-	Indicates a commit object name.
+	Indicates a tree-type <object>.
 
-<tree-ish>::
-	Indicates a tree, commit or tag object name.  A
-	command that takes a <tree-ish> argument ultimately wants to
-	operate on a <tree> object but automatically dereferences
-	<commit> and <tag> objects that point at a <tree>.
+<blob>::
+	Indicates a blob-type <object>.
 
+<rev>::
 <commit-ish>::
-	Indicates a commit or tag object name.  A
-	command that takes a <commit-ish> argument ultimately wants to
-	operate on a <commit> object but automatically dereferences
-	<tag> objects that point at a <commit>.
+	Indicates a <commit>, or a <tag> that points at a <commit-ish>.
+	A command that takes a <commit-ish> argument ultimately wants to
+	operate on a commit object but automatically dereferences objects
+	until it finds a commit.
+	A <rev> is another name for a <commit-ish>.
+
+<tree-ish>::
+	Indicates a <tree>, or a <tag> or <commit> that points at a
+	<tree-ish>.  A command that takes a <tree-ish> argument ultimately
+	wants to operate on a tree object but automatically dereferences
+	objects until it finds a tree.
 
 <type>::
 	Indicates that an object type is required.
-- 
1.7.0.2
Previous: Junio C HamanoNext: Mark Lodato
Message 12 of 20 in “docs: use metavariables consistently”
  1. 00/12 docs: use metavariables consistentlyMark Lodato, Mar 13, 2010
  2. 01/12 commit-tree: allow indirect tree referencesMark Lodato, Mar 13, 2010
  3. Junio C HamanoMar 13, 2010
  4. Mark LodatoMar 16, 2010
  5. 02/12 grep docs: grep accepts a <tree-ish>, not a <tree>Mark Lodato, Mar 13, 2010
  6. Junio C HamanoMar 13, 2010
  7. Mark LodatoMar 16, 2010
  8. 03/12 fsck docs: remove outdated and useless diagnosticMark Lodato, Mar 13, 2010
  9. 04/12 docs: use <sha1> to mean unabbreviated IDMark Lodato, Mar 13, 2010
  10. 05/12 docs: differentiate between <tag> and <tagname>Mark Lodato, Mar 13, 2010
  11. Junio C HamanoMar 13, 2010
  12. 06/12 docs: clarify <object>, <commit>, <tree-ish>, etcMark Lodato, Mar 13, 2010
  13. 07/12 docs: use <tree> instead of <tree-ish>Mark Lodato, Mar 13, 2010
  14. 08/12 http-fetch docs: use <commit-id> consistentlyMark Lodato, Mar 13, 2010
  15. 09/12 docs: use <commit> instead of <commit-ish>Mark Lodato, Mar 13, 2010
  16. Junio C HamanoMar 13, 2010
  17. Mark LodatoMar 16, 2010
  18. 10/12 diff: use brackets for optional args in usageMark Lodato, Mar 13, 2010
  19. 11/12 docs: use ... instead of * for multiplicityMark Lodato, Mar 13, 2010
  20. 12/12 diff docs: remove <rev>{0,2} notationMark Lodato, Mar 13, 2010

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.