summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder.dev@gmail.com>2018-07-23 13:50:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-23 19:38:16 (GMT)
commitf57d11728d10ac1db9b0d44f01984cb3f6967ed2 (patch)
tree2fcd07fd3a75f7258ba2057a95e707b9ed41e339 /Makefile
parentac1e31d5ca8cacaf8aade744d1a44bfb977b2da2 (diff)
downloadgit-f57d11728d10ac1db9b0d44f01984cb3f6967ed2.zip
git-f57d11728d10ac1db9b0d44f01984cb3f6967ed2.tar.gz
git-f57d11728d10ac1db9b0d44f01984cb3f6967ed2.tar.bz2
coccinelle: put sane filenames into output patches
Coccinelle outputs its suggested transformations as patches, whose header looks something like this: --- commit.c +++ /tmp/cocci-output-19250-7ae78a-commit.c Note the lack of 'diff --opts <old> <new>' line, the differing number of path components on the --- and +++ lines, and the nonsensical filename on the +++ line. 'patch -p0' can still apply these patches, as it takes the filename to be modified from the --- line. Alas, 'git apply' can't, because it takes the filename from the +++ line, and then complains about the nonexisting file. Pass the '--patch .' options to Coccinelle via the SPATCH_FLAGS 'make' variable, as it seems to make it generate proper context diff patches, with the header starting with a 'diff ...' line and containing sane filenames. The resulting 'contrib/coccinelle/*.cocci.patch' files then can be applied both with 'git apply' and 'patch' (even without '-p0'). Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index df3682f..9ac540d 100644
--- a/Makefile
+++ b/Makefile
@@ -564,7 +564,7 @@ SPATCH = spatch
export TCL_PATH TCLTK_PATH
SPARSE_FLAGS =
-SPATCH_FLAGS = --all-includes
+SPATCH_FLAGS = --all-includes --patch .