Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

diffstat(1) [redhat man page]

DIFFSTAT(1)						      General Commands Manual						       DIFFSTAT(1)

NAME
diffstat - make histogram from diff-output USAGE
diffstat [options] [file-specifications] SYNOPSIS
This program reads the output of diff and displays a histogram of the insertions, deletions, and modifications per-file. DESCRIPTION
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. 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. OPTIONS
-c prefix each line of output with "#", making it a comment-line for shell scripts. -f format specify 0 for concise, 1 for normal output. -k suppress the merging of filenames in the report. -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. -u suppress the sorting of filenames in the report. -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. ENVIRONMENT
Diffstat runs in a portable UNIX(R) environment. FILES
Diffstat is a single binary module, which uses no auxiliary files. BUGS
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. SEE ALSO
diff (1). AUTHOR
Thomas Dickey <dickey@invisible-island.net>. DIFFSTAT(1)

Check Out this Related Man Page

GENDIFF(1)                                                    General Commands Manual                                                   GENDIFF(1)

NAME
gendiff - utility to aid in error-free diff file generation SYNOPSIS
gendiff <directory> <diff-extension> DESCRIPTION
gendiff is a rather simple script which aids in generating a diff file from a single directory. It takes a directory name and a "diff- extension" as its only arguments. The diff extension should be a unique sequence of characters added to the end of all original, unmodi- fied files. The output of the program is a diff file which may be applied with the patch program to recreate the changes. The usual sequence of events for creating a diff is to create two identical directories, make changes in one directory, and then use the diff utility to create a list of differences between the two. Using gendiff eliminates the need for the extra, original and unmodified directory copy. Instead, only the individual files that are modified need to be saved. Before editing a file, copy the file, appending the extension you have chosen to the filename. I.e. if you were going to edit somefile.cpp and have chosen the extension "fix", copy it to somefile.cpp.fix before editing it. Then edit the first copy (somefile.cpp). After editing all the files you need to edit in this fashion, enter the directory one level above where your source code resides, and then type $ gendiff somedirectory .fix > mydiff-fix.patch You should redirect the output to a file (as illustrated) unless you want to see the results on stdout. SEE ALSO
diff(1), patch(1) AUTHOR
Marc Ewing <marc@redhat.com> 4th Berkeley Distribution Mon Jan 10 2000 GENDIFF(1)
Man Page