NAME 

filterdiff - extract or exclude diffs from a diff file

SYNOPSIS 

filterdiff [-i PATTERN] [-p n] [--strip=n] [--addprefix=PREFIX] [-x PATTERN] [--verbose] [-v] [-z] [[-# RANGE] [--hunks=RANGE]] [--lines=RANGE] [--files=RANGE] [--annotate] [--format=FORMAT] [--as-numbered-lines=WHEN] [--remove-timestamps] [file...]
filterdiff {[--help] [--version] [--list] [--grep ...]}

DESCRIPTION 

You can use filterdiff to obtain a patch that applies to files matching the shell wildcard PATTERN from a larger collection of patches. For example, to see the patches in patch-2.4.3.gz that apply to all files called lp.c:
filterdiff -z -i '*/lp.c' patch-2.4.3.gz

If neither -i nor -x options are given, -i '*' is assumed. This way filterdiff can be used to clean up an existing diff file, removing redundant lines from the beginning (eg. the text from the mail body) or between the chunks (eg. in CVS diffs). To extract pure patch data, use a command like this:

filterdiff message-with-diff-in-the-body > patch

Note that the interpretation of the shell wildcard pattern does not count slash characters or periods as special (in other words, no flags are given to fnmatch). This is so that lq*/basenamerq-type patterns can be given without limiting the number of pathname components.

You can use both unified and context format diffs with this program.