diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-11-23 12:02:11 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-23 12:02:11 -0800 |
commit | 60c374e55f9e2b2da4b8ad8296321c8b3ad06aa0 (patch) | |
tree | 59f3090b800f51c7a4911c00e26ac06d215d91f2 /git-rev-parse.html | |
parent | b7676d5ada0941ade7ac9acb8ce985686b62b2ab (diff) | |
download | git-htmldocs-60c374e55f9e2b2da4b8ad8296321c8b3ad06aa0.tar.gz |
Autogenerated HTML docs for v2.29.2-366-gb291b0
Diffstat (limited to 'git-rev-parse.html')
-rw-r--r-- | git-rev-parse.html | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/git-rev-parse.html b/git-rev-parse.html index be1a22968..443db9377 100644 --- a/git-rev-parse.html +++ b/git-rev-parse.html @@ -915,6 +915,9 @@ 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>
+<div class="paragraph"><p>Note that if you are verifying a name from an untrusted source, it is
+wise to use <code>--end-of-options</code> so that the name argument is not mistaken
+for another option.</p></div>
</dd>
<dt class="hdlist1">
-q
@@ -1994,7 +1997,7 @@ 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^{commit}</code></pre>
+<pre><code>$ git rev-parse --verify --end-of-options $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>
@@ -2004,7 +2007,7 @@ Similar to above: </p>
<div class="listingblock">
<div class="content">
-<pre><code>$ git rev-parse --default master --verify $REV</code></pre>
+<pre><code>$ git rev-parse --default master --verify --end-of-options $REV</code></pre>
</div></div>
<div class="paragraph"><p>but if $REV is empty, the commit object name from master will be printed.</p></div>
</li>
@@ -2022,7 +2025,7 @@ Similar to above: <div id="footer">
<div id="footer-text">
Last updated
- 2020-03-10 08:03:13 PDT
+ 2020-11-23 11:57:47 PST
</div>
</div>
</body>
|