Manual Section... (1) - page: diffstat
NAMEdiffstat - make histogram from diff-output
SYNOPSISdiffstat [options] [file-specifications]
DESCRIPTIONThis 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. If the input filename ends with .bz2, .Z or .gz, diffstat will read the uncompressed data via a pipe from the corresponding program.
Diffstat recognizes the most popular types of output from diff:
- preferred by the patch utility.
- best for readability, but not very compact.
- 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.
- ignore lines matching "Binary files XXX and YYY differ" in the diff
- prefix each line of output with "#", making it a comment-line for shell scripts.
- -D destination
- specify a directory containing files which can be referred to as the result of applying the differences. diffstat will count the lines in the corresponding files (after adjusting the names by the -p option) to obtain the total number of lines in each file.
- The remainder, after subtracting modified and deleted lines, is shown as "unchanged lines".
- -e file
- redirect standard error to file.
- -f format
specify the format of the histogram.
- for concise, which shows only the value and a single histogram code for each of insert (+), delete (-) or modify (!)
- for normal output,
- to fill in the histogram with dots,
- to print each value with the histogram.
- Any nonzero value gives a histogram. The dots and individual values can be combined, e.g., -f6 gives both.
- prints the usage message and exits.
- suppress the merging of filenames in the report.
- lists only the filenames. No histogram is generated.
- merge insert/delete counts from each "chunk" of the patch file to approximate a count of the modified lines.
- -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.
- -o file
- redirect standard output to file.
- -p number
- override the logic that strips common pathnames, simulating the patch "-p" option.
- suppress the "0 files changed" message for empty diffs.
- -r code
provides optional rounding of the data shown in histogram,
rather than truncating with error adjustments.
- is the default. No rounding is performed, but accumulated errors are added to following columns.
- rounds the data
- rounds the data and adjusts the histogram to ensure that it displays something if there are any differences even if those would normally be rounded to zero.
- -S source
- this is like the -D option, but specifies a location where the original files (before applying differences) can be found.
- overrides the histogram, generates output of comma separated values.
- suppress the sorting of filenames in the report.
- show progress, e.g., if the output is redirected to a file, write progress messages to the standard error.
- prints the current version number and exits.
- -w number
- specify the maximum width of the histogram. The histogram will never be shorter than 10 columns, just in case the filenames get too large.
Diffstat makes a lot of assumptions about the format of a diff file.
There is no way to obtain a filename from the standard diff between two files with no options. Context diffs work, as well as unified diffs.
There's no easy way to determine the degree of overlap between the "before" and "after" displays of modified lines. diffstat simply counts the number of inserted and deleted lines to approximate modified lines for the -m option.
Thomas Dickey <email@example.com>.
This document was created by man2html, using the manual pages.
Time: 15:26:07 GMT, June 11, 2010