summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-04-03 09:34:53 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-04-03 09:34:54 -0700
commit1b7b22bfd0fb1fe62cf9d40e2b1de031cc48771d (patch)
treefe0c000ccf0b96163780404babd29ccbaf69d09e /Documentation
parentMerge branch 'jc/t5516-pushInsteadOf-vs-pushURL' (diff)
parentpeel_onion(): teach $foo^{object} peeler (diff)
downloadtgif-1b7b22bfd0fb1fe62cf9d40e2b1de031cc48771d.tar.xz
Merge branch 'jc/sha1-name-object-peeler'
There was no good way to ask "I have a random string that came from outside world. I want to turn it into a 40-hex object name while making sure such an object exists". A new peeling suffix ^{object} can be used for that purpose, together with "rev-parse --verify". * jc/sha1-name-object-peeler: peel_onion(): teach $foo^{object} peeler peel_onion: disambiguate to favor tree-ish when we know we want a tree-ish
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/revisions.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index 314e25da73..1707d451b6 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -116,6 +116,11 @@ some output processing may assume ref names in UTF-8.
object of that type is found or the object cannot be
dereferenced anymore (in which case, barf). '<rev>{caret}0'
is a short-hand for '<rev>{caret}\{commit\}'.
++
+'rev{caret}\{object\}' can be used to make sure 'rev' names an
+object that exists, without requiring 'rev' to be a tag, and
+without dereferencing 'rev'; because a tag is already an object,
+it does not have to be dereferenced even once to get to an object.
'<rev>{caret}\{\}', e.g. 'v0.99.8{caret}\{\}'::
A suffix '{caret}' followed by an empty brace pair