From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC1B134AAF0 for ; Fri, 5 Dec 2025 07:22:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764919357; cv=none; b=P0PQQbVy4Q9l6Eb55l1HPVYBtGOgmDfzNKYpxrU/mRcNE64RBY2+vYYl3slmSEqm4o4Se6MCdTA+p5Bvo1i0UXP5I8Eayu3BUITQ+yEZq4l6FVgm4i+/oAMQJm7D1FTQpYq72WtU6ZLZF6p6kDZokoCyK4yTgIz6tZUAHAo4Y1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764919357; c=relaxed/simple; bh=+qKUPLAJxhKHkS6feKbvVfgnui2uK6LIMim2ngdTfSg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Mr3zZYasDHcnIPxIjtKIG9+CGfEY5mVz9kw2Sr8PPypcnAKJ7rIz+g+0BH3clwVMnb1glP2E/oolbFbYUPRQQ18Cge1ZDxLoX7sZpx8VYYCZcp/8zYYjKYba39/DVpfVpxhDKWLKXANyxWqCXxx4g2SGN4VbtC7sMjTtyNKt0GI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YQeCqJZp; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YQeCqJZp" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2955623e6faso24198935ad.1 for ; Thu, 04 Dec 2025 23:22:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764919343; x=1765524143; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=aQAD6sFOV8BV3H1pXPqv/nNhFt43++ZNlJG5GlxVPtc=; b=YQeCqJZpQfNXsXTRHHun52il9pA4ZqORcoSsiz6/IfuBHFjPDeatbaEemqc6fAdsgS V8VLRiWxQJUSaPB/zYjq+eNy4pY043EViuHxiEANptkbEMEXxtg8SItaMNr65PCXgUT9 agmYpDZCvL6mjdIKvLWQ3f15AJtrDRDWDFbmqaAO5Q5hYkrZ6OKeeuoaK7JXjI6YeAOT jgf6IyvTPkXG/e2Y8DtGw1qZ9Rj0Mc5Ytk7zHOwaSuNUSh1WPGBzHTaN0ZspEBjM+oyJ uMyIUJwSIaUH9rFH9ab6vqiifzmuCMlXzxj4jNaAnov50vheD0s1eADIAJsSm3asufiP maKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764919343; x=1765524143; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aQAD6sFOV8BV3H1pXPqv/nNhFt43++ZNlJG5GlxVPtc=; b=mFtyd6WCX/iK6lcnfuvrTPdd78Y8/VkQ64koeyWBng4MP2y0CXrqMr4nd4fOQ8vz0R zICHQyfH3Cqz7rfndmaM5iVEZfZxtvYEXDyn/+i5U1TA1k6/VAdXGRMj1LbMZPY8kH40 KaWHySKNxV0NCusnzpo5pIFB1jH7MkNwkEqxrqps2pcXnBX/iN/AxKOcEfEg2FjGh9ZP 9uGWdUFMYp4j3VG5kkSlG2x/ryH++sX3yoCpjn/Jc9Ryj+nVlvCqCKV19MdbU0e29Gd5 pxp/X+g+oh7ijmjuiU0sRtM9zIdj48RHl3Ewbyv2HcIoDYU5CGvCx374Qld3TEg/4RVS aaHg== X-Forwarded-Encrypted: i=1; AJvYcCWVzEbB7kzt9SLTkHrN/Lu9Jpopy1+HTdflVSQrFbfVDvuJtrGwEZdgs1ja2WuXnlRWtb41jsI4IHVF0sE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx3tYZIMJbGuYd9dWvNvDLhSHCC3MkfUiBABr7f9NlxIgAzFM0c 153M/umRpgpoYUAVNHfO/Ke7yfzElJvWSZCjPuQ5XCxVc5pUyPLTVJKG X-Gm-Gg: ASbGnctY3tvu1+S5t59ZCttr07CL+JWbB53n4EOaUSPK8D1M2jh2tekAOpUb1w2oYMl K9jRh31BDwoJv9baSzV7BW9FkGhSr8e3i4sll8Dr4CKdY2X4DUfgeS557obAUizZskYgpcBLbk+ 6JBkU/zIVDIg4s4o5bbfztTD8l428VBRykflN9vY3KSABpJNcgGtAs0/ryzzKxmvU2kTSvsgByV L9z/srdUL/se+vrmrQsbpRWBpGBWLOTVdBkgZqzDgY7hfKpJAUN0tSbQJcmT+GkEsydi01MQe11 BszbPyMzVviYRVZ4ddy7E38csQkyOnGq6tXYsKQpkNVgjHuC4+Ui0QF5h34Wf8mQGJCyhQGf07x tw1i78K51pUGO4qTU3eA5rnYwiY9G5yt6PrxcSTPo3P3/kdS4CYipKIvICk059tW1LZI3TfuR+T tNnxXif4ofWrR4oVncJjCj X-Google-Smtp-Source: AGHT+IGZDDOIr7FpTLc4PgG5RDJRYfMLGY7dCe7tSZyn8v/nsCjkpqjrF4TRktCBGBiikGVBZ2T4VA== X-Received: by 2002:a17:903:11d2:b0:298:33c9:ed9e with SMTP id d9443c01a7336-29da1c91d7cmr61399125ad.28.1764919343408; Thu, 04 Dec 2025 23:22:23 -0800 (PST) Received: from google.com ([2401:fa00:95:201:66b2:afed:e561:8cf9]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29daeae6b47sm39420845ad.94.2025.12.04.23.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Dec 2025 23:22:22 -0800 (PST) Date: Fri, 5 Dec 2025 15:22:19 +0800 From: Kuan-Wei Chiu To: Ian Rogers Cc: Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , linux-kernel@vger.kernel.org, Namhyung Kim , Stephen Rothwell Subject: Re: [PATCH v1] checkpatch: Warn about sign offs if there's an accidental patch separator Message-ID: References: <20251205053457.8556-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251205053457.8556-1-irogers@google.com> On Thu, Dec 04, 2025 at 09:34:57PM -0800, Ian Rogers wrote: > The regex ^---$ to detect a patch separator, means a patch is > considerd to have been separated only when the line is exactly just > "---". git-mailinfo (and thus git am) treats any line starting with > "---" as the start of a patch. This can mean a comment causes > git-mailinfo to truncate the commit message if the line in the comment > starts with "---". checkpatch won't warn about things like missing > sign offs after the "---" started comment as it doesn't see the patch > as having started yet. The recording of sign offs is made to ignore > the case it is in a patch. This issue caused missing tags in commit > 6528cdd61590 ("perf tests stat: Add test for error for an offline CPU") I guess Namhyung might fix up this commit and force push the branch, meaning this specific sha id won't exist in Linus' tree later. Given that, I'm not sure it is appropriate to reference this sha id here? > as reported by Stephen Rothwell in: > https://lore.kernel.org/lkml/20251205092428.3e2b94e3@canb.auug.org.au/ > > Before: > > $ ./scripts/checkpatch.pl v2-0006-perf-tests-stat-Add-test-for-error-for-an-offline.patch > total: 0 errors, 0 warnings, 39 lines checked > > v2-0006-perf-tests-stat-Add-test-for-error-for-an-offline.patch has no obvious style problems and is ready for submission. > > After: > > $ ./scripts/checkpatch.pl v2-0006-perf-tests-stat-Add-test-for-error-for-an-offline.patch > ERROR: Missing Signed-off-by: line(s) > > total: 1 errors, 0 warnings, 39 lines checked > > NOTE: For some of the reported defects, checkpatch may be able to > mechanically convert to the typical style using --fix or --fix-inplace. > > v2-0006-perf-tests-stat-Add-test-for-error-for-an-offline.patch has style problems, please review. > > NOTE: If any of the errors are false positives, please report > them to the maintainer, see CHECKPATCH in MAINTAINERS. > > Signed-off-by: Ian Rogers FWIW: Tested-by: Kuan-Wei Chiu Regards, Kuan-Wei > --- > scripts/checkpatch.pl | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 92669904eecc..4fb04162ee56 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -2819,6 +2819,11 @@ sub process { > $is_patch = 1; > } > > +# Once the patch separator is encountered git-mailinfo will treat the rest as a patch > + if ($has_patch_separator) { > + $is_patch = 1; > + } > + > #extract the line range in the file after the patch is applied > if (!$in_commit_log && > $line =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@(.*)/) { > @@ -2989,7 +2994,7 @@ sub process { > } > > # 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) { > @@ -3028,7 +3033,7 @@ sub process { > } > > # Check for patch separator > - if ($line =~ /^---$/) { > + if ($line =~ /^---/) { > $has_patch_separator = 1; > $in_commit_log = 0; > } > -- > 2.52.0.223.gf5cc29aaa4-goog > >