Developer's Daily | Unix by Example |
main | java | perl | unix | dev directory | web log |
diffstat ? make histogram from diff-output |
diffstat [options] [file-specifications] |
This program reads the output of diff and displays a histogram of the insertions, deletions, and modifications per-file. |
Diffstat is a program that is useful for reviewing large, complex patch files. It reads from one or more input files which contain output from diff, producing a histogram of the total lines changed for each file referenced. Diffstat recognizes the most popular types of output from diff: |
unified |
preferred by the patch utility. |
context |
best for readability, but not very compact. |
default |
not good for much, but simple to generate. |
Diffstat detects the lines that are output by diff to tell which files are compared, and then counts the markers in the first column that denote the type of change (insertion, deletion or modification). These are shown in the histogram as "+", "-" and "!" characters. If no filename is given on the command line, diffstat reads the differences from the standard input. |
?n number |
specify the minimum width used for filenames. If you don’t specify this, diffstat uses the length of the longest filename, after stripping common prefixes. |
?p number |
override the logic that strips common pathnames, simulating the patch "-p" option. |
?V |
prints the current version number |
?w number |
specify the maximum width of the histogram. The plot will never be shorter than 10 columns, just in case the filenames get too large. |
Diffstat runs in a portable UNIX® environment. |
Diffstat is a single binary module, which uses no auxiliary files. |
Diffstat makes a lot of assumptions about the format of a diff file. There’s no easy way to determine the degree of overlap between the "before" and "after" displays of modified lines. |
diff (1). |
Thomas Dickey (dickey@clark.net). |