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] {[REGEX] | [-f FILE]} [file...]
21
22       grepdiff {[--help] | [--version] | [--list] | [--filter ...]}
23

DESCRIPTION

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

OPTIONS

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

SEE ALSO

156       filterdiff(1), lsdiff(1)
157

AUTHOR

159       Tim Waugh <twaugh@redhat.com>
160           Package maintainer
161
162
163
164patchutils                        10 Feb 2011                      GREPDIFF(1)
Impressum