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

Re: How do we review changes made with coccinelle?

From
Taylor Blau <me@ttaylorr.com>
Date
Mar 31, 2023, 23:53 UTC
Message-ID
<ZCdyfaiFH5s5eYUc@nand.local>
In-Reply-To
<kl6l7cuycd3n.fsf@chooglen-macbookpro.roam.corp.google.com>
On Thu, Mar 30, 2023 at 11:23:40AM -0700, Glen Choo wrote:
> - When do we introduce .pending.cocci vs .cocci?

The documentation in contrib/coccinelle/README is authoritative. I'll refer you there for the full details, but the rough idea is that:

- *.cocci patches are used to guard against bad patterns in the code
  (e.g., that we should never write "if (thing != NULL)" and instead "if
  (thing)"). When applying these transformations leads to changes, they
  are designed to break the build to avoid letting these bad patterns
  enter our tree.
- *.pending.cocci patches are used to guide large scale refactorings,
  like Ævar demonstrated in his last series. They don't cause us to fail
  the build in the meantime while the refactoring is in progress.

The latter is useful when the refactoring is either (a) too large to fit in a single patch, or (b) would cause too many conflicts with in-flight series.

(FWIW, I think that I'm mixing up my terminology, in that *.cocci files are typically referred to as "transformations" and the result of running Coccinelle on them is used to produce a patch. Shows you how much I know about Coccinelle ;-).)

Thanks, Taylor

Previous: Taylor Blau
Message 6 of 6 in “How do we review changes made with coccinelle?”
  1. Glen ChooMar 30, 2023
  2. Junio C HamanoMar 30, 2023
  3. Glen ChooMar 31, 2023
  4. Junio C HamanoMar 31, 2023
  5. Taylor BlauMar 31, 2023
  6. Taylor BlauMar 31, 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.