File: grepdiff.1

package info (click to toggle)
patchutils 0.2.31-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,384 kB
  • ctags: 261
  • sloc: sh: 6,195; ansic: 5,749; xml: 1,971; perl: 398; makefile: 367
file content (133 lines) | stat: -rw-r--r-- 3,200 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.\"Generated by db2man.xsl. Don't modify this, modify the source.
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "GREPDIFF" 1 "2 Jul 2004" "patchutils" ""
.SH NAME
grepdiff \- show files modified by a diff containing a regex
.SH "SYNOPSIS"
.ad l
.hy 0
.HP 9
\fBgrepdiff\fR [\-n] [\-\-number\-files] [\-p\ \fIn\fR] [\-\-strip=\fIn\fR] [\-\-addprefix=\fIPREFIX\fR] [\-s] [\-i\ \fIPATTERN\fR] [\-x\ \fIPATTERN\fR] [\-v] [\-E] [\fB\-H\fR | \fB\-\-with\-filename\fR] [\fB\-h\fR | \fB\-\-no\-filename\fR] [\-\-output\-matching=\fIWHAT\fR] {\fB\fIREGEX\fR\fR | \fB\-f\ \fIFILE\fR\fR} [\fIfile\fR...]
.ad
.hy
.ad l
.hy 0
.HP 9
\fBgrepdiff\fR {\fB\-\-help\fR | \fB\-\-version\fR | \fB\-\-list\fR | \fB\-\-filter\ \&.\&.\&.\fR}
.ad
.hy

.SH "DESCRIPTION"

.PP
For each file modified by a patch, if the patch hunk contains the \fIREGEX\fR then the file's name is printed\&.

.PP
The regular expression is treated as POSIX Basic Regular Expression syntax, unless the \fB\-E\fR option is given in which case POSIX Extended Regular Expression syntax is used\&.

.PP
For example, to see the patches in \fImy\&.patch\fR which contain the regular expression ``pf_gfp_mask'', use: 

.IP
grepdiff pf_gfp_mask my\&.patch | \\
  xargs \-rn1 filterdiff my\&.patch \-i

.PP
You can use both unified and context format diffs with this program\&.

.SH "OPTIONS"

.TP
\fB\-n\fR
Display the line number that each patch begins at\&. If verbose output is requested, each matching hunk is listed as well\&.

For a description of the output format see \fBlsdiff\fR(1)\&.

.TP
\fB\-\-number\-files\fR
File numbers are listed, beginning at 1, before each filename\&.

.TP
\fB\-p\fR \fIn\fR
When matching, ignore the first \fIn\fR components of the pathname\&.

.TP
\fB\-\-strip\fR=\fIn\fR
Remove the first \fIn\fR components of the pathname before displaying it\&.

.TP
\fB\-\-addprefix\fR=\fIPREFIX\fR
Prefix the pathname with \fIPREFIX\fR before displaying it\&.

.TP
\fB\-s\fR
Show file additions, modifications and removals\&. A file addition is indicated by a ``+'', a removal by a ``\-'', and a modification by a ``!''\&.

.TP
\fB\-i\fR \fIPATTERN\fR
Include only files matching \fIPATTERN\fR\&.

.TP
\fB\-x\fR \fIPATTERN\fR
Exclude files matching \fIPATTERN\fR\&.

.TP
\fB\-E\fR
Use POSIX Extended Regular Expression syntax\&.

.TP
\fB\-H\fR, \fB\-\-with\-filename\fR
Print the name of the patch file containing each match\&.

.TP
\fB\-h\fR, \fB\-\-no\-filename\fR
Suppress the name of the patch file containing each match\&.

.TP
\fB\-f\fR \fIFILE\fR
Read regular expressions from \fIFILE\fR, one per line\&.

.TP
\fB\-\-output\-matching\fR=hunk|file
Display the matching hunk\-level or file\-level diffs\&.

.TP
\fB\-\-help\fR
Display a short usage message\&.

.TP
\fB\-\-version\fR
Display the version number of grepdiff\&.

.TP
\fB\-\-filter\fR
Behave like \fBfilterdiff\fR(1) instead\&.

.TP
\fB\-\-list\fR
Behave like \fBlsdiff\fR(1) instead\&.

.SH "SEE ALSO"

.PP
\fBfilterdiff\fR(1), \fBlsdiff\fR(1)

.SH AUTHOR
Tim Waugh <twaugh@redhat\&.com>.