1LSDIFF(1) Man pages LSDIFF(1)
2
3
4
6 lsdiff - show which files are modified by a patch
7
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] [--files=RANGE]
14 [[-H] | [--with-filename]] [[-h] | [--no-filename]] [[-v] |
15 [--verbose]...] [file...]
16
17 lsdiff {[--help] | [--version] | [--filter ...] | [--grep ...]}
18
20 List the files modified by a patch.
21
22 You can use both unified and context format diffs with this program.
23
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 --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; either the first or the last in the span may be
49 omitted to indicate no limit in that direction.
50
51 --lines=RANGE
52 Only list hunks that contain lines from the original file that lie
53 within the specified RANGE. Lines are numbered from 1, and the
54 range is a comma-separated list of numbers or “first-last” spans;
55 either the first or the last in the span may be omitted to indicate
56 no limit in that direction.
57
58 --files=RANGE
59 Only list files indicated by the specified RANGE. Files are
60 numbered from 1 in the order they appear in the patch input, and
61 the range is a comma-separated list of numbers or “first-last”
62 spans; either the first or the last in the span may be omitted to
63 indicate no limit in that direction.
64
65 -p n, --strip-match=n
66 When matching, ignore the first n components of the pathname.
67
68 --strip=n
69 Remove the first n components of the pathname before displaying it.
70
71 --addprefix=PREFIX
72 Prefix the pathname with PREFIX before displaying it.
73
74 -s, --status
75 Show file additions, modifications and removals. A file addition is
76 indicated by a “+”, a removal by a “-”, and a modification by a
77 “!”.
78
79 -E, --empty-files-as-removed
80 Treat empty files as absent for the purpose of displaying file
81 additions, modifications and removals.
82
83 -i PATTERN, --include=PATTERN
84 Include only files matching PATTERN.
85
86 -x PATTERN, --exclude=PATTERN
87 Exclude files matching PATTERN.
88
89 -z, --decompress
90 Decompress files with extensions .gz and .bz2.
91
92 -H, --with-filename
93 Print the name of the patch file containing each patch.
94
95 -h, --no-filename
96 Suppress the name of the patch file containing each patch.
97
98 -v, --verbose
99 Verbose output.
100
101 --help
102 Display a short usage message.
103
104 --version
105 Display the version number of lsdiff.
106
107 --filter
108 Behave like filterdiff(1) instead.
109
110 --grep
111 Behave like grepdiff(1) instead.
112
114 filterdiff(1), grepdiff(1)
115
117 To sort the order of touched files in a patch, you can use:
118
119 lsdiff patch | sort -u | \
120 xargs -rn1 filterdiff patch -i
121
122 To show only added files in a patch:
123
124 lsdiff -s patch | grep ´^+´ | \
125 cut -c2- | xargs -rn1 filterdiff patch -i
126
127 To show the headers of all file hunks:
128
129 lsdiff -n patch | (while read n file
130 do sed -ne "$n,$(($n+1))p" patch
131 done)
132
134 Tim Waugh <twaugh@redhat.com>
135 Package maintainer
136
137
138
139patchutils 23 Jan 2009 LSDIFF(1)