All of lore.kernel.org
 help / color / mirror / Atom feed
* [Linux-kernel-mentees] [PATCH] Script: Checkpatch: Disables commit log length check in case of valid signature tags
@ 2020-07-26  7:58 Nachiket Naganure
  2020-07-26 11:13 ` Lukas Bulwahn
  0 siblings, 1 reply; 4+ messages in thread
From: Nachiket Naganure @ 2020-07-26  7:58 UTC (permalink / raw)
  To: lukas.bulwahn, skhan, linux-kernel-mentees

Checkpatch.pl outputs warnings for commit description lines that exceed
beyond 75 characters. Sometimes these lines might contain signature tags
that cannot be shortened. The patch checks if the line has any valid
signature tags and disables the warning in such a case.

For instance in commit ID ac854131d984, the patch
contains a Reported by tag line which exceeds 75 chars. And there is no
valid way to shorten the length.

To fix this, we need to check if the $line variable has any valid
signature tags which are already stored in $signature_tags variable.

Signed-off-by: Nachiket Naganure <nachiketun8@gmail.com>
---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 197436b20288..b6d5e2a8fce8 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/ ||
+          # Checks 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

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] Script: Checkpatch: Disables commit log length check in case of valid signature tags
  2020-07-26  7:58 [Linux-kernel-mentees] [PATCH] Script: Checkpatch: Disables commit log length check in case of valid signature tags Nachiket Naganure
@ 2020-07-26 11:13 ` Lukas Bulwahn
  2020-07-26 15:09   ` Nachiket N
  0 siblings, 1 reply; 4+ messages in thread
From: Lukas Bulwahn @ 2020-07-26 11:13 UTC (permalink / raw)
  To: Nachiket Naganure; +Cc: linux-kernel-mentees


Commit message is wrong.

On Sun, 26 Jul 2020, Nachiket Naganure wrote:

> Checkpatch.pl outputs warnings for commit description lines that exceed
> beyond 75 characters. Sometimes these lines might contain signature tags
> that cannot be shortened. The patch checks if the line has any valid
> signature tags and disables the warning in such a case.
> 
> For instance in commit ID ac854131d984, the patch
> contains a Reported by tag line which exceeds 75 chars. And there is no
> valid way to shorten the length.
> 
> To fix this, we need to check if the $line variable has any valid
> signature tags which are already stored in $signature_tags variable.
> 

Read the documentation on commit messages. Think about the things you are 
doing wrong in your commit message.

> Signed-off-by: Nachiket Naganure <nachiketun8@gmail.com>
> ---
>  scripts/checkpatch.pl | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 197436b20288..b6d5e2a8fce8 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/ ||
> +          # Checks for signature_tags

Change looks more reasonable now.
Indentation is broken.


Maybe two or three iterations on this patch and it is getting ready for 
submission.

Lukas

>  		      $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
> 
> 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] Script: Checkpatch: Disables commit log length check in case of valid signature tags
  2020-07-26 11:13 ` Lukas Bulwahn
@ 2020-07-26 15:09   ` Nachiket N
  2020-07-26 17:12     ` Lukas Bulwahn
  0 siblings, 1 reply; 4+ messages in thread
From: Nachiket N @ 2020-07-26 15:09 UTC (permalink / raw)
  To: Lukas Bulwahn; +Cc: linux-kernel-mentees


[-- Attachment #1.1: Type: text/plain, Size: 2623 bytes --]

On Sun, Jul 26, 2020 at 4:43 PM Lukas Bulwahn <lukas.bulwahn@gmail.com>
wrote:

>
> Commit message is wrong.
>
> On Sun, 26 Jul 2020, Nachiket Naganure wrote:
>
> > Checkpatch.pl outputs warnings for commit description lines that exceed
> > beyond 75 characters. Sometimes these lines might contain signature tags
> > that cannot be shortened. The patch checks if the line has any valid
> > signature tags and disables the warning in such a case.
> >
> > For instance in commit ID ac854131d984, the patch
> > contains a Reported by tag line which exceeds 75 chars. And there is no
> > valid way to shorten the length.
> >
> > To fix this, we need to check if the $line variable has any valid
> > signature tags which are already stored in $signature_tags variable.
> >
>
> Read the documentation on commit messages. Think about the things you are
> doing wrong in your commit message.
>
> > Signed-off-by: Nachiket Naganure <nachiketun8@gmail.com>
> > ---
> >  scripts/checkpatch.pl | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > index 197436b20288..b6d5e2a8fce8 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/ ||
> > +          # Checks for signature_tags
>
> Change looks more reasonable now.
> Indentation is broken.
>
>
> Maybe two or three iterations on this patch and it is getting ready for
> submission.
>
> Lukas
>
> >                     $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
> >
> >
>
Checkpatch: Disable length check warning for signature tag

Disable commit log length check in case of the signature tag. If the commit
log line has valid signature tags such as "Reported-and-tested-by" with
more than 75 characters, it suppresses the long line length warning.

For instance in Commit ac854131d984 (USB: core: Fix misleading driver
bug report), the corresponding contains a "Reported by" tag line which
exceeds 75 chars. And there is no valid way to shorten the length.


The modified commit message is written above. Changed the language to
imperative and shortened the subject line. Fixed the commit ID reference.
Are there any other changes required?

[-- Attachment #1.2: Type: text/html, Size: 3793 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

* Re: [Linux-kernel-mentees] [PATCH] Script: Checkpatch: Disables commit log length check in case of valid signature tags
  2020-07-26 15:09   ` Nachiket N
@ 2020-07-26 17:12     ` Lukas Bulwahn
  0 siblings, 0 replies; 4+ messages in thread
From: Lukas Bulwahn @ 2020-07-26 17:12 UTC (permalink / raw)
  To: Nachiket N; +Cc: linux-kernel-mentees

[-- Attachment #1: Type: text/plain, Size: 3077 bytes --]



On Sun, 26 Jul 2020, Nachiket N wrote:

> On Sun, Jul 26, 2020 at 4:43 PM Lukas Bulwahn <lukas.bulwahn@gmail.com> wrote:
> 
>       Commit message is wrong.
> 
>       On Sun, 26 Jul 2020, Nachiket Naganure wrote:
> 
>       > Checkpatch.pl outputs warnings for commit description lines that exceed
>       > beyond 75 characters. Sometimes these lines might contain signature tags
>       > that cannot be shortened. The patch checks if the line has any valid
>       > signature tags and disables the warning in such a case.
>       >
>       > For instance in commit ID ac854131d984, the patch
>       > contains a Reported by tag line which exceeds 75 chars. And there is no
>       > valid way to shorten the length.
>       >
>       > To fix this, we need to check if the $line variable has any valid
>       > signature tags which are already stored in $signature_tags variable.
>       >
> 
>       Read the documentation on commit messages. Think about the things you are
>       doing wrong in your commit message.
> 
>       > Signed-off-by: Nachiket Naganure <nachiketun8@gmail.com>
>       > ---
>       >  scripts/checkpatch.pl | 2 ++
>       >  1 file changed, 2 insertions(+)
>       >
>       > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>       > index 197436b20288..b6d5e2a8fce8 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/ ||
>       > +          # Checks for signature_tags
> 
>       Change looks more reasonable now.
>       Indentation is broken.
> 
> 
>       Maybe two or three iterations on this patch and it is getting ready for
>       submission.
> 
>       Lukas
> 
>       >                     $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
>       >
>       >
>

Your email client is broken for sending responses.
 
> Checkpatch: Disable length check warning for signature tag
> 
> Disable commit log length check in case of the signature tag. If the commit
> log line has valid signature tags such as "Reported-and-tested-by" with
> more than 75 characters, it suppresses the long line length warning.
> 
> For instance in Commit ac854131d984 (USB: core: Fix misleading driver
> bug report), the corresponding contains a "Reported by" tag line which
> exceeds 75 chars. And there is no valid way to shorten the length.
> 
> 
> The modified commit message is written above. Changed the language to
> imperative and shortened the subject line. Fixed the commit ID reference.
> Are there any other changes required?
>

Send a PATCH v2 and I will provide feedback on that.

Lukas 

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

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

end of thread, other threads:[~2020-07-26 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26  7:58 [Linux-kernel-mentees] [PATCH] Script: Checkpatch: Disables commit log length check in case of valid signature tags Nachiket Naganure
2020-07-26 11:13 ` Lukas Bulwahn
2020-07-26 15:09   ` Nachiket N
2020-07-26 17:12     ` Lukas Bulwahn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.