Skip to content

Commit 7a188da

Browse files
committed
Merge branch 'dl/rev-tilde-doc-clarify'
Docfix. * dl/rev-tilde-doc-clarify: revisions.txt: remove ambibuity between <rev>:<path> and :<path> revisions.txt: mention <rev>~ form revisions.txt: mark optional rev arguments with [] revisions.txt: change "rev" to "<rev>"
2 parents a505f62 + 4ad1b2c commit 7a188da

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

Documentation/revisions.txt

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ some output processing may assume ref names in UTF-8.
6565
'@'::
6666
'@' alone is a shortcut for `HEAD`.
6767

68-
'<refname>@{<date>}', e.g. 'master@\{yesterday\}', 'HEAD@{5 minutes ago}'::
68+
'[<refname>]@{<date>}', e.g. 'master@\{yesterday\}', 'HEAD@{5 minutes ago}'::
6969
A ref followed by the suffix '@' with a date specification
7070
enclosed in a brace
7171
pair (e.g. '\{yesterday\}', '{1 month 2 weeks 3 days 1 hour 1
@@ -95,15 +95,15 @@ some output processing may assume ref names in UTF-8.
9595
The construct '@{-<n>}' means the <n>th branch/commit checked out
9696
before the current one.
9797

98-
'<branchname>@\{upstream\}', e.g. 'master@\{upstream\}', '@\{u\}'::
98+
'[<branchname>]@\{upstream\}', e.g. 'master@\{upstream\}', '@\{u\}'::
9999
The suffix '@\{upstream\}' to a branchname (short form '<branchname>@\{u\}')
100100
refers to the branch that the branch specified by branchname is set to build on
101101
top of (configured with `branch.<name>.remote` and
102102
`branch.<name>.merge`). A missing branchname defaults to the
103103
current one. These suffixes are also accepted when spelled in uppercase, and
104104
they mean the same thing no matter the case.
105105

106-
'<branchname>@\{push\}', e.g. 'master@\{push\}', '@\{push\}'::
106+
'[<branchname>]@\{push\}', e.g. 'master@\{push\}', '@\{push\}'::
107107
The suffix '@\{push}' reports the branch "where we would push to" if
108108
`git push` were run while `branchname` was checked out (or the current
109109
`HEAD` if no branchname is specified). Since our push destination is
@@ -131,15 +131,17 @@ from one location and push to another. In a non-triangular workflow,
131131
This suffix is also accepted when spelled in uppercase, and means the same
132132
thing no matter the case.
133133

134-
'<rev>{caret}', e.g. 'HEAD{caret}, v1.5.1{caret}0'::
134+
'<rev>{caret}[<n>]', e.g. 'HEAD{caret}, v1.5.1{caret}0'::
135135
A suffix '{caret}' to a revision parameter means the first parent of
136136
that commit object. '{caret}<n>' means the <n>th parent (i.e.
137137
'<rev>{caret}'
138138
is equivalent to '<rev>{caret}1'). As a special rule,
139139
'<rev>{caret}0' means the commit itself and is used when '<rev>' is the
140140
object name of a tag object that refers to a commit object.
141141

142-
'<rev>{tilde}<n>', e.g. 'master{tilde}3'::
142+
'<rev>{tilde}[<n>]', e.g. 'HEAD{tilde}, master{tilde}3'::
143+
A suffix '{tilde}' to a revision parameter means the first parent of
144+
that commit object.
143145
A suffix '{tilde}<n>' to a revision parameter means the commit
144146
object that is the <n>th generation ancestor of the named
145147
commit object, following only the first parents. I.e. '<rev>{tilde}3' is
@@ -159,12 +161,12 @@ thing no matter the case.
159161
'<rev>{caret}0'
160162
is a short-hand for '<rev>{caret}\{commit\}'.
161163
+
162-
'rev{caret}\{object\}' can be used to make sure 'rev' names an
163-
object that exists, without requiring 'rev' to be a tag, and
164-
without dereferencing 'rev'; because a tag is already an object,
164+
'<rev>{caret}\{object\}' can be used to make sure '<rev>' names an
165+
object that exists, without requiring '<rev>' to be a tag, and
166+
without dereferencing '<rev>'; because a tag is already an object,
165167
it does not have to be dereferenced even once to get to an object.
166168
+
167-
'rev{caret}\{tag\}' can be used to ensure that 'rev' identifies an
169+
'<rev>{caret}\{tag\}' can be used to ensure that '<rev>' identifies an
168170
existing tag object.
169171

170172
'<rev>{caret}{}', e.g. 'v0.99.8{caret}{}'::
@@ -194,19 +196,16 @@ existing tag object.
194196
Depending on the given text, the shell's word splitting rules might
195197
require additional quoting.
196198

197-
'<rev>:<path>', e.g. 'HEAD:README', ':README', 'master:./README'::
199+
'<rev>:<path>', e.g. 'HEAD:README', 'master:./README'::
198200
A suffix ':' followed by a path names the blob or tree
199201
at the given path in the tree-ish object named by the part
200202
before the colon.
201-
':path' (with an empty part before the colon)
202-
is a special case of the syntax described next: content
203-
recorded in the index at the given path.
204203
A path starting with './' or '../' is relative to the current working directory.
205204
The given path will be converted to be relative to the working tree's root directory.
206205
This is most useful to address a blob or tree from a commit or tree that has
207206
the same tree structure as the working tree.
208207

209-
':<n>:<path>', e.g. ':0:README', ':README'::
208+
':[<n>:]<path>', e.g. ':0:README', ':README'::
210209
A colon, optionally followed by a stage number (0 to 3) and a
211210
colon, followed by a path, names a blob object in the
212211
index at the given path. A missing stage number (and the colon
@@ -302,7 +301,7 @@ The 'r1{caret}@' notation means all parents of 'r1'.
302301
The 'r1{caret}!' notation includes commit 'r1' but excludes all of its parents.
303302
By itself, this notation denotes the single commit 'r1'.
304303

305-
The '<rev>{caret}-<n>' notation includes '<rev>' but excludes the <n>th
304+
The '<rev>{caret}-[<n>]' notation includes '<rev>' but excludes the <n>th
306305
parent (i.e. a shorthand for '<rev>{caret}<n>..<rev>'), with '<n>' = 1 if
307306
not given. This is typically useful for merge commits where you
308307
can just pass '<commit>{caret}-' to get all the commits in the branch

0 commit comments

Comments
 (0)