[PATCH 0/4] checkpatch: improve exit criterias
From: Bjorn Andersson
Date: Sat Nov 07 2026 - 23:23:25 EST
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..
Checks the single commit and then exits successfully. In contrast,
omitting --mailback causes checkpatch to check the thousands of commits
in the range.
The same behavior can be observed with --no-patch or when empty patches
are involved, which exits successfully after the first non-patch has
passed the checks, either skipping further checks or failing to return a
non-zero exit value even though errors has been reported.
Lastly, checkpatch fails with a non-zero status when invoked on a
missing patch file, but zero when invoked on a missing file.
---
Bjorn Andersson (4):
checkpatch: don't stop at the first clean patch with --mailback
checkpatch: don't stop at the first non-patch input with --no-patch
checkpatch: don't stop at the first empty input
checkpatch: fail on missing or unreadable files with --file
scripts/checkpatch.pl | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
---
base-commit: ddfe51b0a0f5dc9e415cc2c8ad8db17532dd426b
change-id: 20261108-checkpatch-fixes-hash-0466f2c1d2e4
Best regards,
--
Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxxxx>