summaryrefslogtreecommitdiffstats
path: root/git-rev-parse.html
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2008-05-22 00:53:35 +0000
committerJunio C Hamano <junio@hera.kernel.org>2008-05-22 00:53:35 +0000
commitfeeb1be0ecb7af3956ed418f425ffd6c10bd2d9e (patch)
tree5c21c5ca9b7065c2dee0060f2db81cd58f00baf6 /git-rev-parse.html
parent0f7b5a99cef87c294a3c3591b4990ca4077b0d0a (diff)
downloadgit-htmldocs-feeb1be0ecb7af3956ed418f425ffd6c10bd2d9e.tar.gz
Autogenerated HTML docs for v1.5.5.1-357-g1af8b
Diffstat (limited to 'git-rev-parse.html')
-rw-r--r--git-rev-parse.html36
1 files changed, 35 insertions, 1 deletions
diff --git a/git-rev-parse.html b/git-rev-parse.html
index b3f7a956b..527597bdb 100644
--- a/git-rev-parse.html
+++ b/git-rev-parse.html
@@ -851,6 +851,40 @@ C? option C with an optional argument"
eval `echo "$OPTS_SPEC" | git-rev-parse --parseopt -- "$@" || echo exit $?`</tt></pre>
</div></div>
</div>
+<h2>EXAMPLES</h2>
+<div class="sectionbody">
+<ul>
+<li>
+<p>
+Print the object name of the current commit:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git rev-parse --verify HEAD</tt></pre>
+</div></div>
+</li>
+<li>
+<p>
+Print the commit object name from the revision in the $REV shell variable:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git rev-parse --verify $REV</tt></pre>
+</div></div>
+<p>This will error out if $REV is empty or not a valid revision.</p>
+</li>
+<li>
+<p>
+Same as above:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>$ git rev-parse --default master --verify $REV</tt></pre>
+</div></div>
+<p>but if $REV is empty, the commit object name from master will be printed.</p>
+</li>
+</ul>
+</div>
<h2>Author</h2>
<div class="sectionbody">
<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt; .
@@ -866,7 +900,7 @@ Junio C Hamano &lt;junkio@cox.net&gt; and Pierre Habouzit &lt;madcoder@debian.or
</div>
<div id="footer">
<div id="footer-text">
-Last updated 14-May-2008 22:24:42 UTC
+Last updated 22-May-2008 00:52:47 UTC
</div>
</div>
</body>