1LSDIFF(1) Man pages LSDIFF(1)
2
3
4
6 lsdiff - show which files are modified by a patch
7
9 lsdiff [-n] [-p n] [--strip=n] [--addprefix=PREFIX] [-s] [-E]
10 [-i PATTERN] [-x PATTERN] [[-# RANGE] [--hunks=RANGE]]
11 [--lines=RANGE] [--files=RANGE] [[-H] [--with-filename]] [[-h]
12 [--no-filename]] [-v...] [file...]
13
14 lsdiff {[--help] [--version] [--filter ...] [--grep ...]}
15
17 List the files modified by a patch.
18
19 You can use both unified and context format diffs with this program.
20
22 -n Display the line number that each patch begins at. If verbose
23 output is requested (using -nv), each hunk of each patch is
24 listed as well.
25
26 For each file that is modified, a line is generated containing
27 the line number of the beginning of the patch, followed by a Tab
28 character, followed by the name of the file that is modified. If
29 -v is given once, following each of these lines will be one line
30 for each hunk, consisting of a Tab character, the line number
31 that the hunk begins at, another Tab character, the string “Hunk
32 #”, and the hunk number (starting at 1).
33
34 If the -v is given twice in conjunction with -n (i.e. -nvv),
35 the format is slightly different: hunk-level descriptive text is
36 shown after each hunk number, and the --number-files option is
37 enabled.
38
39 --number-files
40 File numbers are listed, beginning at 1, before each filename.
41
42 -# RANGE | --hunks=RANGE
43 Only list hunks within the specified RANGE. Hunks are numbered
44 from 1, and the range is a comma-separated list of numbers or
45 “first-last” spans; either the first or the last in the span may
46 be omitted to indicate no limit in that direction.
47
48 --lines=RANGE
49 Only list hunks that contain lines from the original file that
50 lie within the specified RANGE. Lines are numbered from 1, and
51 the range is a comma-separated list of numbers or “first-last”
52 spans; either the first or the last in the span may be omitted
53 to indicate no limit in that direction.
54
55 --files=RANGE
56 Only list files indicated by the specified RANGE. Files are
57 numbered from 1 in the order they appear in the patch input, and
58 the range is a comma-separated list of numbers or “first-last”
59 spans; either the first or the last in the span may be omitted
60 to indicate no limit in that direction.
61
62 -p n When matching, ignore the first n components of the pathname.
63
64 --strip=n
65 Remove the first n components of the pathname before displaying
66 it.
67
68 --addprefix=PREFIX
69 Prefix the pathname with PREFIX before displaying it.
70
71 -s Show file additions, modifications and removals. A file addition
72 is indicated by a “+”, a removal by a “-”, and a modification by
73 a “!”.
74
75 -E Treat empty files as absent for the purpose of displaying file
76 additions, modifications and removals.
77
78 -i PATTERN
79 Include only files matching PATTERN.
80
81 -x PATTERN
82 Exclude files matching PATTERN.
83
84 -H, --with-filename
85 Print the name of the patch file containing each patch.
86
87 -h, --no-filename
88 Suppress the name of the patch file containing each patch.
89
90 -v Verbose output.
91
92 --help Display a short usage message.
93
94 --version
95 Display the version number of lsdiff.
96
97 --filter
98 Behave like filterdiff(1) instead.
99
100 --grep Behave like grepdiff(1) instead.
101
103 filterdiff(1), grepdiff(1)
104
106 To sort the order of touched files in a patch, you can use:
107
108 lsdiff patch | sort -u | \
109 xargs -rn1 filterdiff patch -i
110
111 To show only added files in a patch:
112
113 lsdiff -s patch | grep '^+' | \
114 cut -c2- | xargs -rn1 filterdiff patch -i
115
116 To show the headers of all file hunks:
117
118 lsdiff -n patch | (while read n file
119 do sed -ne "$n,$(($n+1))p" patch
120 done)
121
123 Tim Waugh <twaugh@redhat.com>.
124
125
126
127patchutils 2 Jul 2004 LSDIFF(1)