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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 DDDAAC388F7 for ; Fri, 6 Nov 2020 00:26:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DF4D206FB for ; Fri, 6 Nov 2020 00:26:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732955AbgKFA01 (ORCPT ); Thu, 5 Nov 2020 19:26:27 -0500 Received: from smtprelay0100.hostedemail.com ([216.40.44.100]:37834 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732181AbgKFA01 (ORCPT ); Thu, 5 Nov 2020 19:26:27 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 14936100E7B42; Fri, 6 Nov 2020 00:26:26 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: blow35_160a2c4272ce X-Filterd-Recvd-Size: 3200 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA; Fri, 6 Nov 2020 00:26:24 +0000 (UTC) Message-ID: <772993cade7e2def4ee9727255734bf9cd6d3f59.camel@perches.com> Subject: Re: [PATCH v3] checkpatch: improve email parsing From: Joe Perches To: Dwaipayan Ray Cc: Lukas Bulwahn , linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, Aditya Srivastava Date: Thu, 05 Nov 2020 16:26:23 -0800 In-Reply-To: References: <20201105115949.39474-1-dwaipayanray1@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-11-06 at 02:46 +0530, Dwaipayan Ray wrote: > > Can you send me a file with the BAD_SIGN_OFF messages generated > > and if possible the git SHA-1s of the commits? > Yes sure, am attaching the file for data tested on about 27k commits > from v5.4. Thanks. > Excluded the duplicate signatures, tags and spacing ones for > simplicity. > > >      24 linux-stable > >      21 5.4+ > >      14 All applicable > >       6 3.10+ > >       5 5.9+ > >       5 5.3+ > > Do I also convert these then for the fix? Yes. Ideally removing any case insensitive name like linux-stable or stable and also removing any leading < or trailing > from the email address. And the stable email address should be forced to lower case only. Any other name should be moved as a comment after the email address then #. > > > Improvements to parsing: > > > > > > - Detect and report unexpected content after email. > > > - Quoted names are excluded from comment parsing. > > > - Trailing dots or commas in email are removed during > > >   formatting. Correspondingly a BAD_SIGN_OFF warning > > >   is emitted. > > > - Improperly quoted email like '"name
"' are now > > >   warned about. [] > > > + my $new_comment = $comment; > > > + $new_comment =~ s/^[ \(\[]+|[ \)\]]+$//g; > > > > Does the comment include any leading whitespace here? > > I presumed not given the $comment !~ /^#/ test above. > > > I added it to discard empty spaces before or after the first > brackets are unwrapped. Something like ( v5.7 ) would > be better if translated to # v5.7. (The extra spaces would be purged). > It just looks good :). Should I change it to keep it as it is? No. Converting the comment style is very sensible and a good change. I did not understand why the regex included a space. I do now. I suggest changing the space to use \s in case there are tabs.