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

NAME

6       lsdiff - show which files are modified by a patch
7

SYNOPSIS

9       lsdiff [[-n] | [--line-number]] [[-p n] | [--strip-match=n]]
10              [--strip=n] [--addprefix=PREFIX] [[-s] | [--status]] [[-E] |
11              [--empty-files-as-removed]] [[-i PATTERN] | [--include=PATTERN]]
12              [[-x PATTERN] | [--exclude=PATTERN]] [[-z] | [--decompress]]
13              [[-# RANGE] | [--hunks=RANGE]] [--lines=RANGE] [[-FRANGE] |
14              [--files=RANGE]] [[-H] | [--with-filename]] [[-h] |
15              [--no-filename]] [[-v] | [--verbose]...] [file...]
16
17       lsdiff {[--help] | [--version] | [--filter ...] | [--grep ...]}
18

DESCRIPTION

20       List the files modified by a patch.
21
22       You can use both unified and context format diffs with this program.
23

OPTIONS

25       -n, --line-number
26           Display the line number that each patch begins at. If verbose
27           output is requested (using -nv), each hunk of each patch is listed
28           as well.
29
30           For each file that is modified, a line is generated containing the
31           line number of the beginning of the patch, followed by a Tab
32           character, followed by the name of the file that is modified. If -v
33           is given once, following each of these lines will be one line for
34           each hunk, consisting of a Tab character, the line number that the
35           hunk begins at, another Tab character, the string “Hunk #”, and the
36           hunk number (starting at 1).
37
38           If the -v is given twice in conjunction with -n (i.e.  -nvv), the
39           format is slightly different: hunk-level descriptive text is shown
40           after each hunk number, and the --number-files option is enabled.
41
42       -N, --number-files
43           File numbers are listed, beginning at 1, before each filename.
44
45       -# RANGE, --hunks=RANGE
46           Only list hunks within the specified RANGE. Hunks are numbered from
47           1, and the range is a comma-separated list of numbers or
48           “first-last” spans, optionally preceded by a modifier 'x' which
49           inverts the entire range; either the first or the last in the span
50           may be omitted to indicate no limit in that direction.
51
52       --lines=RANGE
53           Only list hunks that contain lines from the original file that lie
54           within the specified RANGE. Lines are numbered from 1, and the
55           range is a comma-separated list of numbers or “first-last” spans,
56           optionally preceded by a modifier 'x' which inverts the entire
57           range; either the first or the last in the span may be omitted to
58           indicate no limit in that direction.
59
60       -F=RANGE, --files=RANGE
61           Only list files indicated by the specified RANGE. Files are
62           numbered from 1 in the order they appear in the patch input, and
63           the range is a comma-separated list of numbers or “first-last”
64           spans, optionally preceded by a modifier 'x' which inverts the
65           entire range; either the first or the last in the span may be
66           omitted to indicate no limit in that direction.
67
68       -p n, --strip-match=n
69           When matching, ignore the first n components of the pathname.
70
71       --strip=n
72           Remove the first n components of the pathname before displaying it.
73
74       --addprefix=PREFIX
75           Prefix the pathname with PREFIX before displaying it.
76
77       -s, --status
78           Show file additions, modifications and removals. A file addition is
79           indicated by a “+”, a removal by a “-”, and a modification by a
80           “!”.
81
82       -E, --empty-files-as-removed
83           Treat empty files as absent for the purpose of displaying file
84           additions, modifications and removals.
85
86       -i PATTERN, --include=PATTERN
87           Include only files matching PATTERN.
88
89       -x PATTERN, --exclude=PATTERN
90           Exclude files matching PATTERN.
91
92       -z, --decompress
93           Decompress files with extensions .gz and .bz2.
94
95       -H, --with-filename
96           Print the name of the patch file containing each patch.
97
98       -h, --no-filename
99           Suppress the name of the patch file containing each patch.
100
101       -v, --verbose
102           Verbose output.
103
104       --help
105           Display a short usage message.
106
107       --version
108           Display the version number of lsdiff.
109
110       --filter
111           Behave like filterdiff(1) instead.
112
113       --grep
114           Behave like grepdiff(1) instead.
115

SEE ALSO

117       filterdiff(1), grepdiff(1), patchview(1)
118

EXAMPLES

120       To sort the order of touched files in a patch, you can use:
121
122           lsdiff patch | sort -u | \
123             xargs -rn1 filterdiff patch -i
124
125       To show only added files in a patch:
126
127           lsdiff -s patch | grep '^+' | \
128             cut -c2- | xargs -rn1 filterdiff patch -i
129
130       To show the headers of all file hunks:
131
132           lsdiff -n patch | (while read n file
133             do sed -ne "$n,$(($n+1))p" patch
134           done)
135

AUTHOR

137       Tim Waugh <twaugh@redhat.com>
138           Package maintainer
139
140
141
142patchutils                        23 Jan 2009                        LSDIFF(1)
Impressum