]> git.feebdaed.xyz Git - 0xmirror/git.git/commit
contrib/coccinelle: pass include paths to spatch(1)
authorToon Claes <toon@iotcl.com>
Wed, 10 Dec 2025 13:13:02 +0000 (14:13 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 11 Dec 2025 05:44:43 +0000 (14:44 +0900)
commit467860bc0b0447093ae97bcecf1655131732338f
tree49ca64dd03d243c58c1ce3fb8d68db9dabd5b7a5
parenta67b902c94a2f33275a3947a8bcdab03f64ae75e
contrib/coccinelle: pass include paths to spatch(1)

In the previous commit a new coccinelle rule is added. But neiter
`make coccicheck` nor `meson compile coccicheck` did detect a case in
builtin/last-modified.c.

This case involves the field `scratch` in `struct last_modified`. This
field is of type `struct bitmap` and that struct has a member
`eword_t *words`. Both are defined in `ewah/ewok.h`. Now, while
builtin/last-modified.c does include that header (with the subdir in the
#include directive), it seems coccinelle does not process it. So it's
unaware of the type of `words` in the bitmap, and it doesn't recognize
the rule from previous commit that uses:

    type T;
    T *ptr;

Fix coccicheck by passing all possible include paths inside the Git
project so spatch(1) can find the headers and can determine the types.

Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
contrib/coccinelle/meson.build