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.txt | |
parent | b7676d5ada0941ade7ac9acb8ce985686b62b2ab (diff) | |
download | git-htmldocs-60c374e55f9e2b2da4b8ad8296321c8b3ad06aa0.tar.gz |
Autogenerated HTML docs for v2.29.2-366-gb291b0
Diffstat (limited to 'git-rev-parse.txt')
-rw-r--r-- | git-rev-parse.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/git-rev-parse.txt b/git-rev-parse.txt index 19b12b6d4..5013daa6e 100644 --- a/git-rev-parse.txt +++ b/git-rev-parse.txt @@ -109,6 +109,10 @@ 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 `$VAR` names an existing object of any type, `git rev-parse "$VAR^{object}"` can be used. ++ +Note that if you are verifying a name from an untrusted source, it is +wise to use `--end-of-options` so that the name argument is not mistaken +for another option. -q:: --quiet:: @@ -446,7 +450,7 @@ $ git rev-parse --verify HEAD * Print the commit object name from the revision in the $REV shell variable: + ------------ -$ git rev-parse --verify $REV^{commit} +$ git rev-parse --verify --end-of-options $REV^{commit} ------------ + This will error out if $REV is empty or not a valid revision. @@ -454,7 +458,7 @@ This will error out if $REV is empty or not a valid revision. * Similar to above: + ------------ -$ git rev-parse --default master --verify $REV +$ git rev-parse --default master --verify --end-of-options $REV ------------ + but if $REV is empty, the commit object name from master will be printed. |