linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] checkpatch: Do not check git commit description style when backport the upstream commit
@ 2020-11-25  3:35 Tiezhu Yang
  2020-11-25  3:51 ` Joe Perches
  0 siblings, 1 reply; 6+ messages in thread
From: Tiezhu Yang @ 2020-11-25  3:35 UTC (permalink / raw)
  To: Andrew Morton, Andy Whitcroft, Joe Perches; +Cc: linux-kernel, Xuefeng Li

When backport the upstream commit to the internal LTS kernel version,
we usually use the following description [1] [2]:

[ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]
or
commit c51f8f88d705e06bd696d7510aff22b33eb8e638 upstream.

We use checkpatch.pl before auto build and there exists auto build
failure due to the following checkpatch error:

ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit cc6528bc9a0c ("r8169: fix potential skb double free in an error path")'
#6:
[ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]
or
ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit c51f8f88d705 ("random32: make prandom_u32() output unpredictable")'
#6:
commit c51f8f88d705e06bd696d7510aff22b33eb8e638 upstream.

We can use "--ignore GIT_COMMIT_ID" to avoid this checkpatch
error, but I think it is better to modify the check rule of
checkpatch. When there exists "Upstream" or "upstream" in the
commit line, it seems no need to do more check.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.19.y&id=bc571404829755e4a9504cc5fbc636fea80b2d83
[2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-4.19.y&id=81d7c56d6fab5ccbf522c47a655cd427808679f2

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---

RESEND to Andrew Morton <akpm@linux-foundation.org>

 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index fab38b4..f5bbfdd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2889,7 +2889,8 @@ sub process {
 		    ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
 		     ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i &&
 		      $line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i &&
-		      $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i))) {
+		      $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i)) &&
+		    $line !~ /^\s*Upstream|upstream/i) {
 			my $init_char = "c";
 			my $orig_commit = "";
 			my $short = 1;
-- 
2.1.0


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

* Re: [PATCH RESEND] checkpatch: Do not check git commit description style when backport the upstream commit
  2020-11-25  3:35 [PATCH RESEND] checkpatch: Do not check git commit description style when backport the upstream commit Tiezhu Yang
@ 2020-11-25  3:51 ` Joe Perches
  2020-11-25  4:08   ` Tiezhu Yang
  0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2020-11-25  3:51 UTC (permalink / raw)
  To: Tiezhu Yang, Andrew Morton, Andy Whitcroft; +Cc: linux-kernel, Xuefeng Li

On Wed, 2020-11-25 at 11:35 +0800, Tiezhu Yang wrote:
> When backport the upstream commit to the internal LTS kernel version,
> we usually use the following description [1] [2]:
> 
> [ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]
> or
> commit c51f8f88d705e06bd696d7510aff22b33eb8e638 upstream.

Internal to what?

If it's your own internal build system, I think you should
keep your own local patch to checkpatch.

I don't see why the kernel version should accept it.

Is this style used by anyone else?


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

* Re: [PATCH RESEND] checkpatch: Do not check git commit description style when backport the upstream commit
  2020-11-25  3:51 ` Joe Perches
@ 2020-11-25  4:08   ` Tiezhu Yang
  2020-11-25  4:22     ` Joe Perches
  2020-11-25  4:24     ` Joe Perches
  0 siblings, 2 replies; 6+ messages in thread
From: Tiezhu Yang @ 2020-11-25  4:08 UTC (permalink / raw)
  To: Joe Perches, Andrew Morton, Andy Whitcroft; +Cc: linux-kernel, Xuefeng Li

On 11/25/2020 11:51 AM, Joe Perches wrote:
> On Wed, 2020-11-25 at 11:35 +0800, Tiezhu Yang wrote:
>> When backport the upstream commit to the internal LTS kernel version,
>> we usually use the following description [1] [2]:
>>
>> [ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]
>> or
>> commit c51f8f88d705e06bd696d7510aff22b33eb8e638 upstream.
> Internal to what?
>
> If it's your own internal build system, I think you should
> keep your own local patch to checkpatch.
>
> I don't see why the kernel version should accept it.
>
> Is this style used by anyone else?

AFAIK, this style is only used in the stable tree, for example:

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.9.y&id=c68a9ca7ca33f1020cca97e4e935c2154bec37c7


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

* Re: [PATCH RESEND] checkpatch: Do not check git commit description style when backport the upstream commit
  2020-11-25  4:08   ` Tiezhu Yang
@ 2020-11-25  4:22     ` Joe Perches
  2020-11-25  4:24     ` Joe Perches
  1 sibling, 0 replies; 6+ messages in thread
From: Joe Perches @ 2020-11-25  4:22 UTC (permalink / raw)
  To: Tiezhu Yang, Andrew Morton, Andy Whitcroft, Greg KH, Sasha Levin
  Cc: linux-kernel, Xuefeng Li

On Wed, 2020-11-25 at 12:08 +0800, Tiezhu Yang wrote:
> On 11/25/2020 11:51 AM, Joe Perches wrote:
> > On Wed, 2020-11-25 at 11:35 +0800, Tiezhu Yang wrote:
> > > When backport the upstream commit to the internal LTS kernel version,
> > > we usually use the following description [1] [2]:
> > > 
> > > [ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]
> > > or
> > > commit c51f8f88d705e06bd696d7510aff22b33eb8e638 upstream.
> > Internal to what?
> > 
> > If it's your own internal build system, I think you should
> > keep your own local patch to checkpatch.
> > 
> > I don't see why the kernel version should accept it.
> > 
> > Is this style used by anyone else?
> 
> AFAIK, this style is only used in the stable tree, for example:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.9.y&id=c68a9ca7ca33f1020cca97e4e935c2154bec37c7
> 



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

* Re: [PATCH RESEND] checkpatch: Do not check git commit description style when backport the upstream commit
  2020-11-25  4:08   ` Tiezhu Yang
  2020-11-25  4:22     ` Joe Perches
@ 2020-11-25  4:24     ` Joe Perches
  2020-11-25  7:17       ` Greg KH
  1 sibling, 1 reply; 6+ messages in thread
From: Joe Perches @ 2020-11-25  4:24 UTC (permalink / raw)
  To: Tiezhu Yang, Andrew Morton, Andy Whitcroft, Greg KH, Sasha Levin
  Cc: linux-kernel, Xuefeng Li

On Wed, 2020-11-25 at 12:08 +0800, Tiezhu Yang wrote:
> On 11/25/2020 11:51 AM, Joe Perches wrote:
> > On Wed, 2020-11-25 at 11:35 +0800, Tiezhu Yang wrote:
> > > When backport the upstream commit to the internal LTS kernel version,
> > > we usually use the following description [1] [2]:
> > > 
> > > [ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]
> > > or
> > > commit c51f8f88d705e06bd696d7510aff22b33eb8e638 upstream.
> > Internal to what?
> > 
> > If it's your own internal build system, I think you should
> > keep your own local patch to checkpatch.
> > 
> > I don't see why the kernel version should accept it.
> > 
> > Is this style used by anyone else?
> 
> AFAIK, this style is only used in the stable tree, for example:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.9.y&id=c68a9ca7ca33f1020cca97e4e935c2154bec37c7

Greg?/Sasha?

https://lore.kernel.org/lkml/995e0acb-c219-ea00-f078-7582516e25de@loongson.cn/T/#m2f3d87bd985bf3d4d7b63f1fa4f0490baa01119b

Is this in your scripts?
Is this something you want/use?



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

* Re: [PATCH RESEND] checkpatch: Do not check git commit description style when backport the upstream commit
  2020-11-25  4:24     ` Joe Perches
@ 2020-11-25  7:17       ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2020-11-25  7:17 UTC (permalink / raw)
  To: Joe Perches
  Cc: Tiezhu Yang, Andrew Morton, Andy Whitcroft, Sasha Levin,
	linux-kernel, Xuefeng Li

On Tue, Nov 24, 2020 at 08:24:15PM -0800, Joe Perches wrote:
> On Wed, 2020-11-25 at 12:08 +0800, Tiezhu Yang wrote:
> > On 11/25/2020 11:51 AM, Joe Perches wrote:
> > > On Wed, 2020-11-25 at 11:35 +0800, Tiezhu Yang wrote:
> > > > When backport the upstream commit to the internal LTS kernel version,
> > > > we usually use the following description [1] [2]:
> > > > 
> > > > [ Upstream commit cc6528bc9a0c901c83b8220a2e2617f3354d6dd9 ]
> > > > or
> > > > commit c51f8f88d705e06bd696d7510aff22b33eb8e638 upstream.
> > > Internal to what?
> > > 
> > > If it's your own internal build system, I think you should
> > > keep your own local patch to checkpatch.
> > > 
> > > I don't see why the kernel version should accept it.
> > > 
> > > Is this style used by anyone else?
> > 
> > AFAIK, this style is only used in the stable tree, for example:
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.9.y&id=c68a9ca7ca33f1020cca97e4e935c2154bec37c7
> 
> Greg?/Sasha?
> 
> https://lore.kernel.org/lkml/995e0acb-c219-ea00-f078-7582516e25de@loongson.cn/T/#m2f3d87bd985bf3d4d7b63f1fa4f0490baa01119b
> 
> Is this in your scripts?

My scripts put this into a patch when applying it to the stable tree,
and so do Sasha's.  I don't know why checkpatch would care about this as
that's not used for this workflow at all.

> Is this something you want/use?

I wouldn't use it, and I doubt anyone else would.

thanks,

greg k-h

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

end of thread, other threads:[~2020-11-25  7:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  3:35 [PATCH RESEND] checkpatch: Do not check git commit description style when backport the upstream commit Tiezhu Yang
2020-11-25  3:51 ` Joe Perches
2020-11-25  4:08   ` Tiezhu Yang
2020-11-25  4:22     ` Joe Perches
2020-11-25  4:24     ` Joe Perches
2020-11-25  7:17       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).