git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix revisions doc about quoting for ':/' notation
@ 2017-08-16  3:21 ryenus
  2017-08-16 18:49 ` Junio C Hamano
  2017-08-16 21:15 ` Andreas Heiduk
  0 siblings, 2 replies; 5+ messages in thread
From: ryenus @ 2017-08-16  3:21 UTC (permalink / raw)
  To: Git mailing list

To make sure the `<text>` in `:/<text>` is seen as one search string,
one should quote/escape `<text>` properly.

Especially, the example given in the manual `:/fix nasty bug` does not
work because of missing quotes. The examples are now corrected, and a
note about quoting/escaping is added as well.
---
 Documentation/revisions.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index 61277469c..fdfdde0ad 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -169,14 +169,14 @@ existing tag object.
   and dereference the tag recursively until a non-tag object is
   found.

-'<rev>{caret}{/<text>}', e.g. 'HEAD^{/fix nasty bug}'::
+'<rev>{caret}{/<text>}', e.g. 'HEAD^{/"fix nasty bug"}'::
   A suffix '{caret}' to a revision parameter, followed by a brace
   pair that contains a text led by a slash,
   is the same as the ':/fix nasty bug' syntax below except that
   it returns the youngest matching commit which is reachable from
   the '<rev>' before '{caret}'.

-':/<text>', e.g. ':/fix nasty bug'::
+':/<text>', e.g. ':/"fix nasty bug"'::
   A colon, followed by a slash, followed by a text, names
   a commit whose commit message matches the specified regular expression.
   This name returns the youngest matching commit which is
@@ -185,7 +185,8 @@ existing tag object.
   e.g. ':/^foo'. The special sequence ':/!' is reserved for modifiers to what
   is matched. ':/!-foo' performs a negative match, while ':/!!foo' matches a
   literal '!' character, followed by 'foo'. Any other sequence beginning with
-  ':/!' is reserved for now.
+  ':/!' is reserved for now. And make sure to quote/escape for the text to be
+  seen as one search string.

 '<rev>:<path>', e.g. 'HEAD:README', ':README', 'master:./README'::
   A suffix ':' followed by a path names the blob or tree
--
2.14.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-17  7:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-16  3:21 [PATCH] fix revisions doc about quoting for ':/' notation ryenus
2017-08-16 18:49 ` Junio C Hamano
2017-08-16 21:15 ` Andreas Heiduk
2017-08-16 21:57   ` Junio C Hamano
2017-08-17  7:01     ` ryenus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).