git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 15/17] cocci: apply the "revision.h" part of "the_repository.pending"

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 26, 2023, 04:59 UTC
Message-ID
<230326.86ileow1fu.gmgdl@evledraar.gmail.com>
In-Reply-To
<kl6l5yase416.fsf@chooglen-macbookpro.roam.corp.google.com>
On Wed, Mar 22 2023, Glen Choo wrote:
Show 25 quoted lines
> Glen Choo <chooglen@google.com> writes:
>
>> Ævar Arnfjörð Bjarmason         <avarab@gmail.com> writes:
>>
>>> diff --git a/contrib/coccinelle/the_repository.pending.cocci b/contrib/coccinelle/the_repository.pending.cocci
>>> deleted file mode 100644
>>> index 1190a3312bd..00000000000
>>> --- a/contrib/coccinelle/the_repository.pending.cocci
>>> +++ /dev/null
>>> @@ -1,14 +0,0 @@
>>> -// This file is used for the ongoing refactoring of
>>> -// bringing the index or repository struct in all of
>>> -// our code base.
>> We can't go so far as to say that we've removed all implicit references
>> to "the_repository", though, since we still have functions that
>> reference "the_repository" in their implementations. But, I don't think
>> this ".cocci" file would help us with those cases anyway, since this was
>> targeted specifically at functions/macros that were passing
>> "the_repository" to functions that accepted a "struct repository" arg.
>
> For these implicitly-the_repository functions, (e.g. git_path) we'd
> presumably refactor them into repo_* versions and then apply the same
> sorts of changes we did in this series? I guess we'd make those changes
> in contrib/coccinelle/the_repository.cocci, so we don't need the
> *.pending* one.

Whether we add it to a "pending" or not is just a question of whether the migration is done right away, or left for later.

> On that note, I'm curious what contrib/coccinelle/the_repository.cocci
> is doing for us after this series. By definition, all of the macros have
> been fully migrated, so they're all a noop.

I left them for the benefit of any in-flight conflicts, or semantic conflicts with out-of-tree.

I.e. in such a case you'd keep the other side, then apply the cocci rule, and the result is a semantically correct merge of the two.

> Would this slow down `make coccicheck`?

A bit. It doesn't slow it down by much, as these rules are the simplest to execute, spatch can skip the file if the relevant tokens aren't found in it.

Previous: Glen ChooNext: Ævar Arnfjörð Bjarmason
Message 28 of 60 in “cocci: remove "the_index" wrapper macros”
  1. 00/17 cocci: remove "the_index" wrapper macrosÆvar Arnfjörð Bjarmason, Mar 17, 2023
  2. 02/17 cocci: fix incorrect & verbose "the_repository" rulesÆvar Arnfjörð Bjarmason, Mar 17, 2023
  3. Elijah NewrenMar 19, 2023
  4. Glen ChooMar 22, 2023
  5. Ævar Arnfjörð BjarmasonMar 26, 2023
  6. 01/17 cocci: remove dead rule from "the_repository.pending.cocci"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  7. Eric SunshineMar 17, 2023
  8. Elijah NewrenMar 19, 2023
  9. 03/17 cocci: sort "the_repository" rules by headerÆvar Arnfjörð Bjarmason, Mar 17, 2023
  10. Elijah NewrenMar 19, 2023
  11. 04/17 cocci: add missing "the_repository" macros to "pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  12. Elijah NewrenMar 19, 2023
  13. 08/17 cocci: apply the "diff.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  14. 06/17 cocci: apply the "commit-reach.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  15. 10/17 cocci: apply the "pretty.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  16. 05/17 cocci: apply the "cache.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  17. Elijah NewrenMar 19, 2023
  18. Glen ChooMar 22, 2023
  19. 07/17 cocci: apply the "commit.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  20. 11/17 cocci: apply the "packfile.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  21. 12/17 cocci: apply the "promisor-remote.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  22. 14/17 cocci: apply the "rerere.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  23. 09/17 cocci: apply the "object-store.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  24. 13/17 cocci: apply the "refs.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  25. 15/17 cocci: apply the "revision.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  26. Glen ChooMar 22, 2023
  27. Glen ChooMar 22, 2023
  28. Ævar Arnfjörð BjarmasonMar 26, 2023
  29. 16/17 post-cocci: adjust comments for recent repo_* migrationÆvar Arnfjörð Bjarmason, Mar 17, 2023
  30. Elijah NewrenMar 19, 2023
  31. 17/17 libs: use "struct repository *" argument, not "the_repository"Ævar Arnfjörð Bjarmason, Mar 17, 2023
  32. Elijah NewrenMar 19, 2023
  33. Ævar Arnfjörð BjarmasonMar 28, 2023
  34. Junio C HamanoMar 17, 2023
  35. 00/17 cocci: remove "the_repository" wrapper macrosÆvar Arnfjörð Bjarmason, Mar 28, 2023
  36. 01/17 cocci: remove dead rule from "the_repository.pending.cocci"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  37. 02/17 cocci: fix incorrect & verbose "the_repository" rulesÆvar Arnfjörð Bjarmason, Mar 28, 2023
  38. Taylor BlauMar 29, 2023
  39. 03/17 cocci: sort "the_repository" rules by headerÆvar Arnfjörð Bjarmason, Mar 28, 2023
  40. 04/17 cocci: add missing "the_repository" macros to "pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  41. 06/17 cocci: apply the "commit-reach.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  42. 05/17 cocci: apply the "cache.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  43. 08/17 cocci: apply the "diff.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  44. 07/17 cocci: apply the "commit.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  45. 10/17 cocci: apply the "pretty.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  46. 11/17 cocci: apply the "packfile.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  47. 09/17 cocci: apply the "object-store.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  48. 12/17 cocci: apply the "promisor-remote.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  49. 13/17 cocci: apply the "refs.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  50. 14/17 cocci: apply the "rerere.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  51. 15/17 cocci: apply the "revision.h" part of "the_repository.pending"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  52. 16/17 post-cocci: adjust comments for recent repo_* migrationÆvar Arnfjörð Bjarmason, Mar 28, 2023
  53. Taylor BlauMar 29, 2023
  54. 17/17 libs: use "struct repository *" argument, not "the_repository"Ævar Arnfjörð Bjarmason, Mar 28, 2023
  55. Junio C HamanoMar 28, 2023
  56. Junio C HamanoMar 28, 2023
  57. Junio C HamanoMar 29, 2023
  58. Taylor BlauMar 29, 2023
  59. Elijah NewrenMar 30, 2023
  60. Glen ChooMar 30, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.