aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-06-23 09:14:11 -0700
committerJunio C Hamano <gitster@pobox.com>2025-06-23 09:33:31 -0700
commit819d3a55fc5a530f90309c2d208101765e8fe78d (patch)
treed746e813d25c8c31b808d6807ecd7c38323db792
parentGit 2.48.1 (diff)
downloadgit-819d3a55fc5a530f90309c2d208101765e8fe78d.tar.gz
git-819d3a55fc5a530f90309c2d208101765e8fe78d.zip
coccicheck: fail "make" when it fails
With "make coccicheck", we generate contrib/coccinelle/*.cocci.patch files that contain changes suggested by semantic patches, but "make" succeeds. Admittedly, not many developers may run "make coccicheck" in the first place, but it makes it harder to notice when they do run it after they introduced an iffy piece of code. Check that the resulting cocci.patch files are all empty. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 97e8385b66..8f1e9424a7 100644
--- a/Makefile
+++ b/Makefile
@@ -3422,11 +3422,14 @@ endif
coccicheck-test: $(COCCI_TEST_RES_GEN)
coccicheck: coccicheck-test
+
ifdef SPATCH_CONCAT_COCCI
-coccicheck: contrib/coccinelle/ALL.cocci.patch
+COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = contrib/coccinelle/ALL.cocci.patch
else
-coccicheck: $(COCCICHECK_PATCHES_INTREE)
+COCCICHECK_PATCH_MUST_BE_EMPTY_FILES = $(COCCICHECK_PATCHES_INTREE)
endif
+coccicheck: $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES)
+ ! grep -q ^ $(COCCICHECK_PATCH_MUST_BE_EMPTY_FILES) /dev/null
# See contrib/coccinelle/README
coccicheck-pending: coccicheck-test