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

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

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Apr 16, 2023, 07:42 UTC
Message-ID
<20230416074212.GB3271@szeder.dev>
In-Reply-To
<75feb18dfd8af03f5e7ba02403a16a0ed4c2edaa.1681329955.git.gitgitgadget@gmail.com>
On Wed, Apr 12, 2023 at 08:05:55PM +0000, Glen Choo via GitGitGadget wrote:
Show 38 quoted lines
> From: Glen Choo <chooglen@google.com>
> 
> This isn't set in stone; we expect this to be updated as the project
> evolves.
> 
> Signed-off-by: Glen Choo <chooglen@google.com>
> ---
>  contrib/coccinelle/README | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
> 
> diff --git a/contrib/coccinelle/README b/contrib/coccinelle/README
> index 9b28ba1c57a..055e3622e5c 100644
> --- a/contrib/coccinelle/README
> +++ b/contrib/coccinelle/README
> @@ -92,3 +92,26 @@ that might be useful to developers.
>  
>     The absolute times will differ for you, but the relative speedup
>     from caching should be on that order.
> +
> +== Authoring and reviewing coccinelle changes
> +
> +* When introducing and applying a new .cocci file, both the Git changes and
> +  .cocci file should be reviewed.
> +
> +* 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.
> +
> +* .cocci rules should target only the problem it is trying to solve; "collateral
> +  damage" is not allowed.
> +
> +* .cocci files used for refactoring should be temporarily kept in-tree to aid

How should such semantic patches be kept in-tree? As .pending.cocci? Then I think it would be better to point this out here. Or as a "regular" semantic patch? Then I'm not sure I agree with this recommendation, but perhaps a commit message explaining the reasoning behind this would help me make up my mind :)

It might also be worth mentioning that before submitting a new semantic patch developers should consider its cost-benefit ratio, in particular its effect on the runtime of 'make coccicheck', in the hope that we can avoid another 'unused.cocci' fiasco.

Show 5 quoted lines
> +  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.
> -- 
> gitgitgadget
Previous: Glen Choo via GitGitGadgetNext: Glen Choo
Message 7 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.