git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Documentation: rev-parse: add a few "--verify" and "--default" examples
@ 2008-05-13  4:51 Christian Couder
  0 siblings, 0 replies; only message in thread
From: Christian Couder @ 2008-05-13  4:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 Documentation/git-rev-parse.txt |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index b6b2fe9..1d10893 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -378,6 +378,31 @@ C?        option C with an optional argument"
 eval `echo "$OPTS_SPEC" | git-rev-parse --parseopt -- "$@" || echo exit $?`
 ------------
 
+EXAMPLES
+--------
+
+* Print the SHA1 object name of the current commit:
++
+------------
+$ git rev-parse --verify HEAD
+------------
+
+* Print the commit SHA1 from the revision in the $REV shell variable:
++
+------------
+$ git rev-parse --verify $REV
+------------
++
+This will error out if $REV is empty or not a valid revision.
+
+* Same as above:
++
+------------
+$ git rev-parse --default master --verify $REV
+------------
++
+but if $REV is empty, the commit SHA1 from master will be printed.
+
 
 Author
 ------
-- 
1.5.5.1.347.g28d6

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-13  4:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-13  4:51 [PATCH] Documentation: rev-parse: add a few "--verify" and "--default" examples Christian Couder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).