Skip to contentSkip to conversation

checkpatch: avoid COMMIT_LOG_LONG_LINE warning for signature tags

PATCH Superseded Aditya Srivastava 3 participants 10 messages Nov 11, 2020 – Nov 12, 2020 Checkpatch

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpatch: avoid COMMIT_LOG_LONG_LINE warning for signature tags

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic: Properly clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
scripts/checkpatch.pl +2 -0
index ac7e5ac80b58..1d257b1f4a4f 100755
@@ -2963,6 +2963,8 @@ sub process {
 					# filename then :
 		      $line =~ /^\s*(?:Fixes:|Link:)/i ||
 					# A Fixes: or Link: line
+		      $line =~ /^\s*(?:$signature_tags)/ ||
+		      			# signature tag line
 		      $commit_log_possible_stack_dump)) {
 			WARN("COMMIT_LOG_LONG_LINE",
 			     "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
Signature · 6 lines
2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
author
#1 lore raw
Quoted 23 lines · Aditya Srivastava

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic: Properly clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
scripts/checkpatch.pl +0 -0
index ac7e5ac80b58..1d257b1f4a4f 100755

scripts/checkpatch.pl sub process { · line 2970

Quoted 8 lines
scripts/checkpatch.pl +2 -0
@@ -2963,6 +2963,8 @@ sub process {
 					# filename then :
 		      $line =~ /^\s*(?:Fixes:|Link:)/i ||
 					# A Fixes: or Link: line
+		      $line =~ /^\s*(?:$signature_tags)/ ||
+		      			# signature tag line
 		      $commit_log_possible_stack_dump)) {
 			WARN("COMMIT_LOG_LONG_LINE",
 			     "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);

These are the changes I have made for avoiding signature tags from commit_log_log_line warning. Wanted to get a quick feedback on it before proceeding for evaluations.

Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#2 lore raw
In reply to Aditya Srivastava
Quoted 23 lines · Aditya Srivastava

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic: Properly clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
scripts/checkpatch.pl +0 -0
index ac7e5ac80b58..1d257b1f4a4f 100755

scripts/checkpatch.pl sub process { · line 2967

Quoted 5 lines
scripts/checkpatch.pl +2 -0
@@ -2963,6 +2963,8 @@ sub process {
                                        # filename then :
                      $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                        # A Fixes: or Link: line
+                     $line =~ /^\s*(?:$signature_tags)/ ||
+                                       # signature tag line

Can you simply add this check to the expression above?

Quoted 6 lines
scripts/checkpatch.pl +0 -1
                      $commit_log_possible_stack_dump)) {
                        WARN("COMMIT_LOG_LONG_LINE",
                             "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
--

2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

author
#3 lore raw
Quoted 19 lines · Lukas Bulwahn
Quoted 18 lines · Aditya Srivastava

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic: Properly clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
Quoted 13 lines

scripts/checkpatch.pl sub process { · line 2967

Quoted 10 lines
scripts/checkpatch.pl +2 -0
index ac7e5ac80b58..1d257b1f4a4f 100755
@@ -2963,6 +2963,8 @@ sub process {
                                        # filename then :
                      $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                        # A Fixes: or Link: line
+                     $line =~ /^\s*(?:$signature_tags)/ ||
+                                       # signature tag line

Can you simply add this check to the expression above?

Yes, we can do it. But then the match will become case insensitive (because of presence of '/i'). Should I do it irrespective?

Thanks
Aditya

Quoted 6 lines
Quoted 6 lines
scripts/checkpatch.pl +0 -1
                      $commit_log_possible_stack_dump)) {
                        WARN("COMMIT_LOG_LONG_LINE",
                             "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
--

2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#4 lore raw
Quoted 34 lines · Aditya
Quoted 19 lines · Lukas Bulwahn
Quoted 18 lines · Aditya Srivastava

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic: Properly clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
Quoted 13 lines

scripts/checkpatch.pl sub process { · line 2967

Quoted 10 lines
scripts/checkpatch.pl +2 -0
index ac7e5ac80b58..1d257b1f4a4f 100755
@@ -2963,6 +2963,8 @@ sub process {
                                        # filename then :
                      $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                        # A Fixes: or Link: line
+                     $line =~ /^\s*(?:$signature_tags)/ ||
+                                       # signature tag line

Can you simply add this check to the expression above?

Quoted 3 lines

Yes, we can do it. But then the match will become case insensitive (because of presence of '/i'). Should I do it irrespective?

I see. Then keep it as is and start the evaluation.

Lukas

Quoted 10 lines

Thanks
Aditya

Quoted 6 lines
Quoted 6 lines
scripts/checkpatch.pl +0 -1
                      $commit_log_possible_stack_dump)) {
                        WARN("COMMIT_LOG_LONG_LINE",
                             "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
--

2.17.1

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

author
#5 lore raw
Quoted 35 lines · Lukas Bulwahn
Quoted 34 lines · Aditya
Quoted 32 lines · Lukas Bulwahn
Quoted 23 lines · Aditya Srivastava

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic: Properly clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
scripts/checkpatch.pl +0 -0
index ac7e5ac80b58..1d257b1f4a4f 100755

scripts/checkpatch.pl sub process { · line 2967

Quoted 5 lines
scripts/checkpatch.pl +2 -0
@@ -2963,6 +2963,8 @@ sub process {
                                        # filename then :
                      $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                        # A Fixes: or Link: line
+                     $line =~ /^\s*(?:$signature_tags)/ ||
+                                       # signature tag line

Can you simply add this check to the expression above?

Quoted 6 lines
Quoted 3 lines

Yes, we can do it. But then the match will become case insensitive (because of presence of '/i'). Should I do it irrespective?

I see. Then keep it as is and start the evaluation.

I evaluated this patch on v5.6..v5.8 and generated the list of dropped warnings for commit_log_long_line here:
https://github.com/AdityaSrivast/kernel-tasks/blob/master/random/signature_tags/dropped/summary.txt

The difference in frequency is 17 (ie from 1896 to 1879)

Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#6 lore raw
Quoted 41 lines · Aditya
Quoted 39 lines · Lukas Bulwahn
Quoted 37 lines · Aditya
Quoted 19 lines · Lukas Bulwahn
Quoted 18 lines · Aditya Srivastava

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic: Properly clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)
Quoted 13 lines

scripts/checkpatch.pl sub process { · line 2967

Quoted 10 lines
scripts/checkpatch.pl +2 -0
index ac7e5ac80b58..1d257b1f4a4f 100755
@@ -2963,6 +2963,8 @@ sub process {
                                        # filename then :
                      $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                        # A Fixes: or Link: line
+                     $line =~ /^\s*(?:$signature_tags)/ ||
+                                       # signature tag line

Can you simply add this check to the expression above?

Yes, we can do it. But then the match will become case insensitive (because of presence of '/i'). Should I do it irrespective?

Quoted 9 lines
Quoted 2 lines

I see. Then keep it as is and start the evaluation.

I evaluated this patch on v5.6..v5.8 and generated the list of dropped warnings for commit_log_long_line here:
https://github.com/AdityaSrivast/kernel-tasks/blob/master/random/signature_tags/dropped/summary.txt

The difference in frequency is 17 (ie from 1896 to 1879)

Thanks, let us add this summary to the commit message;

Also I think we can drop the specific example and simply summarize why the 17 cases are beyond 75 characters.

- Long names and long email addresses
- some comments on scoped review and acknowledgement, i.e., for a dedicated pointer on what was reported by the identity in Reported-by:
- some additional comments on CC: [email protected] tags

You can also shorten this:

This is an example of false positive. Provide a fix by excluding
signature tag lines from this class of warning.

to:

Exclude signature tag lines from this class of warning.

Send a reworked v2 for a quick review; then, you can probably send it to Joe and lkml; as follow-up reply to your patch, you can direct add the link to

https://github.com/AdityaSrivast/kernel-tasks/blob/master/random/signature_tags/dropped/summary.txt

Joe Perches can then quickly cross-check that evaluation as well.

Lukas
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#7 lore raw
In reply to Aditya
Quoted 31 lines · Aditya
Quoted 18 lines · Lukas Bulwahn
Quoted 17 lines · Aditya Srivastava

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic: Properly clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
  scripts/checkpatch.pl | 2 ++
  1 file changed, 2 insertions(+)
Quoted 12 lines

scripts/checkpatch.pl sub process { · line 2967

Quoted 10 lines
scripts/checkpatch.pl +2 -0
index ac7e5ac80b58..1d257b1f4a4f 100755
@@ -2963,6 +2963,8 @@ sub process {
                                         # filename then :
                       $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                         # A Fixes: or Link: line
+                     $line =~ /^\s*(?:$signature_tags)/ ||
+                                       # signature tag line

Can you simply add this check to the expression above?

Quoted 6 lines

Yes, we can do it. But then the match will become case insensitive (because of presence of '/i'). Should I do it irrespective?

Thanks
Aditya

I think the check might be better as case insensitive because:

$ git log --format=email -100000 | grep "^CC:" | wc -l
773
$ git log --format=email -100000 | grep "^Cc:" | wc -l
59475
$ git log --format=email -100000 | grep "^cc:" | wc -l
95

All three cases were used for Cc: ...

Thanks,
Dwaipayan.

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

author
#8 lore raw
Quoted 51 lines · Dwaipayan Ray
Quoted 35 lines · Aditya
Quoted 22 lines · Lukas Bulwahn
Quoted 20 lines · Aditya Srivastava

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic:
Properly
clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
Reviewed-by: Niranjana Vishwanathapura <[email protected]>

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
  scripts/checkpatch.pl | 2 ++

  1 file changed, 2 insertions(+)
Quoted 12 lines
Quoted 10 lines
scripts/checkpatch.pl +0 -0
index ac7e5ac80b58..1d257b1f4a4f 100755
@@ -2963,6 +2963,8 @@ sub process {
                                          # filename then :

                       $line =~ /^\s*(?:Fixes:|Link:)/i || # A Fixes: or Link: line +                     $line =~ /^\s*(?:$signature_tags)/ || +                                       # signature tag line

Can you simply add this check to the expression above?

Quoted 6 lines

Yes, we can do it. But then the match will become case insensitive (because of presence of '/i'). Should I do it irrespective?

Thanks
Aditya

I think the check might be better as case insensitive because:

$ git log --format=email -100000 | grep "^CC:" | wc -l
773
$ git log --format=email -100000 | grep "^Cc:" | wc -l
59475
Quoted 8 lines
$ git log --format=email -100000 | grep "^cc:" | wc -l
95

All three cases were used for Cc: ...

Thanks,
Dwaipayan.

Thanks Dwaipayan. You seem to be correct. I just observed, we are already using '/xi' flags with $signature_tags values itself. So, case insensitive part seems already covered.

I think I can modify the changes to include this check in the previous if-block itself as Sir had suggested initially. This shouldn't change our evaluation as well.

Sir, should I make the changes as you suggested initially or should we proceed with it?

Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

#9 lore raw
Quoted 66 lines · Aditya
Quoted 51 lines · Dwaipayan Ray
Quoted 35 lines · Aditya
Quoted 22 lines · Lukas Bulwahn
Quoted 20 lines · Aditya Srivastava

Currently checkpatch warns us for long lines in commits even for signature tag lines.

E.g., running checkpatch on commit 4bbdfe25600c ("IB/opa_vnic:
Properly
clear Mac Table Digest") reports this warning:

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
Reviewed-by: Niranjana Vishwanathapura <[email protected]>

This is an example of false positive. Provide a fix by excluding signature tag lines from this class of warning.

---
  scripts/checkpatch.pl | 2 ++
  1 file changed, 2 insertions(+)
Quoted 12 lines

scripts/checkpatch.pl sub process { · line 2967

Quoted 10 lines
scripts/checkpatch.pl +2 -0
index ac7e5ac80b58..1d257b1f4a4f 100755
@@ -2963,6 +2963,8 @@ sub process {
                                         # filename then :
                       $line =~ /^\s*(?:Fixes:|Link:)/i ||
                                         # A Fixes: or Link: line
+                     $line =~ /^\s*(?:$signature_tags)/ ||
+                                       # signature tag line

Can you simply add this check to the expression above?

Quoted 6 lines

Yes, we can do it. But then the match will become case insensitive (because of presence of '/i'). Should I do it irrespective?

Thanks
Aditya

I think the check might be better as case insensitive because:

$ git log --format=email -100000 | grep "^CC:" | wc -l
773
$ git log --format=email -100000 | grep "^Cc:" | wc -l
59475
Quoted 8 lines
$ git log --format=email -100000 | grep "^cc:" | wc -l
95

All three cases were used for Cc: ...

Thanks,
Dwaipayan.

Thanks Dwaipayan. You seem to be correct. I just observed, we are already using '/xi' flags with $signature_tags values itself. So, case insensitive part seems already covered.

Quoted 7 lines

I think I can modify the changes to include this check in the previous if-block itself as Sir had suggested initially. This shouldn't change our evaluation as well.

Sir, should I make the changes as you suggested initially or should we proceed with it?

Make it case-insensitive and include it in the condition above.

Please write Lukas not Sir; that simply confuses me.

Lukas
_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees