[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fWR+Mwme6ogL6=WQG8gJ2J+wHkva8wBHdCrfiX57nijfw@mail.gmail.com>
Date: Wed, 14 Jan 2026 11:01:24 -0800
From: Ian Rogers <irogers@...gle.com>
To: Joe Perches <joe@...ches.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Kuan-Wei Chiu <visitorckw@...il.com>,
Dwaipayan Ray <dwaipayanray1@...il.com>, Lukas Bulwahn <lukas.bulwahn@...il.com>,
Stephen Rothwell <sfr@...b.auug.org.au>, Andy Whitcroft <apw@...onical.com>, linux-kernel@...r.kernel.org,
Namhyung Kim <namhyung@...nel.org>
Subject: Re: [PATCH v1] checkpatch: Warn about sign offs if there's an
accidental patch separator
On Wed, Jan 14, 2026 at 10:20 AM Joe Perches <joe@...ches.com> 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
Powered by blists - more mailing lists