Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp594465pxb; Wed, 18 Aug 2021 09:23:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw08N0ehQkj82ngBe4mr20voSF9v+7g5rL0Y4Bvjm1858O5D7GuGCqPM+D8ZxxEBvMQ7F7K X-Received: by 2002:a17:906:b48:: with SMTP id v8mr10551434ejg.258.1629303801745; Wed, 18 Aug 2021 09:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629303801; cv=none; d=google.com; s=arc-20160816; b=ZHD1emWSXX2eukRmG1NKTniVyIOryVpz999FHlfHOYFwPIZloBJKTtDwTvYBUk0bBJ AAEn6qexi3l4tu47Au0BmRF74iHLTn8h5NzBvzl+dZ8FfLdatU/SiMQeEtjifycTEIbm PLieA6ZHXYi7HNBABJBXRugo46sK0r6jsx6sQu3xPwmpAA5ZkJsyGAuKDjOt4DygfQl/ 6kCgjELSftikyHUY+JcKtlV7LJUbxD556Ua0K77sx3rdXuYiNZVxK7kyOC50Bt8xL/iG 4hIXE83KEm0A9Htwk+8LLTkLo+dg4SBHO5oyW4k64x2HRUMWFFR3uH690nKnDdiJntmR OkQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=g0gC+WjafyAckvmR2jgKWhTEEwfe3iTWJAbJzTBop3Y=; b=vnt2bkkGFXqrEiZLByYKLGgjVGejwmeoTjH4aNz55I1GA4XEwc2PFUNxhtI+npk02r Pq24Lo7lZF6niKf0yF0F7uooPijj/akXe5vMY1d6MD8IXGDv16HYuT1GFnWqy7cP2lox z1zXu0OsV8SmI18072mJh4zHIodGvijXoAh4HcNiMsfplb3YT/NY4tEWSecJu9ZO/+l4 aGXfVz92/TFU8NaZrFStnvqjKE1on/YV+v1ztrNh2a+uLjDA3WMjqJCiyp1JxHvbd/VD 1YCSJ1VgFwlztUMT1tLPpIlYLdgrCeV/zNuM9+FV9ianiSpU1AxLLOwkAXwtiMsP1I+o G0kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p21si240092edy.12.2021.08.18.09.22.56; Wed, 18 Aug 2021 09:23:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231217AbhHRQWA (ORCPT + 99 others); Wed, 18 Aug 2021 12:22:00 -0400 Received: from mail-io1-f52.google.com ([209.85.166.52]:34368 "EHLO mail-io1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230335AbhHRQV7 (ORCPT ); Wed, 18 Aug 2021 12:21:59 -0400 Received: by mail-io1-f52.google.com with SMTP id i7so3616684iow.1; Wed, 18 Aug 2021 09:21:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=g0gC+WjafyAckvmR2jgKWhTEEwfe3iTWJAbJzTBop3Y=; b=qaNnVTTenGBBwVQYiZNGKQxtSYeD0voImZtowRcvA1K82JCxDKiG/lZPpLwmp8uT8p zm4TgmXmYlR7zIJzq+99nPaWxD1Bfhbj+HhWTkay4q683d2vzptvnJtez0/LmTaXNJFM SvCOaxR1IaFxbvcTU3bUSZSe4EPLYmFX1Dj6ra0xt1CnXDg5Uik9lgXGf5zpYLcPg0lz oCxk+WyU7uoQode0jNBZ8oNh/nwze6mh0mmffVrqXp6q9xflIzS5Ssw9syWdvamRDx0v FBS7gbAOThjwTnSINl1WT8st71RionMTFJCu/g6BARVOKyd72Tqlwvldi+Sl9zUOUlKg Myig== X-Gm-Message-State: AOAM532nqalWE3iz9olvaAu+eYqSTilGf1/rVQ7o3NPTSFG0QlpqrOTu g2/bwSCTcv//hQxjL2IbWbE= X-Received: by 2002:a05:6638:2613:: with SMTP id m19mr6725966jat.11.1629303683988; Wed, 18 Aug 2021 09:21:23 -0700 (PDT) Received: from [10.68.32.40] (broadband-188-32-236-56.ip.moscow.rt.ru. [188.32.236.56]) by smtp.gmail.com with ESMTPSA id a11sm63956ilf.79.2021.08.18.09.21.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Aug 2021 09:21:23 -0700 (PDT) Subject: Re: [RFC PATCH 1/5] checkpatch: improve handling of revert commits To: Joe Perches , linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Jens Axboe , Jiri Kosina , Willy Tarreau References: <20210818154646.925351-1-efremov@linux.com> <20210818154646.925351-2-efremov@linux.com> From: Denis Efremov Message-ID: <3d347d4b-1576-754f-8633-ba6084cc0661@linux.com> Date: Wed, 18 Aug 2021 19:21:19 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/18/21 7:00 PM, Joe Perches wrote: > On Wed, 2021-08-18 at 18:46 +0300, Denis Efremov wrote: >> Properly handle commits like: >> commit f2791e7eadf4 ("Revert "floppy: refactor open() flags handling"") > > Try this one: > > https://lore.kernel.org/lkml/7f55d9d0369f1ea840fab83eeb77f9f3601fee41.camel@perches.com/ > It works but why not to use .+? then? I'm not sure that non-greedy patterns will properly handle commits like: $ git log --oneline | fgrep '")' e.g. commit ece2619fe8ed ("extcon: arizona: Fix flags parameter to the gpiod_get("wlf,micd-pol") call") >> >> Cc: Joe Perches >> Signed-off-by: Denis Efremov >> --- >>  scripts/checkpatch.pl | 12 ++++++------ >>  1 file changed, 6 insertions(+), 6 deletions(-) >> >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >> index 461d4221e4a4..cf31e8c994d3 100755 >> --- a/scripts/checkpatch.pl >> +++ b/scripts/checkpatch.pl >> @@ -3200,20 +3200,20 @@ 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; >>   } >