From nobody Sun Feb 8 05:19:57 2026 Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EF06399038 for ; Fri, 16 Jan 2026 17:43:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768585386; cv=none; b=YCGqRI8/lXV/DEnHEZei+lYtgdQtuOsIq7nJ7tWhmtucS3TFl69w8vIAizCVuc22JOREPNg5+FK9ktOI1Z2Xu8aCa+hz7CnpZHAfEQvDfhu/ciWaIb5iUoNkd2JIUCBNgO8NuJZZtDaLFBDDSkpEJkcVW84tJVj+tYSQfoedQdc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768585386; c=relaxed/simple; bh=Aw8mVe/gtPhzLev0v9PCaXMFAQc2LP8HguT/Dgc+zTM=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=XcQrnocq21pVNEl/1I+f7rdoTdFI1CvY7XTD+miqToQfuW/nQsq1Lm3DooP/s9Lg1zkCO2YvC+dzcrq6n+tQqacFYkGqmZO0l+ATygoJVBc2OdUIy1nGVK+r50Tmdg/p6NXPq+Dtpgvd8pvDF7r+2GkideJo3fEmDNFZOR7D/Pg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com; spf=pass smtp.mailfrom=perches.com; arc=none smtp.client-ip=216.40.44.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=perches.com Received: from omf09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CE01E89679; Fri, 16 Jan 2026 17:42:55 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf09.hostedemail.com (Postfix) with ESMTPA id 87EBB2002E; Fri, 16 Jan 2026 17:42:53 +0000 (UTC) Message-ID: <6ec1ed08328340db42655287afd5fa4067316b11.camel@perches.com> Subject: [PATCH] checkpatch: Add an invalid patch separator test From: Joe Perches To: Andrew Morton , Ian Rogers Cc: Kuan-Wei Chiu , Dwaipayan Ray , Lukas Bulwahn , Stephen Rothwell , Andy Whitcroft , linux-kernel@vger.kernel.org, Namhyung Kim Date: Fri, 16 Jan 2026 09:42:52 -0800 In-Reply-To: <20260113193319.701e5799059eb642bbfc9a04@linux-foundation.org> References: <20251205053457.8556-1-irogers@google.com> <195a2cba2b461a0ab99ae004bdf079b038db8b07.camel@perches.com> <45e299a4c4326d46360955758df7d3df58613255.camel@perches.com> <20260113193319.701e5799059eb642bbfc9a04@linux-foundation.org> Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Stat-Signature: 1ue95th74a6e5uxn1jxutxjk585cph4m X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: 87EBB2002E X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX18mZOxXYHxLYFG/1tOUI5IG5HkAzCMIieI= X-HE-Tag: 1768585373-829493 X-HE-Meta: U2FsdGVkX1/1c3mbEU1ZSyx+uyoj3KeZgvM53HzhnPxH0S4XUStSq4hbt4smHD5G+nktVzq+RXo706xVAHb4q62kFh/FpGlyIlnKcjPYstSAvqO3/EPVwe+Isng8zMXkazNnzRxVUcfNeTCBG/UaVjSnQq6+ESk6NAer49Q2+ZExwVL3Vl0ikMl5RoMxGtZTtjPhzI/W6gqZq6n2zcZYe3L8ejB/A53RLccIqE9Zi4pQzMNRVCIZ9f/WGFzPxWpmlHtzeex5TQdShp+TnGKJfW5BPr0pmblX3UmG40uOOb3Z0XJsGABRkgdEfFMS8LGSkAo6YsMfZpMEidCrK8z8egw0WPvnfDijACZni92wq6whQm4vFPKdXTa5WhxO+NA8quyO3R7F9u81vod1SByfiX1HCEycA341FIpqrTV0a92IEtOzcvl3oWWeFgFvg9AkQFaAS0Ao+Xs= Content-Type: text/plain; charset="utf-8" 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. Signed-off-by: Joe Perches --- Documentation/dev-tools/checkpatch.rst | 5 +++++ scripts/checkpatch.pl | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-too= ls/checkpatch.rst index ca475805df4c8..dccede68698ca 100644 --- a/Documentation/dev-tools/checkpatch.rst +++ b/Documentation/dev-tools/checkpatch.rst @@ -601,6 +601,11 @@ Commit message =20 See: https://www.kernel.org/doc/html/latest/process/submitting-patches= .html#describe-your-changes =20 + **BAD_COMMIT_SEPARATOR** + The commit separator is a single line with 3 dashes. + The regex match is '^---$' + Lines that start with 3 dashes and have more content on the same line + may confuse tools that apply patches. =20 Comparison style ---------------- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e0f1d6a6bc636..a11f88d11edd8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3035,6 +3035,16 @@ sub process { } } =20 +# Check for invalid patch separator + if ($in_commit_log && + $line =3D~ /^---.+/) { + if (ERROR("BAD_COMMIT_SEPARATOR", + "Invalid commit separator - some tools may have problems applying th= is\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =3D~ s/-/=3D/g; + } + } + # Check for patch separator if ($line =3D~ /^---$/) { $has_patch_separator =3D 1;