Skip to content

Commit 7b63ea5

Browse files
avargitster
authored andcommitted
Makefile: remove mandatory "spatch" arguments from SPATCH_FLAGS
The "--patch ." part of SPATCH_FLAGS added in f57d117 (coccinelle: put sane filenames into output patches, 2018-07-23) should have been added unconditionally to the "spatch" invocation instead, using it isn't optional. Let's also move the other mandatory flag to come after $(SPATCH_FLAGS), to ensure that our "--sp-file" overrides any provided in the environment, both --sp-file <arg> and --patch <arg> are last-option-wins as far as spatch(1) option parsing is concerned. The environment variable override was initially added in a9a884a (coccicheck: use --all-includes by default, 2016-09-30). In practice there's probably nobody that's using SPATCH_FLAGS to try to intentionally break our invocations, but since we're changing this let's make it clear what (if anything) we expect to be overridden by user-supplied flags. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 30cc8d0 commit 7b63ea5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ SANITIZE_ADDRESS =
12861286
# For the 'coccicheck' target; setting SPATCH_BATCH_SIZE higher will
12871287
# usually result in less CPU usage at the cost of higher peak memory.
12881288
# Setting it to 0 will feed all files in a single spatch invocation.
1289-
SPATCH_FLAGS = --all-includes --patch .
1289+
SPATCH_FLAGS = --all-includes
12901290
SPATCH_BATCH_SIZE = 1
12911291

12921292
include config.mak.uname
@@ -3131,7 +3131,8 @@ check: $(GENERATED_H)
31313131
limit='-n $(SPATCH_BATCH_SIZE)'; \
31323132
fi; \
31333133
if ! echo $(COCCI_SOURCES) | xargs $$limit \
3134-
$(SPATCH) --sp-file $< $(SPATCH_FLAGS) \
3134+
$(SPATCH) $(SPATCH_FLAGS) \
3135+
--sp-file $< --patch . \
31353136
>$@+ 2>$@.log; \
31363137
then \
31373138
cat $@.log; \

0 commit comments

Comments
 (0)