diff mbox series

[04/17] cocci: add missing "the_repository" macros to "pending"

Message ID patch-04.17-4b62e9a35a9-20230317T152724Z-avarab@gmail.com (mailing list archive)
State Accepted
Commit 7258e892d2c0f7a615562656e9978f39f610c056
Headers show
Series cocci: remove "the_index" wrapper macros | expand

Commit Message

Ævar Arnfjörð Bjarmason March 17, 2023, 3:35 p.m. UTC
In the case of diff.h, rerere.h and revision.h the macros were added
in [1], [2] and [3] when "the_repository.pending.cocci" didn't
exist. None of the subsequently added migration rules covered
them. Let's add those missing rules.

In the case of macros in "cache.h", "commit.h", "packfile.h",
"promisor-remote.h" and "refs.h" those aren't guarded by
"NO_THE_REPOSITORY_COMPATIBILITY_MACROS", but they're also macros that
add "the_repository" as the first argument, so we should migrate away
from them.

1. 2abf3503854 (revision.c: remove implicit dependency on the_index,
   2018-09-21)
2. e6757652350 (diff.c: remove implicit dependency on the_index,
   2018-09-21)
3. 35843b1123e (rerere.c: remove implicit dependency on the_index,
   2018-09-21)

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 .../coccinelle/the_repository.pending.cocci   | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)

Comments

Elijah Newren March 19, 2023, 6:04 a.m. UTC | #1
On Fri, Mar 17, 2023 at 8:57 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
> In the case of diff.h, rerere.h and revision.h the macros were added
> in [1], [2] and [3] when "the_repository.pending.cocci" didn't
> exist. None of the subsequently added migration rules covered
> them. Let's add those missing rules.
>
> In the case of macros in "cache.h", "commit.h", "packfile.h",
> "promisor-remote.h" and "refs.h" those aren't guarded by
> "NO_THE_REPOSITORY_COMPATIBILITY_MACROS", but they're also macros that
> add "the_repository" as the first argument, so we should migrate away
> from them.

Yaay, nice to see work on migrating away from the_repository again.  :-)

> 1. 2abf3503854 (revision.c: remove implicit dependency on the_index,
>    2018-09-21)
> 2. e6757652350 (diff.c: remove implicit dependency on the_index,
>    2018-09-21)
> 3. 35843b1123e (rerere.c: remove implicit dependency on the_index,
>    2018-09-21)
>
> Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
> ---
>  .../coccinelle/the_repository.pending.cocci   | 70 +++++++++++++++++++
>  1 file changed, 70 insertions(+)
>
> diff --git a/contrib/coccinelle/the_repository.pending.cocci b/contrib/coccinelle/the_repository.pending.cocci
> index 84b79dce480..8b3f2580e6b 100644
> --- a/contrib/coccinelle/the_repository.pending.cocci
> +++ b/contrib/coccinelle/the_repository.pending.cocci
> @@ -5,7 +5,44 @@
>  @@
>  @@
>  (
> +// cache.h
> +- get_oid
> ++ repo_get_oid
> +|
> +- get_oid_commit
> ++ repo_get_oid_commit
> +|
> +- get_oid_committish
> ++ repo_get_oid_committish
> +|
> +- get_oid_tree
> ++ repo_get_oid_tree
> +|
> +- get_oid_treeish
> ++ repo_get_oid_treeish
> +|
> +- get_oid_blob
> ++ repo_get_oid_blob
> +|
> +- get_oid_mb
> ++ repo_get_oid_mb
> +|
> +- find_unique_abbrev
> ++ repo_find_unique_abbrev
> +|
> +- find_unique_abbrev_r
> ++ repo_find_unique_abbrev_r
> +|
> +- for_each_abbrev
> ++ repo_for_each_abbrev
> +|
> +- interpret_branch_name
> ++ repo_interpret_branch_name
> +|
> +- peel_to_type
> ++ repo_peel_to_type
>  // commit-reach.h
> +|
>  - get_merge_bases
>  + repo_get_merge_bases
>  |
> @@ -36,6 +73,13 @@
>  |
>  - logmsg_reencode
>  + repo_logmsg_reencode
> +|
> +- get_commit_tree
> ++ repo_get_commit_tree
> +// diff.h
> +|
> +- diff_setup
> ++ repo_diff_setup
>  // object-store.h
>  |
>  - read_object_file
> @@ -50,6 +94,32 @@
>  |
>  - format_commit_message
>  + repo_format_commit_message
> +// packfile.h
> +|
> +- approximate_object_count
> ++ repo_approximate_object_count
> +// promisor-remote.h
> +|
> +- promisor_remote_reinit
> ++ repo_promisor_remote_reinit
> +|
> +- promisor_remote_find
> ++ repo_promisor_remote_find
> +|
> +- has_promisor_remote
> ++ repo_has_promisor_remote
> +// refs.h
> +|
> +- dwim_ref
> ++ repo_dwim_ref
> +// rerere.h
> +|
> +- rerere
> ++ repo_rerere
> +// revision.h
> +|
> +- init_revisions
> ++ repo_init_revisions
>  )
>    (
>  + the_repository,
> --
> 2.40.0.rc1.1034.g5867a1b10c5

Makes sense.
diff mbox series

Patch

diff --git a/contrib/coccinelle/the_repository.pending.cocci b/contrib/coccinelle/the_repository.pending.cocci
index 84b79dce480..8b3f2580e6b 100644
--- a/contrib/coccinelle/the_repository.pending.cocci
+++ b/contrib/coccinelle/the_repository.pending.cocci
@@ -5,7 +5,44 @@ 
 @@
 @@
 (
+// cache.h
+- get_oid
++ repo_get_oid
+|
+- get_oid_commit
++ repo_get_oid_commit
+|
+- get_oid_committish
++ repo_get_oid_committish
+|
+- get_oid_tree
++ repo_get_oid_tree
+|
+- get_oid_treeish
++ repo_get_oid_treeish
+|
+- get_oid_blob
++ repo_get_oid_blob
+|
+- get_oid_mb
++ repo_get_oid_mb
+|
+- find_unique_abbrev
++ repo_find_unique_abbrev
+|
+- find_unique_abbrev_r
++ repo_find_unique_abbrev_r
+|
+- for_each_abbrev
++ repo_for_each_abbrev
+|
+- interpret_branch_name
++ repo_interpret_branch_name
+|
+- peel_to_type
++ repo_peel_to_type
 // commit-reach.h
+|
 - get_merge_bases
 + repo_get_merge_bases
 |
@@ -36,6 +73,13 @@ 
 |
 - logmsg_reencode
 + repo_logmsg_reencode
+|
+- get_commit_tree
++ repo_get_commit_tree
+// diff.h
+|
+- diff_setup
++ repo_diff_setup
 // object-store.h
 |
 - read_object_file
@@ -50,6 +94,32 @@ 
 |
 - format_commit_message
 + repo_format_commit_message
+// packfile.h
+|
+- approximate_object_count
++ repo_approximate_object_count
+// promisor-remote.h
+|
+- promisor_remote_reinit
++ repo_promisor_remote_reinit
+|
+- promisor_remote_find
++ repo_promisor_remote_find
+|
+- has_promisor_remote
++ repo_has_promisor_remote
+// refs.h
+|
+- dwim_ref
++ repo_dwim_ref
+// rerere.h
+|
+- rerere
++ repo_rerere
+// revision.h
+|
+- init_revisions
++ repo_init_revisions
 )
   (
 + the_repository,