Re: [PATCH v1] checkpatch: Warn about sign offs if there's an accidental patch separator
From: Ian Rogers
Date: Wed Jan 14 2026 - 14:01:38 EST
On Wed, Jan 14, 2026 at 10:20 AM Joe Perches <joe@xxxxxxxxxxx> wrote:
>
> 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;
Sgtm, it still seems potentially error prone that sign offs are
counted even when not in the commit message. ie this bit of this
patch:
```
# Check the patch for a signoff:
- if ($line =~ /^\s*signed-off-by:\s*(.*)/i) {
+ if (!$is_patch && $line =~ /^\s*signed-off-by:\s*(.*)/i) {
$signoff++;
$in_commit_log = 0;
if ($author ne '' && $authorsignoff != 1) {
```
Thanks,
Ian