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

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

From
Glen Choo <chooglen@google.com>
Date
Apr 19, 2023, 19:29 UTC
Message-ID
<kl6lzg731xib.fsf@chooglen-macbookpro.roam.corp.google.com>
In-Reply-To
<20230416074212.GB3271@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 10 quoted lines
>> +* .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 :)

I don't feel strongly about this, but I was envisioning keeping them as a "regular" patch, e.g. what Ævar proposed in:

  https://lore.kernel.org/git/230326.86ileow1fu.gmgdl@evledraar.gmail.com/

In theory, this means that a long running fork (that didn't get updated during the initial refactor) can run coccicheck, notice the failure, and then automatically fix themselves with the included semantic patch. In practice, I don't know how many forks run coccicheck, or whether these refactors are just easy enough to do by hand.

For refactors, I suspect that the impact on the 'make coccicheck' runtime will be low, since we're typically targeting just a few tokens and cocci can skip whatever files don't have those tokens, so keeping it as a "regular" patch might be okay.

> 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',

Makes sense, though I'm not sure what practical advice to give in order to evaluate the impact on runtime (besides just running it themselves).

> in the hope
> that we can avoid another 'unused.cocci' fiasco.

Maybe this is a good starting point for discussing cost-benefit analysis. I'm not familiar with this fiasco, though. Was an early version of 'unused.cocci' too broad, resulting in a massive hit to runtime?

Previous: SZEDER GáborNext: SZEDER Gábor
Message 8 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.