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

Re: [PATCH 01/23] contrib/coccinnelle: add equals-null.cocci

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 30, 2022, 20:56 UTC
Message-ID
<xmqqpmky70jb.fsf@gitster.g>
In-Reply-To
<6e8cd958-b749-0a55-d8ae-ff249f06bd2f@iee.email>
Philip Oakley <philipoakley@iee.email> writes:
Show 14 quoted lines
> On 30/04/2022 05:13, Elia Pinto wrote:
>> Add a coccinelle semantic patch necessary to reinforce the git coding style
>> guideline:
>>
>> "Do not explicitly compute an integral value with constant 0 or '\ 0', or a
>
> s/compute/compare/
>> pointer value with constant NULL."
>
> If this gets re-rolled, perhaps include a simple example for those who
> don't immediately understand that quoted sentence. It will also help
> decode the coccinelle script
>
> so:     `if (ptr == NULL)` becomes `if (!ptr)`  etc.

That is certainly a good suggestion, but I am wondering if we want to also emphasize another more generally applicable rule that appears much earlier in the guideline document:

 - Fixing style violations while working on a real change as a
   preparatory clean-up step is good, but otherwise avoid useless code
   churn for the sake of conforming to the style.
   "Once it _is_ in the tree, it's not really worth the patch noise to
   go and fix it up."
   Cf. http://lkml.iu.edu/hypermail/linux/kernel/1001.3/01069.html
Previous: Philip OakleyNext: Philip Oakley
Message 4 of 38 in “add a new coccinelle semantic patch to enforce a”
  1. 00/23 add a new coccinelle semantic patch to enforce aElia Pinto, Apr 30, 2022
  2. 01/23 contrib/coccinnelle: add equals-null.cocciElia Pinto, Apr 30, 2022
  3. Philip OakleyApr 30, 2022
  4. Junio C HamanoApr 30, 2022
  5. Philip OakleyApr 30, 2022
  6. Junio C HamanoApr 30, 2022
  7. Junio C HamanoMay 1, 2022
  8. Elia PintoMay 1, 2022
  9. Philip OakleyMay 1, 2022
  10. Junio C HamanoMay 1, 2022
  11. Elia PintoMay 1, 2022
  12. Junio C HamanoMay 2, 2022
  13. Philip OakleyMay 2, 2022
  14. Junio C HamanoMay 2, 2022
  15. Carlo Marcelo Arenas BelónMay 2, 2022
  16. 02/23 apply.c: Fix coding styleElia Pinto, Apr 30, 2022
  17. 03/23 archive.c: Fix coding styleElia Pinto, Apr 30, 2022
  18. 04/23 blame.c: Fix coding styleElia Pinto, Apr 30, 2022
  19. 05/23 branch.c: Fix coding styleElia Pinto, Apr 30, 2022
  20. 08/23 builtin/clone.c: Fix coding styleElia Pinto, Apr 30, 2022
  21. 07/23 builtin/checkout.c: Fix coding styleElia Pinto, Apr 30, 2022
  22. 06/23 builtin/bisect--helper.c: Fix coding styleElia Pinto, Apr 30, 2022
  23. Christian CouderMay 3, 2022
  24. 09/23 builtin/commit.c: Fix coding styleElia Pinto, Apr 30, 2022
  25. 11/23 builtin/gc.c: Fix coding styleElia Pinto, Apr 30, 2022
  26. 10/23 builtin/diff.c: Fix coding styleElia Pinto, Apr 30, 2022
  27. 12/23 builtin/index-pack.c: Fix coding styleElia Pinto, Apr 30, 2022
  28. 13/23 builtin/log.c: Fix coding styleElia Pinto, Apr 30, 2022
  29. 14/23 builtin/ls-remote.c: Fix coding styleElia Pinto, Apr 30, 2022
  30. 16/23 builtin/pack-redundant.c: Fix coding styleElia Pinto, Apr 30, 2022
  31. 15/23 builtin/mailsplit.c: Fix coding styleElia Pinto, Apr 30, 2022
  32. 18/23 builtin/replace.c: Fix coding styleElia Pinto, Apr 30, 2022
  33. 20/23 builtin/shortlog.c: Fix coding styleElia Pinto, Apr 30, 2022
  34. 19/23 builtin/rev-parse.c: Fix coding styleElia Pinto, Apr 30, 2022
  35. 17/23 builtin/receive-pack.c: Fix coding styleElia Pinto, Apr 30, 2022
  36. 21/23 builtin/tag.c: Fix coding styleElia Pinto, Apr 30, 2022
  37. 23/23 commit-graph.c: Fix coding styleElia Pinto, Apr 30, 2022
  38. 22/23 combine-diff.c: Fix coding styleElia Pinto, Apr 30, 2022

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.