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

[PATCH] Document git-show-ref [-s|--hash] option.

From
Christian Couder <chriscool@tuxfamily.org>
Date
Sep 20, 2006, 04:14 UTC
Message-ID
<20060920061454.8fc28c1f.chriscool@tuxfamily.org>
In-Reply-To
<20060918123241.GA8238@diku.dk>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 Documentation/git-show-ref.txt |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt
index 529ea17..b724d83 100644
--- a/Documentation/git-show-ref.txt
+++ b/Documentation/git-show-ref.txt
@@ -9,7 +9,7 @@ SYNOPSIS
 --------
 [verse]
 'git-show-ref' [-q|--quiet] [--verify] [-h|--head] [-d|--dereference]
-	     [--tags] [--heads] [--] <pattern>...
+	     [-s|--hash] [--tags] [--heads] [--] <pattern>...
 
 DESCRIPTION
 -----------
@@ -40,6 +40,12 @@ OPTIONS
 	Dereference tags into object IDs. They will be shown with "^{}"
 	appended.
 
+-s, --hash::
+
+	Only show the SHA1 hash, not the reference name. When also using
+	--dereference the dereferenced tag will still be shown after the SHA1,
+	this maybe a bug.
+
 --verify::
 
 	Enable stricter reference checking by requiring an exact ref path.
@@ -72,6 +78,16 @@ The output is in the format: '<SHA-1 ID>
 ...
 -----------------------------------------------------------------------------
 
+When using --hash (and not --dereference) the output format is: '<SHA-1 ID>'
+
+-----------------------------------------------------------------------------
+$ git show-ref --heads --hash
+2e3ba0114a1f52b47df29743d6915d056be13278
+185008ae97960c8d551adcd9e23565194651b5d1
+03adf42c988195b50e1a1935ba5fcbc39b2b029b
+...
+-----------------------------------------------------------------------------
+
 EXAMPLE
 -------
 
-- 
1.4.2.1.g4251-dirty
Previous: Jonas Fonseca
Message 2 of 2 in “Add man page for git-show-ref”
  1. Add man page for git-show-refJonas Fonseca, Sep 18, 2006
  2. Document git-show-ref [-s|--hash] option.Christian Couder, Sep 20, 2006

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.