Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-11-19 16:07:34 +0300
committerJunio C Hamano <gitster@pobox.com>2022-11-21 06:06:15 +0300
commitdc594180d9e62438cb664c678f5e5bd229154c75 (patch)
tree10b94b968ae39d1f78cdac0fdaa3238f744f5c41 /contrib/coccinelle
parent031b2033e0b5c6276bbd93f276e1698f925fb498 (diff)
cocci & cache.h: apply variable section of "pending" index-compatibility
Mostly apply the part of "index-compatibility.pending.cocci" that renames the global variables like "active_nr", which are a shorthand to referencing (in that case) a struct member as "the_index.cache_nr". In doing so move more of "index-compatibility.pending.cocci" to "index-compatibility.cocci". In the case of "active_nr" we'd have a textual conflict with "ab/various-leak-fixes" in "next"[1]. Let's exclude that specific case while moving the rule over from "pending". 1. 407b94280f8 (commit: discard partial cache before (re-)reading it, 2022-11-08) Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/coccinelle')
-rw-r--r--contrib/coccinelle/index-compatibility.cocci22
-rw-r--r--contrib/coccinelle/index-compatibility.pending.cocci17
2 files changed, 22 insertions, 17 deletions
diff --git a/contrib/coccinelle/index-compatibility.cocci b/contrib/coccinelle/index-compatibility.cocci
index 89c1898616..8b1ed65e7b 100644
--- a/contrib/coccinelle/index-compatibility.cocci
+++ b/contrib/coccinelle/index-compatibility.cocci
@@ -1,3 +1,25 @@
+// the_index.* variables
+@@
+@@
+(
+- active_cache
++ the_index.cache
+|
+- active_cache_changed
++ the_index.cache_changed
+|
+- active_cache_tree
++ the_index.cache_tree
+)
+
+@@
+identifier f != prepare_to_commit;
+@@
+ f(...) {<...
+- active_nr
++ the_index.cache_nr
+ ...>}
+
// "the_repository" simple cases
@@
@@
diff --git a/contrib/coccinelle/index-compatibility.pending.cocci b/contrib/coccinelle/index-compatibility.pending.cocci
index cf1ea57d70..8207aee62c 100644
--- a/contrib/coccinelle/index-compatibility.pending.cocci
+++ b/contrib/coccinelle/index-compatibility.pending.cocci
@@ -1,20 +1,3 @@
-// the_index.* variables
-@@
-@@
-(
-- active_cache
-+ the_index.cache
-|
-- active_nr
-+ the_index.cache_nr
-|
-- active_cache_changed
-+ the_index.cache_changed
-|
-- active_cache_tree
-+ the_index.cache_tree
-)
-
// "the_repository" simple cases
@@
@@