From 04416018a77ced575c35791f8300ab014417aab9 Mon Sep 17 00:00:00 2001 From: Mark Lodato Date: Thu, 25 Feb 2010 22:40:10 -0500 Subject: [PATCH 1/4] grep docs: pluralize "Example" section Signed-off-by: Mark Lodato Signed-off-by: Junio C Hamano --- Documentation/git-grep.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index c44724d03a..ae663b0210 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -174,8 +174,8 @@ OPTIONS If given, limit the search to paths matching at least one pattern. Both leading paths match and glob(7) patterns are supported. -Example -------- +Examples +-------- git grep 'time_t' -- '*.[ch]':: Looks for `time_t` in all tracked .c and .h files in the working From bfb8306de5382efdee20e9aef3ba6b7a3fae6a64 Mon Sep 17 00:00:00 2001 From: Mark Lodato Date: Thu, 25 Feb 2010 22:40:11 -0500 Subject: [PATCH 2/4] grep docs: use AsciiDoc literals consistently The convention for this particular page is to use AsciiDoc literal strings only for options (`-x` or `--long`), but not for definition list terms and not for . Signed-off-by: Mark Lodato Signed-off-by: Junio C Hamano --- Documentation/git-grep.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index ae663b0210..2e161306e4 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -98,8 +98,8 @@ OPTIONS --files-without-match:: Instead of showing every matched line, show only the names of files that contain (or do not contain) matches. - For better compatibility with 'git diff', --name-only is a - synonym for --files-with-matches. + For better compatibility with 'git diff', `--name-only` is a + synonym for `--files-with-matches`. -z:: --null:: @@ -125,7 +125,7 @@ OPTIONS matches. -:: - A shortcut for specifying -C. + A shortcut for specifying `-C`. -p:: --show-function:: @@ -140,7 +140,7 @@ OPTIONS -e:: The next parameter is the pattern. This option has to be - used for patterns starting with - and should be used in + used for patterns starting with `-` and should be used in scripts passing user input to grep. Multiple patterns are combined by 'or'. @@ -163,7 +163,7 @@ OPTIONS Do not output matched lines; instead, exit with status 0 when there is a match and with non-zero status when there isn't. -`...`:: +...:: Search blobs in the trees for specified patterns. \--:: From ec2537beda63f78746f8b43a031120be0d32310e Mon Sep 17 00:00:00 2001 From: Mark Lodato Date: Thu, 25 Feb 2010 22:40:12 -0500 Subject: [PATCH 3/4] grep docs: --cached and ... are incompatible In the synopsis for git-grep(1), show that --cached and ... cannot be used together. Signed-off-by: Mark Lodato Signed-off-by: Junio C Hamano --- Documentation/git-grep.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 2e161306e4..37ce94305b 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -9,8 +9,7 @@ git-grep - Print lines matching a pattern SYNOPSIS -------- [verse] -'git grep' [--cached] - [-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp] +'git grep' [-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp] [-v | --invert-match] [-h|-H] [--full-name] [-E | --extended-regexp] [-G | --basic-regexp] [-F | --fixed-strings] [-n] @@ -21,7 +20,8 @@ SYNOPSIS [--color | --no-color] [-A ] [-B ] [-C ] [-f ] [-e] - [--and|--or|--not|(|)|-e ...] [...] + [--and|--or|--not|(|)|-e ...] + [--cached | ...] [--] [...] DESCRIPTION From 2e48fcdbc45eeb95b3da1cf70787ddadf62d9bf5 Mon Sep 17 00:00:00 2001 From: Mark Lodato Date: Thu, 25 Feb 2010 22:40:13 -0500 Subject: [PATCH 4/4] grep docs: document --no-index option Also clarify --cached and . Signed-off-by: Mark Lodato Signed-off-by: Junio C Hamano --- Documentation/git-grep.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index 37ce94305b..ee506e67f0 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -21,7 +21,7 @@ SYNOPSIS [-A ] [-B ] [-C ] [-f ] [-e] [--and|--or|--not|(|)|-e ...] - [--cached | ...] + [--cached | --no-index | ...] [--] [...] DESCRIPTION @@ -33,8 +33,11 @@ registered in the index file, or blobs in given tree objects. OPTIONS ------- --cached:: - Instead of searching in the working tree files, check - the blobs registered in the index file. + Instead of searching tracked files in the working tree, search + blobs registered in the index file. + +--no-index:: + Search files in the current directory, not just those tracked by git. -a:: --text:: @@ -164,7 +167,8 @@ OPTIONS there is a match and with non-zero status when there isn't. ...:: - Search blobs in the trees for specified patterns. + Instead of searching tracked files in the working tree, search + blobs in the given trees. \--:: Signals the end of options; the rest of the parameters