.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "LSDIFF" 1 "2 Jul 2004" "patchutils" "" .SH NAME lsdiff \- show which files are modified by a patch .SH "SYNOPSIS" .ad l .hy 0 .HP 7 \fBlsdiff\fR [\-n] [\-p\ \fIn\fR] [\-\-strip=\fIn\fR] [\-\-addprefix=\fIPREFIX\fR] [\-s] [\-E] [\-i\ \fIPATTERN\fR] [\-x\ \fIPATTERN\fR] [\fB\-#\ \fIRANGE\fR\fR | \fB\-\-hunks=\fIRANGE\fR\fR] [\-\-lines=\fIRANGE\fR] [\-\-files=\fIRANGE\fR] [\fB\-H\fR | \fB\-\-with\-filename\fR] [\fB\-h\fR | \fB\-\-no\-filename\fR] [\-v...] [\fIfile\fR...] .ad .hy .ad l .hy 0 .HP 7 \fBlsdiff\fR {\fB\-\-help\fR | \fB\-\-version\fR | \fB\-\-filter\ \&.\&.\&.\fR | \fB\-\-grep\ \&.\&.\&.\fR} .ad .hy .SH "DESCRIPTION" .PP List the files modified by a patch\&. .PP You can use both unified and context format diffs with this program\&. .SH "OPTIONS" .TP \fB\-n\fR Display the line number that each patch begins at\&. If verbose output is requested (using \fB\-nv\fR), each hunk of each patch is listed as well\&. For each file that is modified, a line is generated containing the line number of the beginning of the patch, followed by a Tab character, followed by the name of the file that is modified\&. If \fB\-v\fR is given once, following each of these lines will be one line for each hunk, consisting of a Tab character, the line number that the hunk begins at, another Tab character, the string ``Hunk #'', and the hunk number (starting at 1)\&. If the \fB\-v\fR is given twice in conjunction with \fB\-n\fR (i\&.e\&. \fB\-nvv\fR), the format is slightly different: hunk\-level descriptive text is shown after each hunk number, and the \fB\-\-number\-files\fR option is enabled\&. .TP \fB\-\-number\-files\fR File numbers are listed, beginning at 1, before each filename\&. .TP \fB\-#\fR \fIRANGE\fR | \fB\-\-hunks\fR=\fIRANGE\fR Only list hunks within the specified \fIRANGE\fR\&. Hunks are numbered from 1, and the range is a comma\-separated list of numbers or ``first\-last'' spans; either the first or the last in the span may be omitted to indicate no limit in that direction\&. .TP \fB\-\-lines\fR=\fIRANGE\fR Only list hunks that contain lines from the original file that lie within the specified \fIRANGE\fR\&. Lines are numbered from 1, and the range is a comma\-separated list of numbers or ``first\-last'' spans; either the first or the last in the span may be omitted to indicate no limit in that direction\&. .TP \fB\-\-files\fR=\fIRANGE\fR Only list files indicated by the specified \fIRANGE\fR\&. Files are numbered from 1 in the order they appear in the patch input, and the range is a comma\-separated list of numbers or ``first\-last'' spans; either the first or the last in the span may be omitted to indicate no limit in that direction\&. .TP \fB\-p\fR \fIn\fR When matching, ignore the first \fIn\fR components of the pathname\&. .TP \fB\-\-strip\fR=\fIn\fR Remove the first \fIn\fR components of the pathname before displaying it\&. .TP \fB\-\-addprefix\fR=\fIPREFIX\fR Prefix the pathname with \fIPREFIX\fR before displaying it\&. .TP \fB\-s\fR Show file additions, modifications and removals\&. A file addition is indicated by a ``+'', a removal by a ``\-'', and a modification by a ``!''\&. .TP \fB\-E\fR Treat empty files as absent for the purpose of displaying file additions, modifications and removals\&. .TP \fB\-i\fR \fIPATTERN\fR Include only files matching \fIPATTERN\fR\&. .TP \fB\-x\fR \fIPATTERN\fR Exclude files matching \fIPATTERN\fR\&. .TP \fB\-H\fR, \fB\-\-with\-filename\fR Print the name of the patch file containing each patch\&. .TP \fB\-h\fR, \fB\-\-no\-filename\fR Suppress the name of the patch file containing each patch\&. .TP \fB\-v\fR Verbose output\&. .TP \fB\-\-help\fR Display a short usage message\&. .TP \fB\-\-version\fR Display the version number of lsdiff\&. .TP \fB\-\-filter\fR Behave like \fBfilterdiff\fR(1) instead\&. .TP \fB\-\-grep\fR Behave like \fBgrepdiff\fR(1) instead\&. .SH "SEE ALSO" .PP \fBfilterdiff\fR(1), \fBgrepdiff\fR(1) .SH "EXAMPLES" .PP To sort the order of touched files in a patch, you can use: .IP lsdiff patch | sort \-u | \\ xargs \-rn1 filterdiff patch \-i .PP To show only added files in a patch: .IP lsdiff \-s patch | grep '^+' | \\ cut \-c2\- | xargs \-rn1 filterdiff patch \-i .PP To show the headers of all file hunks: .IP lsdiff \-n patch | (while read n file do sed \-ne "$n,$(($n+1))p" patch done) .SH AUTHOR Tim Waugh .