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

[PATCH v2 0/2] cocci: codify authoring and reviewing practices

From
Glen Choo via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 27, 2023, 22:22 UTC
Message-ID
<pull.1495.v2.git.git.1682634143.gitgitgadget@gmail.com>
In-Reply-To
<pull.1495.git.git.1681329955.gitgitgadget@gmail.com>
Thanks for the input on v1, all :)

I've tried to capture all of the discussion in some form. AFAICT, the result is quite similar to what we are already doing, so it might not be very helpful to folks who have already worked with Coccinelle, but it should hopefully be useful to newcomers.

I suspect that we won't converge on any new practices during this discussion, but as we develop practices in the future, we can just update this doc.

Glen Choo (2):
  cocci: add headings to and reword README
  cocci: codify authoring and reviewing practices
 contrib/coccinelle/README | 40 +++++++++++++++++++++++++++++++++++----
 1 file changed, 36 insertions(+), 4 deletions(-)
base-commit: f285f68a132109c234d93490671c00218066ace9
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1495%2Fchooglen%2Fpush-lsxuouxyokwo-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1495/chooglen/push-lsxuouxyokwo-v2
Pull-Request: https://github.com/git/git/pull/1495
Range-diff vs v1:
 1:  4a8b8a2a674 = 1:  4a8b8a2a674 cocci: add headings to and reword README
 2:  75feb18dfd8 ! 2:  acee642531a cocci: codify authoring and reviewing practices
     @@ Metadata
       ## Commit message ##
          cocci: codify authoring and reviewing practices
      
     -    This isn't set in stone; we expect this to be updated as the project
     -    evolves.
     +    These practices largely reflect what we are already doing on the mailing
     +    list, which should help new Coccinelle authors and reviewers get up to
     +    speed.
      
          Signed-off-by: Glen Choo <chooglen@google.com>
      
     @@ contrib/coccinelle/README: that might be useful to developers.
      +
      +== Authoring and reviewing coccinelle changes
      +
     -+* When introducing and applying a new .cocci file, both the Git changes and
     -+  .cocci file should be reviewed.
     ++* When a .cocci is made, both the Git changes and .cocci file should be
     ++  reviewed. When reviewing such a change, do your best to understand the .cocci
     ++  changes (e.g. by asking the author to explain the change) and be explicit
     ++  about your understanding of the changes. This helps us decide whether input
     ++  from coccinelle experts is needed or not. If you aren't sure of the cocci
     ++  changes, indicate what changes you actively endorse and leave an Acked-by
     ++  (instead of Reviewed-by).
      +
     -+* Reviewers do not need to be coccinelle experts. To give a Reviewed-By, it is
     -+  enough for the reviewer to get a rough understanding of the proposed rules by
     -+  comparing the .cocci and Git changes, then checking that understanding
     -+  with the author.
     -+
     -+* Conversely, authors should consider that reviewers may not be coccinelle
     -+  experts. The primary aim should be to make .cocci files easy to understand,
     -+  e.g. by adding comments or by using rules that are easier to understand even
     -+  if they are less elegant.
     ++* Authors should consider that reviewers may not be coccinelle experts, thus the
     ++  the .cocci changes may not be self-evident. A plain text description of the
     ++  changes is strongly encouraged, especially when using more esoteric features
     ++  of the language.
      +
      +* .cocci rules should target only the problem it is trying to solve; "collateral
     -+  damage" is not allowed.
     ++  damage" is not allowed. Reviewers should look out and flag overly-broad rules.
     ++
     ++* Consider the cost-benefit ratio of .cocci changes. In particular, consider the
     ++  effect on the runtime of "make coccicheck", and how often your .cocci check
     ++  will catch something valuable. As a rule of thumb, rules that can bail early
     ++  if a file doesn't have a particular token will have a small impact on runtime,
     ++  and vice-versa.
      +
      +* .cocci files used for refactoring should be temporarily kept in-tree to aid
     -+  the refactoring of out-of-tree code (e.g. in-flight topics). They should be
     -+  removed when enough time has been given for others to refactor their code,
     -+  i.e. ~1 release cycle.
     ++  the refactoring of out-of-tree code (e.g. in-flight topics). Periodically
     ++  evaluate the cost-benefit ratio to determine when the file should be removed.
     ++  For example, consider how many out-of-tree users are left and how much this
     ++  slows down "make coccicheck".
-- 
gitgitgadget
Previous: Junio C HamanoNext: Glen Choo via GitGitGadget
Message 19 of 26 in “cocci: codify authoring and reviewing practices”
  1. 0/2 cocci: codify authoring and reviewing practicesGlen Choo via GitGitGadget, Apr 12, 2023
  2. 1/2 cocci: add headings to and reword READMEGlen Choo via GitGitGadget, Apr 12, 2023
  3. Junio C HamanoApr 12, 2023
  4. Glen ChooApr 13, 2023
  5. Junio C HamanoApr 13, 2023
  6. 2/2 cocci: codify authoring and reviewing practicesGlen Choo via GitGitGadget, Apr 12, 2023
  7. SZEDER GáborApr 16, 2023
  8. Glen ChooApr 19, 2023
  9. cocci: remove 'unused.cocci'SZEDER Gábor, Apr 20, 2023
  10. Junio C HamanoApr 21, 2023
  11. Ævar Arnfjörð BjarmasonMay 1, 2023
  12. Junio C HamanoMay 1, 2023
  13. Ævar Arnfjörð BjarmasonMay 1, 2023
  14. Junio C HamanoMay 10, 2023
  15. Ævar Arnfjörð BjarmasonApr 16, 2023
  16. Glen ChooApr 19, 2023
  17. Elijah NewrenApr 15, 2023
  18. Junio C HamanoApr 17, 2023
  19. 0/2 cocci: codify authoring and reviewing practicesGlen Choo via GitGitGadget, Apr 27, 2023
  20. 1/2 cocci: add headings to and reword READMEGlen Choo via GitGitGadget, Apr 27, 2023
  21. Ævar Arnfjörð BjarmasonMay 1, 2023
  22. Junio C HamanoMay 1, 2023
  23. Felipe ContrerasMay 2, 2023
  24. Felipe ContrerasMay 2, 2023
  25. Glen ChooMay 9, 2023
  26. 2/2 cocci: codify authoring and reviewing practicesGlen Choo via GitGitGadget, Apr 27, 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.