From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0B05C4338F for ; Thu, 29 Jul 2021 18:07:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1C2560E76 for ; Thu, 29 Jul 2021 18:07:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229976AbhG2SHa (ORCPT ); Thu, 29 Jul 2021 14:07:30 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:59966 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229614AbhG2SH3 (ORCPT ); Thu, 29 Jul 2021 14:07:29 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 99F84223C1; Thu, 29 Jul 2021 18:07:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1627582045; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=HDYq/z6PdlUP94JVU6Rwiyjo1kknfFWM1ZaRitbslAg=; b=OyK+nmD/1YC1IwC4vzHOZ+akmru4RH8Ta2rxBG9a/4m2fFyedDOoQtc8RX7s5JD4gw4ik3 G6VKj2mkXic8CvXrD/evP5TsbYaHuof6V01XY6hO1Q7KOc1gjB7YpVkVB7wYdizodMTuOO 5zUZmja5y2Jbehn2uJoCRcSCwxvCtio= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1627582045; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=HDYq/z6PdlUP94JVU6Rwiyjo1kknfFWM1ZaRitbslAg=; b=saIlOc2vBXoN4+PtV/7gJZRgyBzk+WJidP64t6Fu5pQxCTrNy6jLj+s4cNpoym+TDSquqy CMYF+L8sJHHbhOCw== Received: from kitsune.suse.cz (kitsune.suse.cz [10.100.12.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 71848A3B87; Thu, 29 Jul 2021 18:07:25 +0000 (UTC) Date: Thu, 29 Jul 2021 20:07:24 +0200 From: Michal =?iso-8859-1?Q?Such=E1nek?= To: linux-kernel@vger.kernel.org Cc: Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: checkpatch does not like quoting patch subject with doublequotes Message-ID: <20210729180724.GG21290@kitsune.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I got the following message from checkpatch: WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #18: commit 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()") ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("")' - ie: 'commit 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()")' #18: commit 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()") total: 1 errors, 1 warnings, 7 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. 0001-powerpc-stacktrace-Include-linux-delay.h.patch has style problems, please review. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. AFAICT there is not problem with the way the patch is quoted but rather checkpatch is confused by the patch subject containing double quotes. Can you please have a look? Thanks Michal From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <linux-kernel-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49B8EC4338F for <linux-kernel@archiver.kernel.org>; Fri, 30 Jul 2021 04:01:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22E8460E97 for <linux-kernel@archiver.kernel.org>; Fri, 30 Jul 2021 04:01:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235799AbhG3D7x (ORCPT <rfc822;linux-kernel@archiver.kernel.org>); Thu, 29 Jul 2021 23:59:53 -0400 Received: from smtprelay0184.hostedemail.com ([216.40.44.184]:49714 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230352AbhG3D7v (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 29 Jul 2021 23:59:51 -0400 Received: from omf16.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 1915420BD9; Fri, 30 Jul 2021 03:59:47 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA id 1B8D52550F1; Fri, 30 Jul 2021 03:59:45 +0000 (UTC) Message-ID: <7f55d9d0369f1ea840fab83eeb77f9f3601fee41.camel@perches.com> Subject: Re: checkpatch does not like quoting patch subject with doublequotes From: Joe Perches <joe@perches.com> To: Michal =?ISO-8859-1?Q?Such=E1nek?= <msuchanek@suse.de>, linux-kernel@vger.kernel.org Cc: Andy Whitcroft <apw@canonical.com>, Dwaipayan Ray <dwaipayanray1@gmail.com>, Lukas Bulwahn <lukas.bulwahn@gmail.com> Date: Thu, 29 Jul 2021 20:59:44 -0700 In-Reply-To: <20210729180724.GG21290@kitsune.suse.cz> References: <20210729180724.GG21290@kitsune.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.40.0-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B8D52550F1 X-Stat-Signature: otdf36kqrxatd694b4et8z964wxrcaq7 X-Rspamd-Server: rspamout02 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX19ym3ybUc7TX+lb9wlbgj/OMv+Z0qsP4+4= X-HE-Tag: 1627617585-52422 Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-07-29 at 20:07 +0200, Michal Suchánek wrote: > Hello, > > I got the following message from checkpatch: > > WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) > #18: > commit 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()") That warning is true and useful. > ERROR: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()")' > #18: > commit 7c6986ade69e ("powerpc/stacktrace: Fix spurious "stale" traces in raise_backtrace_ipi()") Yeah, that's a defect/weakness in the regex. It uses '([^"]+)' when instead it could use '(.*?)' as there is always a test for '"\)' immediately after that. Maybe: --- scripts/checkpatch.pl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 461d4221e4a4a..8b95cf8fb1463 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3200,29 +3200,34 @@ sub process { $long = 1 if ($line =~ /\bcommit\s+[0-9a-f]{41,}/i); $space = 0 if ($line =~ /\bcommit [0-9a-f]/i); $case = 0 if ($line =~ /\b[Cc]ommit\s+[0-9a-f]{5,40}[^A-F]/); - if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)"\)/i) { + if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("(.*?)"\)/i) { $orig_desc = $1; $hasparens = 1; } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s*$/i && defined $rawlines[$linenr] && - $rawlines[$linenr] =~ /^\s*\("([^"]+)"\)/) { + $rawlines[$linenr] =~ /^\s*\("(.*?)"\)/) { $orig_desc = $1; $hasparens = 1; - } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("[^"]+$/i && + } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\(".*?$/i && defined $rawlines[$linenr] && - $rawlines[$linenr] =~ /^\s*[^"]+"\)/) { - $line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)$/i; + $rawlines[$linenr] =~ /^\s*.*?"\)/) { + $line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("(.*?)$/i; $orig_desc = $1; - $rawlines[$linenr] =~ /^\s*([^"]+)"\)/; + $rawlines[$linenr] =~ /^\s*(.*?)"\)/; $orig_desc .= " " . $1; $hasparens = 1; + } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s*$/i && + defined $rawlines[$linenr] && + $rawlines[$linenr] =~ /^\s*"\((.*?)"\)/) { + $orig_desc = $1; + $hasparens = 1; } ($id, $description) = git_commit_info($orig_commit, $id, $orig_desc); if (defined($id) && - ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens)) { + ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens)) { ERROR("GIT_COMMIT_ID", "Please use git commit description style 'commit <12+ chars of sha1> (\"<title line>\")' - ie: '${init_char}ommit $id (\"$description\")'\n" . $herecurr); }