1DIFFSTAT(1) General Commands Manual DIFFSTAT(1)
2
3
4
6 diffstat - make histogram from diff-output
7
9 diffstat [options] [file-specifications]
10
12 This program reads the output of diff and displays a histogram of the
13 insertions, deletions, and modifications per-file. Diffstat is a pro‐
14 gram that is useful for reviewing large, complex patch files. It reads
15 from one or more input files which contain output from diff, producing
16 a histogram of the total lines changed for each file referenced. If
17 the input filename ends with .bz2, .Z or .gz, diffstat will read the
18 uncompressed data via a pipe from the corresponding program.
19
20 Diffstat recognizes the most popular types of output from diff:
21
22 unified
23 preferred by the patch utility.
24
25 context
26 best for readability, but not very compact.
27
28 default
29 not good for much, but simple to generate.
30
31 Diffstat detects the lines that are output by diff to tell which files
32 are compared, and then counts the markers in the first column that
33 denote the type of change (insertion, deletion or modification). These
34 are shown in the histogram as "+", "-" and "!" characters.
35
36 If no filename is given on the command line, diffstat reads the differ‐
37 ences from the standard input.
38
40 -c prefix each line of output with "#", making it a comment-line
41 for shell scripts.
42
43 -e file
44 redirect standard error to file.
45
46 -f format
47 specify the format of the histogram.
48
49 0 for concise, which shows only the value and a single his‐
50 togram code for each of insert (+), delete (-) or modify (!)
51
52 1 for normal output,
53
54 2 to fill in the histogram with dots,
55
56 4 to print each value with the histogram.
57
58 Any nonzero value gives a histogram. The dots and individual
59 values can be combined, e.g., -f6 gives both.
60
61 -h prints the usage message and exits.
62
63 -k suppress the merging of filenames in the report.
64
65 -l lists only the filenames. No histogram is generated.
66
67 -n number
68 specify the minimum width used for filenames. If you don't
69 specify this, diffstat uses the length of the longest filename,
70 after stripping common prefixes.
71
72 -o file
73 redirect standard output to file.
74
75 -p number
76 override the logic that strips common pathnames, simulating the
77 patch "-p" option.
78
79 -r code
80 provides optional rounding of the data shown in histogram,
81 rather than truncating with error adjustments.
82
83 0 is the default. No rounding is performed, but accumulated
84 errors are added to following columns.
85
86 1 rounds the data
87
88 2 rounds the data and adjusts the histogram to ensure that it
89 displays something if there are any differences even if those
90 would normally be rounded to zero.
91
92 -t overrides the histogram, generates output of comma separated
93 values.
94
95 -u suppress the sorting of filenames in the report.
96
97 -v show progress, e.g., if the output is redirected to a file,
98 write progress messages to the standard error.
99
100 -V prints the current version number and exits.
101
102 -w number
103 specify the maximum width of the histogram. The histogram will
104 never be shorter than 10 columns, just in case the filenames get
105 too large.
106
108 Diffstat runs in a portable UNIX® environment.
109
111 Diffstat is a single binary module, which uses no auxiliary files.
112
114 Diffstat makes a lot of assumptions about the format of a diff file.
115
116 There is no way to obtain a filename from the standard diff between two
117 files with no options. Context diffs work, as well as unified diffs.
118
119 There's no easy way to determine the degree of overlap between the
120 "before" and "after" displays of modified lines.
121
123 diff (1).
124
126 Thomas Dickey <dickey@invisible-island.net>.
127
128
129
130 DIFFSTAT(1)