[PATCH v2] checkpatch: disable commit log length check warning for signature tag
Disable commit log length check in case of signature tag. If the commit log line has valid signature tags such as "Reported-and-tested-by" with more than 75 characters, suppress the long length warning. For instance in commit ac854131d984 ("USB: core: Fix misleading driver bug report"), the corresponding patch contains a "Reported by" tag line which exceeds 75 chars. And there is no valid way to shorten the length. Signed-off-by: Nachiket Naganure --- scripts/checkpatch.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 197436b20288..ef603f2d9dbf 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2806,6 +2806,8 @@ sub process { # filename then : $line =~ /^\s*(?:Fixes:|Link:)/i || # A Fixes: or Link: line + $line =~ /^\s*$signature_tags/ || + # Check for signature tag $commit_log_possible_stack_dump)) { WARN("COMMIT_LOG_LONG_LINE", "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr); -- 2.25.1
Re: [PATCH] checkpatch: disable commit log length check warning for signature tag
On Mon, Jul 27, 2020 at 02:17:06PM -0700, Joe Perches wrote: > On Mon, 2020-07-27 at 22:34 +0200, Lukas Bulwahn wrote: > > On Mon, 27 Jul 2020, Nachiket Naganure wrote: > > > On Sun, Jul 26, 2020 at 11:14:42PM -0700, Joe Perches wrote: > > > > On Mon, 2020-07-27 at 11:24 +0530, Nachiket Naganure wrote: > [] > > > > OK, but the test should be: > > > > > > > > $line =~ /^\s*$signature_tags/ || > > > > > > > > so the line has to start with a signature and > > > > it won't match on signature tags in the middle > > > > of other content on the same line. > > > > > > > > > > > But the suggested won't work in case of merged signatures. > > > Such as "Reported-and-tested-by: u...@email.com" > > > > > But Joe's remark is valid; we do not want to match on signature tags in > > the middle. These cases are probably mentioning signature tags as part of > > a sentence or some explanation. > > > > Nachiket, think about a proper solution for this issue. > > Mostly the problem doesn't occur very often and likely > isn't worth much effort. > > Combinations aren't common in git logs and arbitrary > combinatorial logic isn't trivial. > > For the last million commits, only ~3000 have any combination > and almost all of those are Reported-and-tested-by: > > Likely that could be added to $signature_tags and the problem > just ignored. > > I'd still exempt signature lines from line length limits. > > $ git log -100 --no-merges --format=email | \ > grep -P "^[\w_-]+-by:" | cut -f1 -d":" | \ > sort | uniq -c | sort -rn | cat -n | grep -i and > 7 2159 Reported-and-tested-by > 11255 Reported-and-Tested-by > 12203 Reviewed-and-tested-by > 13132 Reviewed-and-Tested-by > 22 68 Reported-and-bisected-by > 31 44 Acked-and-tested-by > 40 21 Tested-and-Acked-by > 41 20 Tested-and-acked-by > 42 20 Reported-bisected-and-tested-by > 49 17 Suggested-and-Acked-by > 50 16 Tested-and-reported-by > 51 16 Acked-and-Tested-by > 52 15 Suggested-and-Tested-by > 53 15 Suggested-and-acked-by > 56 14 Tested-and-reviewed-by > 58 13 Tested-and-Reviewed-by > 61 12 Reported-and-acked-by > 62 11 Reported-and-debugged-by > 65 10 Reported-and-Acked-by > 73 8 Suggested-and-reviewed-by > 76 8 Reported-and-suggested-by > 77 8 Reported-and-analyzed-by > 79 8 Bisected-and-tested-by > 81 7 Requested-and-tested-by > 82 7 Reported-and-reviewed-by > 91 6 Bisected-and-reported-by >104 4 Tested-and-Reported-by >111 4 Requested-and-Tested-by >125 3 Reported-by-and-Tested-by >127 3 Reported-And-Tested-by >128 3 Reported-and-requested-by >155 2 Suggested-and-tested-by >166 2 Reported-tested-and-acked-by >169 2 Reported-and-Suggested-by >170 2 Reported-and-by >201 2 Debugged-and-tested-by >232 1 Tested-by-and-Reviewed-by >234 1 Tested-And-Reviewed-by >235 1 Tested-and-requested-by >236 1 Tested-and-bugfixed-by >245 1 Suggested-and-Reviewed-by >265 1 Signed-off-and-morning-tea-spilled-by >284 1 Reviewed-and-wanted-by >285 1 Reviewed-and-discussed-by >286 1 Reviewed-and-Acked-by >287 1 Reviewed-and-acked-by >294 1 Requested-and-debugged-by >295 1 Requested-and-Acked-by >296 1 Requested-and-acked-by >301 1 Reportedy-and-tested-by >303 1 Reported-tested-and-fixed-by >304 1 Reported-tested-and-bisected-by >305 1 Reported-Reviewed-and-Acked-by >306 1 Reported-requested-and-tested-by >312 1 Reported-by-and-tested-by >313 1 Reported-Bistected-and-Tested-by >316 1 Reported-and_tested-by >317 1 Reported-and-Tested-and-Reviewed-by >318 1 Reported-and-tested-and-reviewed-by >
Re: [PATCH] checkpatch: disable commit log length check warning for signature tag
On Sun, Jul 26, 2020 at 11:14:42PM -0700, Joe Perches wrote: > On Mon, 2020-07-27 at 11:24 +0530, Nachiket Naganure wrote: > > Disable commit log length check in case of signature tag. If the commit > > log line has valid signature tags such as "Reported-and-tested-by" with > > more than 75 characters, suppress the long length warning. > > > > For instance in commit ac854131d984 ("USB: core: Fix misleading driver bug > > report"), the corresponding patch contains a "Reported by" tag line which > > exceeds 75 chars. And there is no valid way to shorten the length. > > > > Signed-off-by: Nachiket Naganure > > --- > > scripts/checkpatch.pl | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > > index 197436b20288..46237e9e0550 100755 > > --- a/scripts/checkpatch.pl > > +++ b/scripts/checkpatch.pl > > @@ -2806,6 +2806,8 @@ sub process { > > # filename then : > > $line =~ /^\s*(?:Fixes:|Link:)/i || > > # A Fixes: or Link: line > > + $line =~ /$signature_tags/ || > > + # Check for signature_tags > > $commit_log_possible_stack_dump)) { > > WARN("COMMIT_LOG_LONG_LINE", > > "Possible unwrapped commit description (prefer a > > maximum 75 chars per line)\n" . $herecurr); > > OK, but the test should be: > > $line =~ /^\s*$signature_tags/ || > > so the line has to start with a signature and > it won't match on signature tags in the middle > of other content on the same line. > > But the suggested won't work in case of merged signatures. Such as "Reported-and-tested-by: u...@email.com"
[PATCH] checkpatch: disable commit log length check warning for signature tag
Disable commit log length check in case of signature tag. If the commit log line has valid signature tags such as "Reported-and-tested-by" with more than 75 characters, suppress the long length warning. For instance in commit ac854131d984 ("USB: core: Fix misleading driver bug report"), the corresponding patch contains a "Reported by" tag line which exceeds 75 chars. And there is no valid way to shorten the length. Signed-off-by: Nachiket Naganure --- scripts/checkpatch.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 197436b20288..46237e9e0550 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2806,6 +2806,8 @@ sub process { # filename then : $line =~ /^\s*(?:Fixes:|Link:)/i || # A Fixes: or Link: line + $line =~ /$signature_tags/ || + # Check for signature_tags $commit_log_possible_stack_dump)) { WARN("COMMIT_LOG_LONG_LINE", "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr); -- 2.25.1