lkml.org 
[lkml]   [2020]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] checkpatch: support "base-commit:" format
From
Date
On Wed, 2020-02-12 at 15:32 -0800, John Hubbard wrote:
> In order to support the get-lore-mbox.py tool described in [1], I ran:
>
> git format-patch --base=<commit> --cover-letter <revrange>
>
> ...which generated a "base-commit: <commit-hash>" tag at the end of the
> cover letter. However, checkpatch.pl generated an error upon encounting
> "base-commit:" in the cover letter:
>
> "ERROR: Please use git commit description style..."
>
> ...because it found the "commit" keyword, and failed to recognize that
> it was part of the "base-commit" phrase, and as such, should not be
> subjected to the same commit description style rules.
>
> Update checkpatch.pl to include a special case for "base-commit:", so
> that that tag no longer generates a checkpatch error.
>
> [1] https://lwn.net/Articles/811528/ "Better tools for kernel
> developers"
>
> Cc: Andy Whitcroft <apw@canonical.com>
> Cc: Joe Perches <joe@perches.com>
> Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
> ---
> scripts/checkpatch.pl | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index a63380c6b0d2..f241865cedb3 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2761,6 +2761,7 @@ sub process {
>
> # Check for git id commit length and improperly formed commit descriptions
> if ($in_commit_log && !$commit_log_possible_stack_dump &&
> + $line !~ /base-commit:/ &&

If this base-commit: entry is only at the start of line,
I presume this should actually be

$line !~ /^base-commit:/ &&
or maybe
$line !~ /^\s*base-commit:/ &&

> $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink):/i &&
> $line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
> ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||

\
 
 \ /
  Last update: 2020-02-13 02:07    [W:0.058 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site