author | Junio C Hamano <junkio@cox.net> | |
Thu, 22 Feb 2007 00:05:56 +0000 (16:05 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 22 Feb 2007 00:05:56 +0000 (16:05 -0800) | ||
commit | 3e8a5db966c26a0a986161103d59683b909a6c78 | |
tree | 3a0df292e42e49cec2e49f04b29450473e8e4975 | tree | snapshot |
parent | 9987d7c58a847ab1605ae3216ff1ca95b19f0ad1 | commit | diff |
git-apply: guess correct -p<n> value for non-git patches.
This enhances the third point in the previous commit. When
applying a non-git patch that begins like this:
--- 2.6.orig/mm/slab.c
+++ 2.6/mm/slab.c
@@ -N,M +L,K @@@
...
and if you are in 'mm' subdirectory, we notice that -p2 is the
right option to use to apply the patch in file slab.c in the
current directory (i.e. mm/slab.c)
The guess function also knows about this pattern, where you
would need to use -p0 if applying from the top-level:
--- mm/slab.c
+++ mm/slab.c
@@ -N,M +L,K @@@
...
Signed-off-by: Junio C Hamano <junkio@cox.net>
This enhances the third point in the previous commit. When
applying a non-git patch that begins like this:
--- 2.6.orig/mm/slab.c
+++ 2.6/mm/slab.c
@@ -N,M +L,K @@@
...
and if you are in 'mm' subdirectory, we notice that -p2 is the
right option to use to apply the patch in file slab.c in the
current directory (i.e. mm/slab.c)
The guess function also knows about this pattern, where you
would need to use -p0 if applying from the top-level:
--- mm/slab.c
+++ mm/slab.c
@@ -N,M +L,K @@@
...
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-apply.c | diff | blob | history | |
t/t4119-apply-config.sh | diff | blob | history |