@matheusbsbs / matheus-bagliano / commits / 1c57119c70
Fork 0

builtin-grep: documentation

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed May 8, 2006 at 13:28 UTC 1c57119c70332faf206b5c7e2f3639b96a221717
1 file changed +62 -23
Documentation/git-grep.txt
+62 -23
@@ -8,43 +8,82 @@ git-grep - Print lines matching a pattern
8
9 SYNOPSIS
10 --------
11 -'git-grep' [<option>...] [-e] <pattern> [--] [<path>...]
11 +[verse]
12 +'git-grep' [--cached]
13 + [-a | --text] [-I] [-i | --ignore-case] [-w | --word-regexp]
14 + [-v | --invert-match]
15 + [-E | --extended-regexp] [-G | --basic-regexp]
16 + [-n] [-l | --files-with-matches] [-L | --files-without-match]
17 + [-c | --count]
18 + [-A <post-context>] [-B <pre-context>] [-C <context>]
19 + [-f <file>] [-e <pattern>]
20 + [<tree>...]
21 + [--] [<path>...]
22
23 DESCRIPTION
24 -----------
15 -Searches list of files `git-ls-files` produces for lines
16 -containing a match to the given pattern.
25 +Look for specified patterns in the working tree files, blobs
26 +registered in the index file, or given tree objects.
27
28
29 OPTIONS
30 -------
21 -`--`::
22 - Signals the end of options; the rest of the parameters
23 - are <path> limiters.
31 +--cached::
32 + Instead of searching in the working tree files, check
33 + the blobs registerd in the index file.
34 +
35 +-a | --text::
36 + Process binary files as if they were text.
37 +
38 +-i | --ignore-case::
39 + Ignore case differences between the patterns and the
40 + files.
41 +
42 +-w | --word-regexp::
43 + Match the pattern only at word boundary (either begin at the
44 + beginning of a line, or preceded by a non-word character; end at
45 + the end of a line or followed by a non-word character).
46 +
47 +-v | --invert-match::
48 + Select non-matching lines.
49 +
50 +-E | --extended-regexp | -G | --basic-regexp::
51 + Use POSIX extended/basic regexp for patterns. Default
52 + is to use basic regexp.
53
25 -<option>...::
26 - Either an option to pass to `grep` or `git-ls-files`.
27 -+
28 -The following are the specific `git-ls-files` options
29 -that may be given: `-o`, `--cached`, `--deleted`, `--others`,
30 -`--killed`, `--ignored`, `--modified`, `--exclude=\*`,
31 -`--exclude-from=\*`, and `--exclude-per-directory=\*`.
32 -+
33 -All other options will be passed to `grep`.
54 +-n::
55 + Prefix the line number to matching lines.
56
35 -<pattern>::
36 - The pattern to look for. The first non option is taken
37 - as the pattern; if your pattern begins with a dash, use
38 - `-e <pattern>`.
57 +-l | --files-with-matches | -L | --files-without-match::
58 + Instead of showing every matched line, show only the
59 + names of files that contain (or do not contain) matches.
60
40 -<path>...::
41 - Optional paths to limit the set of files to be searched;
42 - passed to `git-ls-files`.
61 +-c | --count::
62 + Instead of showing every matched line, show the number of
63 + lines that match.
64 +
65 +-[ABC] <context>::
66 + Show `context` trailing (`A` -- after), or leading (`B`
67 + -- before), or both (`C` -- context) lines, and place a
68 + line containing `--` between continguous groups of
69 + matches.
70 +
71 +-f <file>::
72 + Read patterns from <file>, one per line.
73 +
74 +`<tree>...`::
75 + Search blobs in the trees for specified patterns.
76 +
77 +`--`::
78 + Signals the end of options; the rest of the parameters
79 + are <path> limiters.
80
81
82 Author
83 ------
47 -Written by Linus Torvalds <torvalds@osdl.org>
84 +Originally written by Linus Torvalds <torvalds@osdl.org>, later
85 +revamped by Junio C Hamano.
86 +
87
88 Documentation
89 --------------