cocci: avoid "should ... be a metavariable" warnings

Since [1] running "make coccicheck" has resulted in [2] being emitted to the *.log files for the "spatch" run, and in the case of "make coccicheck-test" we'd emit these to the user's terminal. Nothing was broken as a result, but let's refactor the relevant rules to eliminate the ambiguity between a possible variable and an identifier. 1. 0e6550a2c63 (cocci: add a index-compatibility.pending.cocci, 2022-11-19) 2. warning: line 257: should active_cache be a metavariable? warning: line 260: should active_cache_changed be a metavariable? warning: line 263: should active_cache_tree be a metavariable? warning: line 271: should active_nr be a metavariable? Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Nov 30, 2022 at 09:28 UTC cddd68ae33667c4bfc81c81f74815bb2ba0e4f3a
1 file changed +8 -4
contrib/coccinelle/index-compatibility.cocci
+8 -4
@@ -1,22 +1,26 @@
1 // the_index.* variables
2 @@
3 +identifier AC = active_cache;
4 +identifier ACC = active_cache_changed;
5 +identifier ACT = active_cache_tree;
6 @@
7 (
5 -- active_cache
8 +- AC
9 + the_index.cache
10 |
8 -- active_cache_changed
11 +- ACC
12 + the_index.cache_changed
13 |
11 -- active_cache_tree
14 +- ACT
15 + the_index.cache_tree
16 )
17
18 @@
19 +identifier AN = active_nr;
20 identifier f != prepare_to_commit;
21 @@
22 f(...) {<...
19 -- active_nr
23 +- AN
24 + the_index.cache_nr
25 ...>}
26