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

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

From
Philip Oakley <philipoakley@iee.email>
Date
May 1, 2022, 17:22 UTC
Message-ID
<d996dc46-ae9a-6506-8043-0ac5468d9dd4@iee.email>
In-Reply-To
<CA+EOSBnx3-G02=zXGUrRuKPTDPBSYoBY=rERCORe8NtywEOiGg@mail.gmail.com>
On 01/05/2022 18:04, Elia Pinto wrote:
Show 15 quoted lines
> Il giorno dom 1 mag 2022 alle ore 02:20 Junio C Hamano
> <gitster@pobox.com> ha scritto:
>> What I found curious is that the result of applying these patches to
>> v2.36.0 and running coccicheck reveals that we are not making the
>> codebase clean wrt this new coccinelle rule.
>>
> It is possible, I did not use coccicheck to apply the semantic patch
> (on next)  but i use a my script which I think is slightly more
> efficient but perhaps it is not so correct. Anyway, given the
> discussion that has taken place so far, what do you think is best for
> me to do? Do a reroll (perhaps with only 2 patches in total ) or wait
> for the "right" moment in the future as foreseen by the Documentation
> and dedicate the time to more useful contributions for git? Thank you
> all for the review
>
Hi Elia,

Given Junio's comment regarding the potential for patch churn, it may, as an alternative, be possible to create a script that will check/extract just those those changes that are either:

A) mistakes in patches between say master and seen `master..seen` so that they aren't incorporated, though `next..seen` may be more appropriate.

B) detect 'while you are at it' fixes that could be applied to a file that is being modified with the same range query. The file fix-up patch could/would then be inserted as preparatory step to the relevant series (i.e. fed to the series author), allowing easy reversion with/without the fix-up.

C) suggest to coccinelle that maybe they include a similar Git based range check option, to avoid needing a fancy script [using Junio's rationale].

D) more clearly identify _why_ the particular instances that are corrected are _worth_ changing now (e.g. fixing _one_ may be a worthy GSOC or Outreachy activity, or .. <insert own reasons>).

 Hope that helps.
Philip
Show 10 quoted lines
>> diff -u -p a/compat/fsmonitor/fsm-listen-darwin.c b/compat/fsmonitor/fsm-listen-darwin.c
>> --- a/compat/fsmonitor/fsm-listen-darwin.c
>> +++ b/compat/fsmonitor/fsm-listen-darwin.c
>> @@ -342,7 +342,7 @@ int fsm_listen__ctor(struct fsmonitor_da
>>                                            data->cfar_paths_to_watch,
>>                                            kFSEventStreamEventIdSinceNow,
>>                                            0.001, flags);
>> -       if (data->stream == NULL)
>> +       if (!data->stream)
>>                 goto failed;
[snipped]
Previous: Elia PintoNext: Junio C Hamano
Message 9 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.