Re: [PATCH v1] checkpatch: Warn about sign offs if there's an accidental patch separator

From: Joe Perches

Date: Wed Jan 14 2026 - 13:20:41 EST


On Tue, 2026-01-13 at 19:33 -0800, Andrew Morton wrote:
> I was bitten by this recently. Someone's changelog had
>
> ----------- stuff here
>
> and git-quiltimport remove half the changelog and all the metadata.
>
> git is wrong. I say so coz I invented the --- convention.
> submitting-patches.rst says
>
> - A marker line containing simply ``---``.
>
> The astonishingly old https://www.ozlabs.org/~akpm/stuff/tpp.txt says
> "... scripts will treat a ^--- string as ...". I regret not
> explicitly using "^---$".
>
> I'd like checkpatch to emit a warning in this case. If a line starts
> with --- then please let's warn the user that downstream tooling will
> screw this up.

Maybe something like this:
---
scripts/checkpatch.pl | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e0f1d6a6bc636..8dd58710302bc 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3035,6 +3035,14 @@ sub process {
}
}

+# Check for invalid patch separator
+ if ($in_commit_log &&
+ $line =~ /^---.+/) {
+ ERROR("BAD_PATCH_SEPARATOR",
+ "Invalid patch separator - some tools may have problems applying this\n" . $herecurr)
+ }
+
+
# Check for patch separator
if ($line =~ /^---$/) {
$has_patch_separator = 1;