public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch.pl: Relax commit ID check to allow more than 12 chars
@ 2023-01-29 12:34 Jonathan Neuschäfer
  2023-01-29 17:52 ` Joe Perches
  0 siblings, 1 reply; 12+ messages in thread
From: Jonathan Neuschäfer @ 2023-01-29 12:34 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jonathan Neuschäfer, Andy Whitcroft, Joe Perches,
	Dwaipayan Ray, Lukas Bulwahn

By now, `git log --pretty=%h` (on my copy of linux.git) prints commit
hashes with 13 digits, because of the number of objects.

Relax the rule in checkpatch.pl to allow a few more digits (up to 16).

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
---
 scripts/checkpatch.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 78cc595b98ce1..3a2c8b5426191 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3177,7 +3177,7 @@ sub process {
 				$tag_case = 0 if $tag eq "Fixes:";
 				$tag_space = 0 if ($line =~ /^fixes:? [0-9a-f]{5,} ($balanced_parens)/i);

-				$id_length = 0 if ($orig_commit =~ /^[0-9a-f]{12}$/i);
+				$id_length = 0 if ($orig_commit =~ /^[0-9a-f]{12,16}$/i);
 				$id_case = 0 if ($orig_commit !~ /[A-F]/);

 				# Always strip leading/trailing parens then double quotes if existing
@@ -3194,7 +3194,7 @@ sub process {
 			if ($ctitle ne $title || $tag_case || $tag_space ||
 			    $id_length || $id_case || !$title_has_quotes) {
 				if (WARN("BAD_FIXES_TAG",
-				     "Please use correct Fixes: style 'Fixes: <12 chars of sha1> (\"<title line>\")' - ie: 'Fixes: $cid (\"$ctitle\")'\n" . $herecurr) &&
+				     "Please use correct Fixes: style 'Fixes: <12-16 chars of sha1> (\"<title line>\")' - ie: 'Fixes: $cid (\"$ctitle\")'\n" . $herecurr) &&
 				    $fix) {
 					$fixed[$fixlinenr] = "Fixes: $cid (\"$ctitle\")";
 				}
--
2.39.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-02-07 14:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-29 12:34 [PATCH] checkpatch.pl: Relax commit ID check to allow more than 12 chars Jonathan Neuschäfer
2023-01-29 17:52 ` Joe Perches
2023-01-31 21:00   ` Jonathan Neuschäfer
2023-02-04 16:57   ` Joe Perches
2023-02-05 10:40     ` Jonathan Neuschäfer
2023-02-05 16:33       ` Randy Dunlap
2023-02-05 20:38     ` Linus Torvalds
2023-02-06  8:38     ` Geert Uytterhoeven
2023-02-06 11:09       ` Joe Perches
2023-02-06 11:54         ` Geert Uytterhoeven
2023-02-06 12:25           ` Joe Perches
2023-02-07 14:47             ` Jonathan Neuschäfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox