From c4730f35cc6507bc117a08885d88668fe02b1a7d Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 1 Jul 2008 00:44:47 +0100 Subject: Teach "git apply" to prepend a prefix with "--root=" With "git apply --root=", all file names in the patch are prepended with . If a "-p" value was given, the paths are stripped _before_ prepending . Wished for by HPA. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- Documentation/git-apply.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Documentation/git-apply.txt') diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt index c8347637da..63fce53690 100644 --- a/Documentation/git-apply.txt +++ b/Documentation/git-apply.txt @@ -14,7 +14,7 @@ SYNOPSIS [--allow-binary-replacement | --binary] [--reject] [-z] [-pNUM] [-CNUM] [--inaccurate-eof] [--cached] [--whitespace=] - [--exclude=PATH] [--verbose] [...] + [--exclude=PATH] [--root=] [--verbose] [...] DESCRIPTION ----------- @@ -177,6 +177,10 @@ behavior: current patch being applied will be printed. This option will cause additional information to be reported. +--root=:: + Prepend to all filenames. If a "-p" argument was passed, too, + it is applied before prepending the new root. + Configuration ------------- -- cgit v1.2.1 From f55638874774acc1e13a046353449ebc8734ab08 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 6 Jul 2008 18:36:01 -0700 Subject: git-apply --directory: make --root more similar to GNU diff Applying a patch in the directory that is different from what the patch records is done with --directory option in GNU diff. The --root option we introduced previously does the same, and we can call it the same way to give users more familiar feel. Signed-off-by: Junio C Hamano --- Documentation/git-apply.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Documentation/git-apply.txt') diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt index 63fce53690..3cd3179ff1 100644 --- a/Documentation/git-apply.txt +++ b/Documentation/git-apply.txt @@ -14,7 +14,7 @@ SYNOPSIS [--allow-binary-replacement | --binary] [--reject] [-z] [-pNUM] [-CNUM] [--inaccurate-eof] [--cached] [--whitespace=] - [--exclude=PATH] [--root=] [--verbose] [...] + [--exclude=PATH] [--directory=] [--verbose] [...] DESCRIPTION ----------- @@ -177,9 +177,13 @@ behavior: current patch being applied will be printed. This option will cause additional information to be reported. ---root=:: +--directory=:: Prepend to all filenames. If a "-p" argument was passed, too, it is applied before prepending the new root. ++ +For example, a patch that talks about updating `a/git-gui.sh` to `b/git-gui.sh` +can be applied to the file in the working tree `modules/git-gui/git-gui.sh` by +running `git apply --directory=modules/git-gui`. Configuration ------------- -- cgit v1.2.1