aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-apply.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-08-25 01:05:31 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-06 18:56:44 -0700
commit6ecb1ee28a9479af1d39cfab170b5d93e238c277 (patch)
tree7b8dfdec19e5b2117f8928916da9ca6e56907917 /Documentation/git-apply.txt
parent80d12c23de4fbddfaee2f9bf7fe809f57d02e171 (diff)
downloadgit-6ecb1ee28a9479af1d39cfab170b5d93e238c277.tar.gz
git-apply:--include=pathspec
This allows --include=pathspec, similar to --exclude=pathspec. The rule when one or both of these are used is that the include/exclude patterns are examined in the order they are given on the command line, and the first match determines if a patch to each path is used or not. Hence: $ git apply --include='specific.h' --exclude='*.h' <diff would apply the patch to specific.h header file, but all other patches in the input file to other header files are ignored. A patch to a path that does not match any include/exclude pattern is used by default if there is no include pattern on the command line, and ignored if there is any include pattern. This originally came from Joe Perches, but both the design of the semantics and the implementation have been redone complately. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-apply.txt')
-rw-r--r--Documentation/git-apply.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index feb51f124a..e726510ab1 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -14,7 +14,8 @@ SYNOPSIS
[--allow-binary-replacement | --binary] [--reject] [-z]
[-pNUM] [-CNUM] [--inaccurate-eof] [--recount] [--cached]
[--whitespace=<nowarn|warn|fix|error|error-all>]
- [--exclude=PATH] [--directory=<root>] [--verbose] [<patch>...]
+ [--exclude=PATH] [--include=PATH] [--directory=<root>]
+ [--verbose] [<patch>...]
DESCRIPTION
-----------
@@ -137,6 +138,17 @@ discouraged.
be useful when importing patchsets, where you want to exclude certain
files or directories.
+--include=<path-pattern>::
+ Apply changes to files matching the given path pattern. This can
+ be useful when importing patchsets, where you want to include certain
+ files or directories.
++
+When --exclude and --include patterns are used, they are examined in the
+order they appear on the command line, and the first match determines if a
+patch to each path is used. A patch to a path that does not match any
+include/exclude pattern is used by default if there is no include pattern
+on the command line, and ignored if there is any include pattern.
+
--whitespace=<action>::
When applying a patch, detect a new or modified line that has
whitespace errors. What are considered whitespace errors is