1GREPDIFF(1)                        Man pages                       GREPDIFF(1)
2
3
4

NAME

6       grepdiff - show files modified by a diff containing a regex
7

SYNOPSIS

9       grepdiff [[-n] | [--line-number]] [[-N] | [--number-files]] [[-p n] |
10                [--strip-match=n]] [--strip=n] [--addprefix=PREFIX]
11                [--addoldprefix=PREFIX] [--addnewprefix=PREFIX] [[-s] |
12                [--status]] [[-i PATTERN] | [--include=PATTERN]] [[-I FILE] |
13                [--include-from-file=FILE]] [[-x PATTERN] |
14                [--exclude=PATTERN]] [[-X FILE] | [--exclude-from-file=FILE]]
15                [[-# RANGE] | [--hunks=RANGE]] [--lines=RANGE] [[-FRANGE] |
16                [--files=RANGE]] [--annotate] [--as-numbered-lines=WHEN]
17                [--format=FORMAT] [--remove-timestamps] [[-v] | [--verbose]]
18                [[-z] | [--decompress]] [[-E] | [--extended-regexp]] [[-H] |
19                [--with-filename]] [[-h] | [--no-filename]]
20                [--output-matching=WHAT] [--only-match=WHAT] {[REGEX] |
21                [-f FILE]} [file...]
22
23       grepdiff {[--help] | [--version] | [--list] | [--filter ...]}
24

DESCRIPTION

26       For each file modified by a patch, if the patch hunk contains the REGEX
27       then the file's name is printed.
28
29       The regular expression is treated as POSIX Basic Regular Expression
30       syntax, unless the -E option is given in which case POSIX Extended
31       Regular Expression syntax is used.
32
33       For example, to see the patches in my.patch which contain the regular
34       expression “pf_gfp_mask”, use:
35
36           grepdiff pf_gfp_mask my.patch | \
37             xargs -rn1 filterdiff my.patch -i
38
39       You can use both unified and context format diffs with this program.
40

OPTIONS

42       -n, --line-number
43           Display the line number that each patch begins at. If verbose
44           output is requested, each matching hunk is listed as well.
45
46           For a description of the output format see lsdiff(1).
47
48       -N, --number-files
49           File numbers are listed, beginning at 1, before each filename.
50
51       -p n, --strip-match=n
52           When matching, ignore the first n components of the pathname.
53
54       --strip=n
55           Remove the first n components of the pathname before displaying it.
56
57       --addprefix=PREFIX
58           Prefix the pathname with PREFIX before displaying it. This will
59           override any individual settings specified with the --addoldprefix
60           or --addnewprefix options.
61
62       --addoldprefix=PREFIX
63           Prefix pathnames for old or original files in the output by PREFIX.
64
65       --addnewprefix=PREFIX
66           Prefix pathnames for updated or new files in the output by PREFIX.
67
68       -s
69           Show file additions, modifications and removals. A file addition is
70           indicated by a “+”, a removal by a “-”, and a modification by a
71           “!”.
72
73       -i PATTERN, --include=PATTERN
74           Include only files matching PATTERN.
75
76       -I FILE, --include-from-file=FILE
77           Include only files matching any pattern listed in FILE, one pattern
78           per line. All other lines in the input are suppressed.
79
80       -x PATTERN --exclude=PATTERN
81           Exclude files matching PATTERN.
82
83       -X FILE, --exclude-from-file=FILE
84           Exclude files matching any pattern listed in FILE, one pattern per
85           line. All other lines in the input are displayed.
86
87       -# RANGE, --hunks=RANGE
88           Only include hunks within the specified RANGE. Hunks are numbered
89           from 1, and the range is a comma-separated list of numbers or
90           “first-last” spans, optionally preceded by a modifier 'x' which
91           inverts the entire range; either the first or the last in the span
92           may be omitted to indicate no limit in that direction.
93
94       --lines=RANGE
95           Only list hunks that contain lines from the original file that lie
96           within the specified RANGE. Lines are numbered from 1, and the
97           range is a comma-separated list of numbers or “first-last” spans,
98           optionally preceded by a modifier 'x' which inverts the entire
99           range; either the first or the last in the span may be omitted to
100           indicate no limit in that direction.
101
102       -F=RANGE, --files=RANGE
103           Only list files indicated by the specified RANGE. Files are
104           numbered from 1 in the order they appear in the patch input, and
105           the range is a comma-separated list of numbers or “first-last”
106           spans, optionally preceded by a modifier 'x' which inverts the
107           entire range; either the first or the last in the span may be
108           omitted to indicate no limit in that direction.
109
110       --annotate
111           Annotate each hunk with the filename and hunk number.
112
113       --as-numbered-lines=before|after
114           Instead of a patch fragment, display the lines of the selected
115           hunks with the line number of the file before (or after) the patch
116           is applied, followed by a TAB character and a colon, at the
117           beginning of each line. Each hunk except the first will have a line
118           consisting of “...”  before it.
119
120       --format=unified|context
121           Use specified output format.
122
123       --remove-timestamps
124           Do not include file timestamps in the output.
125
126       -z, --decompress
127           Decompress files with extensions .gz and .bz2.
128
129       -E, --extended-regexp
130           Use POSIX Extended Regular Expression syntax.
131
132       -H, --with-filename
133           Print the name of the patch file containing each match.
134
135       -h, --no-filename
136           Suppress the name of the patch file containing each match.
137
138       -f FILE, --file=FILE
139           Read regular expressions from FILE, one per line.
140
141       --output-matching=hunk|file
142           Display the matching hunk-level or file-level diffs.
143
144       --only-match=rem|removals|add|additions|mod|modifications|all
145           Limit regex matching to removals, additions, modifications or the
146           whole hunk.
147
148       --help
149           Display a short usage message.
150
151       --version
152           Display the version number of grepdiff.
153
154       --filter
155           Behave like filterdiff(1) instead.
156
157       --list
158           Behave like lsdiff(1) instead.
159

SEE ALSO

161       filterdiff(1), lsdiff(1), patchview(1)
162

AUTHOR

164       Tim Waugh <twaugh@redhat.com>
165           Package maintainer
166
167
168
169patchutils                        10 Feb 2011                      GREPDIFF(1)
Impressum