Re: [PATCH 0/4] checkpatch: improve exit criterias
From: Bjorn Andersson
Date: Tue Nov 10 2026 - 12:59:19 EST
On Tue, Nov 10, 2026 at 06:54:06AM -0800, Joe Perches wrote:
> On Tue, 2026-11-10 at 07:42 -0600, Bjorn Andersson wrote:
> > On Sun, Nov 8, 2026 at 3:04 AM Joe Perches <joe@xxxxxxxxxxx> wrote:
> > >
> > > On Sun, 2026-11-08 at 04:21 +0000, Bjorn Andersson wrote:
> > > > When invoking checkpatch with the --mailback argument over a range of
> > > > patches the tool unexpectedly exits successfully on the first clean
> > > > patch. For example:
> > > >
> > > > ./scripts/checkpatch.pl --mailback --git v7.3-rc1..
> > >
> > > Why is it useful to do this?
> >
> > My use case is that I create a maintainer branch off e.g. v7.3-rc1
> > (now v7.4-rc1), then apply a bunch of patches and before pushing that
> > out I run "checkpatch.pl --strict v7.3-rc1..".
>
> I think the description for mailback should be changed to
> be used only for a single commit as this proposal would
> otherwise change the exit condition for the single use case no?
>
I don't see a problem with the description, but making --mailback reject
cases where multiple inputs are provided sounds like an alternative
solution to save others from being surprised by this.
That said, it's not clear to me why:
./scripts/checkpatch.pl --strict --git <hash-with-warnings>
exits with status 1, and:
./scripts/checkpatch.pl --strict --mailback --git <hash-with-warnings>
should exit with status 0.
Or why:
./scripts/checkpatch.pl --strict --terse -f missing Makefile
exits with status 0 and omits all the warnings from "Makefile".
The intent with my series was indeed to fix "the single use case"... all
four of them.
> > But this is quite noisy, and the compressed "b4 prep --check" output
> > is more what I'm looking for.
>
> My b4 version is 0.14.3 and the man b4 for prep doesn't include
> a --check option or description so I don't know what that output
> looks like.
>
It effectively looks git "git log --oneline" mixed with the output of
"checkpatch.pl --terse --no-summary".
> > So, I borrowed the "checkpatch.pl -q
> > --terse --no-summary --mailback --showfile" from there and it took me
> > a while to realize the difference between:
> >
> > --mailback only produce a report in case of warnings/errors
> >
> > and "don't produce a report if the first commit is good".
>
> So perhaps just don't use --mailback?
>
Of course, I know that now.
> And remove the --showfile so checkpatch adds the git commit id
> to the output and maybe add a front end little script to do
> the git commit id to commit subject to make it easier to detect
> what commit might need updating?
I'm now using "checkpatch.pl --strict --terse --no-summary --git
<range>" and that gives me the compact output I was looking for.
Regards,
Bjorn