From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 B0AEA20B7E1 for ; Sun, 4 Jan 2026 17:37:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767548254; cv=none; b=dzxUy4PNOc8d7MDMKFZjYOnTLa2CPiSyyDX6iuOUJnQEZ7qMSuc2K3qUbflXkzWG8ezLUhNfB83bhO1HXxjyYlscMx9FZtlcYlxPpw9zzi3mcQpK7rWfoTw2voIG7iy5pbE8AFL8C/VBvkx5X5a+O/gJwyA+4UTiNO3HIqy+Vx4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767548254; c=relaxed/simple; bh=/zIu/U7XrBRXEIHDqTOiEPZFEIRSyjX3QFssxGInmVY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=S1EJsiswXTE2FB3OiPs3se+KV4dwqHi8WhCxyRCxV4V+Muvh18EHjmnY8e/sspQglv+BhY+bVX5xNV/PwZ3kuqh8Zw5nhukwAxEemECyrOhxM/PBE3lZQ3rbcKEq3LgNAoUuaO36UIcnc5U6sIoeaP/MaOpWcPVKI+H5pogiB0o= 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=X9RyLdF2; arc=none smtp.client-ip=209.85.214.170 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="X9RyLdF2" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-29f0f875bc5so198541165ad.3 for ; Sun, 04 Jan 2026 09:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1767548252; x=1768153052; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=3WCXr9GDYakZ0FdQPdfrRzlftYFdEqGAn9kdYbupKGI=; b=X9RyLdF2y+Br8S6uAV9I3sERbuDjVTtA9/mXvpLd1Yh7gDmjOo9YumJogNKunBhWH0 fWruhFV3QGHiv57VigqP6CHILfQLbIJk5NAkaXlstSQ1qJLFRb/ba7ShktLi7ESDpwOU dhvvuFdYmA0NOGEUfbEmRzakJUUbtNcnSjigDzMsUT5H2tpxlUKZcS1+s6pOtJ/Y45D8 2dVUIzsljwDidWhWymGciF8ROsxRikndZLUtI16kjHpAf6drVwcNqSFsNis1Xv58C4KH uE8DJ5w8vmYbq80atmKmXDyYP5URQidYTjpbI8ow3jsSU6RTCz9azGVkkzOg1GRtibth M/qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767548252; x=1768153052; h=in-reply-to:content-transfer-encoding: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=3WCXr9GDYakZ0FdQPdfrRzlftYFdEqGAn9kdYbupKGI=; b=i/D1dhrY/MWXk5L5bbXecUo2zwBckKDcRIkfHZmdIfrgTX/+5XWb4lnrVbOWrwnh0S 5SZUyqhH2ei9oF3gGZgftL3qJ8hHeqF+AJtebD+i0NP1bG+rrCa0macaHQbGIgdHNIuR BRjz6SGIXjluF1E+hTlxiGG7XSgpP1VWW/2eTT8SvE5tKyKL6q4sbBT37LLOh0wgWOkj 3PDG5l8jeIzn/qPG9Q6QvvzMh752LzdGoxD8EPsnjX4GcL4BZeOLrh3YoVQfL2uAk3pi syQUc5GTrpd73A4orZkdatV+wux1sRrgCD81H/TJbLsaSsN3QznzU2ux3TH614zJcRi+ LJOA== X-Forwarded-Encrypted: i=1; AJvYcCVQo8Erbs4LvFqZRErP2U4Rem1cIM4L3aEye+OCJQI4iqwsuQtlD7nPXZ9CbYXFfdAi+s0a97DNNZWz3wg=@vger.kernel.org X-Gm-Message-State: AOJu0Yy030jKA1MiAPvOGYxoedF91nByVviyR0RtiOqSsB7WdTt6YJWL fFuIJOgxb7cPsZS1tB/47HSJXpneAcK05JEWIWqV+Im3MVAGWZ4c1RAJ X-Gm-Gg: AY/fxX4DrD8qRLwYZ+WDbAkaCY33wHgWj7a0qDvm6FOyUbSVAcIUei6KXi4B0OSeROG FWiCpfOVJ6JCboYfFRNblzLR8GZhcm/ATAF3iaopZtVdy1hSgmBKiZhHTcCn3B5OmpP8b108fHw tHvTyC+BFGYouYrr0bkTDwDHKUxO6TzfG46asChY1+3169iOctOfIybZ0mUliIZB4z55qIvUzh5 IU/bOZg73+8lxDEyPBhW7JrLnlx77GQXShdCFwhfbJhogKyJlW2mJzqkTGyVUsqxyq1a7Rj/Gix xDUuXfcUfwBAjqngLTaKbIdzVbG3qcNKzNoN4fQwbzeuHItqNtrXVBbn1Uokmembx/szx7Djunz zVrwe+Cougn+e2g4ZvlFD5LAfv4WsjGLDjZviAz37M/vi5Sfr2aTDbUqvtl4h1fc6LOjdxXYoeQ GoUABkOXOgCPS8IZicpIsC0OCB X-Google-Smtp-Source: AGHT+IE1riYU3I9QTBM+0MpiwXHQRtVcZaEkQNttljl3dyDrQm3Xd+hge+fUCyQ0fTlHOA0UP80dJA== X-Received: by 2002:a17:902:d54d:b0:2a2:f2e5:dc92 with SMTP id d9443c01a7336-2a2f2e5df60mr507739185ad.29.1767548251712; Sun, 04 Jan 2026 09:37:31 -0800 (PST) Received: from google.com ([2402:7500:499:de94:a241:5d0d:fa51:5c50]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3d7736fsm435163015ad.92.2026.01.04.09.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jan 2026 09:37:31 -0800 (PST) Date: Mon, 5 Jan 2026 01:37:26 +0800 From: Kuan-Wei Chiu To: Ian Rogers Cc: Dwaipayan Ray , Lukas Bulwahn , Stephen Rothwell , Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org, Namhyung Kim , Andrew Morton 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: +Cc Andrew Morton, On Sat, Jan 03, 2026 at 05:10:22PM -0800, Ian Rogers wrote: > On Thu, Dec 4, 2025 at 11:22 PM Kuan-Wei Chiu wrote: > > > > 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 > > Thanks Kuan-Wei! Is there anything else I need to do for this > improvement to land? IIRC, most checkpatch.pl related patches are routed through the mm-nonmm branch, so I am Cc'ing Andrew for help picking this up. That said, any Ack/Review or feedback from checkpatch.pl maintainers/reviewers would still be helpful and appreciated. 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 > > > > > >