From: Jeff King <peff@peff.net>
To: Patrick Steinhardt <ps@pks.im>
Cc: Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org, tnyman@openai.com,
Taylor Blau <me@ttaylorr.com>, Elijah Newren <newren@gmail.com>
Subject: Re: [PATCH 2/2] ci: bump ubuntu image version for static-analysis job
Date: Sat, 5 Sep 2026 09:44:24 -0400 [thread overview]
Message-ID: <20260905134424.GA3914039@coredump.intra.peff.net> (raw)
In-Reply-To: <anqs8mT78znJmUwJ@pks.im>
On Tue, Aug 11, 2026 at 07:02:42AM +0200, Patrick Steinhardt wrote:
> On Mon, Aug 10, 2026 at 10:52:21AM -0700, Junio C Hamano wrote:
> > Patrick Steinhardt <ps@pks.im> writes:
> >
> > > Taking a step back, I do have to wonder whether the Cocci files have
> > > been adding any kind of value in the first place. I myself introduced
> > > some of them in contexts where I made sweeping changes to our APIs, so
> > > that any in-flight topics can be trivially adjusted via Coccinelle. But
> > > I very much doubt that anyone ever used those to adapt their in-flight
> > > patch series at all.
> > >
> > > So maybe we should just not do that anymore?
> >
> > We still do catch when somebody writes "if (a == NULL)", no?
>
> Yes! What I was trying to say is that we maybe shouldn't add Cocci files
> for temporary migrations anymore, but still keep (and extend) them for
> evertyhing where we want to consistently catch antipatterns going
> forward.
>
> Overall I have a feeling that I'm overthinking this though :) Maybe it
> ultimately doesn't matter too much and we just continue what we're doing
> and then clean up every once in a while when too much cruft has
> accumulated.
FWIW, I'd be happy to avoid coccinelle for transitions. The most
important thing is for transitions to be brought to the developer's
attention at all, so we don't quietly produce broken programs or
continue adding callers of interfaces we're trying to get rid of.
But bringing attention is often done trivially via the compiler (e.g.,
changing names or interfaces). Coccinelle can further suggest the actual
fix, but most of the time that fix is either obvious, or easily
explained in the commit message (and I feel like if any project can do
so, we should be able to assume people can use pickaxe/blame to find the
source of a change).
So coccinelle can save some work in these cases, but I think it is a net
loss overall compared to both the effort in writing the semantic
patches, as well as the operational headaches.
I do think there's still enough value in the enforcement of rules that
can't easily be caught by the compiler. Style bits like "a == NULL" are
an obvious example, but I think we have some "we offer functions X and
Y, but you should usually use X unless you have a good reason". Though
maybe even some of those can be simplified (stuff like oidclr() should
be preferred over hashclr(), but maybe we are at a point where hashclr()
can become a private function?).
-Peff
next prev parent reply other threads:[~2026-09-05 13:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-26 8:32 [PATCH 0/2] bump static-analysis ci image version Jeff King
2026-07-26 8:37 ` [PATCH 1/2] bloom: silence CHECK_ASSERTION_SIDE_EFFECTS false positive Jeff King
2026-07-26 8:39 ` [PATCH 2/2] ci: bump ubuntu image version for static-analysis job Jeff King
2026-08-07 10:24 ` Patrick Steinhardt
2026-08-07 16:16 ` Junio C Hamano
2026-08-10 5:38 ` Patrick Steinhardt
2026-08-10 17:52 ` Junio C Hamano
2026-08-11 5:02 ` Patrick Steinhardt
2026-09-05 13:44 ` Jeff King [this message]
2026-08-07 16:47 ` Elijah Newren
2026-08-08 17:31 ` SZEDER Gábor
2026-09-05 13:52 ` Jeff King
2026-07-26 16:34 ` [PATCH 0/2] bump static-analysis ci image version Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260905134424.GA3914039@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=me@ttaylorr.com \
--cc=newren@gmail.com \
--cc=ps@pks.im \
--cc=tnyman@openai.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox