summaryrefslogtreecommitdiffstats
path: root/git-rev-parse.html
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-05 15:14:36 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-05 15:14:36 -0700
commitedf80bdff8acc2ba55267b047475925e8ee8c486 (patch)
treed36ba64c2487235e1fdcfcef9284b717865cb106 /git-rev-parse.html
parenta6c69e1da8b9a61b59f7f26a8c24db11fb239e13 (diff)
downloadgit-htmldocs-edf80bdff8acc2ba55267b047475925e8ee8c486.tar.gz
Autogenerated HTML docs for v1.8.2-470-g21cce
Diffstat (limited to 'git-rev-parse.html')
-rw-r--r--git-rev-parse.html21
1 files changed, 15 insertions, 6 deletions
diff --git a/git-rev-parse.html b/git-rev-parse.html
index 3afd8ed7f..cf5e7974e 100644
--- a/git-rev-parse.html
+++ b/git-rev-parse.html
@@ -851,9 +851,18 @@ distinguish between them.</p></div>
</dt>
<dd>
<p>
- The parameter given must be usable as a single, valid
- object name. Otherwise barf and abort.
-</p>
+ Verify that exactly one parameter is provided, and that it
+ can be turned into a raw 20-byte SHA-1 that can be used to
+ access the object database. If so, emit it to the standard
+ output; otherwise, error out.
+</p>
+<div class="paragraph"><p>If you want to make sure that the output actually names an object in
+your object database and/or can be used as a specific type of object
+For example, <code>git rev-parse "$VAR^{commit}"</code> will make sure <code>$VAR</code>
+names an existing object that is a commit-ish (i.e. a commit, or an
+annotated tag that points at a commit). To make sure that <code>$VAR</code>
+names an existing object of any type, <code>git rev-parse "$VAR^{object}"</code>
+can be used.</p></div>
</dd>
<dt class="hdlist1">
-q
@@ -1658,13 +1667,13 @@ Print the commit object name from the revision in the $REV shell variable:
</p>
<div class="listingblock">
<div class="content">
-<pre><code>$ git rev-parse --verify $REV</code></pre>
+<pre><code>$ git rev-parse --verify $REV^{commit}</code></pre>
</div></div>
<div class="paragraph"><p>This will error out if $REV is empty or not a valid revision.</p></div>
</li>
<li>
<p>
-Same as above:
+Similar to above:
</p>
<div class="listingblock">
<div class="content">
@@ -1685,7 +1694,7 @@ Same as above:
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2013-02-05 21:07:26 PST
+Last updated 2013-04-05 15:13:57 PDT
</div>
</div>
</body>