Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

checkpatch: add an invalid patch separator test

Some versions of tools that apply patches incorrectly allow lines that
start with 3 dashes and have additional content on the same line.

Checkpatch will now emit an ERROR on these lines and optionally convert
those lines from dashes to equals with --fix.

Link: https://lkml.kernel.org/r/6ec1ed08328340db42655287afd5fa4067316b11.camel@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Suggested-by: Ian Rogers <irogers@google.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Kuan-Wei Chiu <visitorckw@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Namhyung kim <namhyung@kernel.org>
Cc: Stehen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Joe Perches and committed by
Andrew Morton
931d5c36 2eec08ff

+15
+5
Documentation/dev-tools/checkpatch.rst
··· 601 601 602 602 See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes 603 603 604 + **BAD_COMMIT_SEPARATOR** 605 + The commit separator is a single line with 3 dashes. 606 + The regex match is '^---$' 607 + Lines that start with 3 dashes and have more content on the same line 608 + may confuse tools that apply patches. 604 609 605 610 Comparison style 606 611 ----------------
+10
scripts/checkpatch.pl
··· 3031 3031 } 3032 3032 } 3033 3033 3034 + # Check for invalid patch separator 3035 + if ($in_commit_log && 3036 + $line =~ /^---.+/) { 3037 + if (ERROR("BAD_COMMIT_SEPARATOR", 3038 + "Invalid commit separator - some tools may have problems applying this\n" . $herecurr) && 3039 + $fix) { 3040 + $fixed[$fixlinenr] =~ s/-/=/g; 3041 + } 3042 + } 3043 + 3034 3044 # Check for patch separator 3035 3045 if ($line =~ /^---$/) { 3036 3046 $has_patch_separator = 1;