Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp188536pxv; Wed, 14 Jul 2021 01:28:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDEFUCRLj1SCLyslQj6O4n1fC/jf0wu4soDMBgvx80k7L86LlXPa7HJebBKi2vqovadpYv X-Received: by 2002:a05:6602:1501:: with SMTP id g1mr6530452iow.189.1626251304215; Wed, 14 Jul 2021 01:28:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626251304; cv=none; d=google.com; s=arc-20160816; b=nr3qMJYgrfM2Ta9dvwDpNsea7tnyg/8lFqKHMFMh03Znqu2H8ESKE1pniOjCXeaX48 pQMFc5u7eMyUypEb1vH5FoOvGcVgPAKB6eNsXfwEbB5B52gZiuXtYs8ycsfuZ/bEFpox xqfHCfLOdXZRcvhQ6XCLJTnePx/LO3ZJfEu0o9tu4B8j9+CzO8Fw+B9MzCDqkh4JW8HX 4N6DVP3JK0almP+Kq5dLghKgi2rYxqEAm9KzGBQfR8dhCV6RoCf8M/Ycbc+y8oM/S4UU GLDYllUA8HoWlCCMxl7hglfBlWAjPoSqDqPTt3iQDqGqm0KypXwSLdQau+HPEkl0Fccy fRGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KuNo9Sw1JYflZs4ybE0I033HagzAzK1mRZaHqbsAmJ0=; b=gW7x+iAhZN3HbXJLnwNgzktwlaWusjPiXPiWSbqLOvumpafA7nYu0ahUIYXNK/UFBJ xykgHTPx8ZYeZwQnfg3D3rJ6z/5kW65w4Eq1SCtWeyGD5AYSR/wxZ9reu5PTZJ4CNf5g rI9oMiYbB9TsvayuASgBhVQwDXNEeCTxcVOzELzwKCqu9ccPwL8G7C+JbhU9ClruFAcB ARRlT7J3wB5CedRqQxbmse1bnxxmnZqPSX6nEJ9vGze03Tx2ounIp9LZvn8JauQ3JrBF 7HIl2czhKyYQ6nttKjsEw748VtW1aMvG/nTs9EeaznCDRgHPz1H4fffqCDCs2greGi3d vgBw== 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 z6si1612087ils.150.2021.07.14.01.28.11; Wed, 14 Jul 2021 01:28:24 -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 S238514AbhGNI3o (ORCPT + 99 others); Wed, 14 Jul 2021 04:29:44 -0400 Received: from h4.fbrelay.privateemail.com ([131.153.2.45]:50459 "EHLO h4.fbrelay.privateemail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238495AbhGNI3l (ORCPT ); Wed, 14 Jul 2021 04:29:41 -0400 Received: from MTA-12-3.privateemail.com (mta-12-1.privateemail.com [198.54.122.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h3.fbrelay.privateemail.com (Postfix) with ESMTPS id A3D59809C5 for ; Wed, 14 Jul 2021 04:26:47 -0400 (EDT) Received: from mta-12.privateemail.com (localhost [127.0.0.1]) by mta-12.privateemail.com (Postfix) with ESMTP id 7CBB718001C8; Wed, 14 Jul 2021 04:26:46 -0400 (EDT) Received: from hal-station.. (unknown [10.20.151.249]) by mta-12.privateemail.com (Postfix) with ESMTPA id B643B18000B3; Wed, 14 Jul 2021 04:26:45 -0400 (EDT) From: Hamza Mahfooz To: linux-kernel@vger.kernel.org Cc: Hamza Mahfooz , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH] checkpatch: fix an issue regarding the git commit description style test Date: Wed, 14 Jul 2021 04:26:07 -0400 Message-Id: <20210714082608.28918-1-someguy@effective-light.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If we consider the output of the following command: $ git shortlog | grep '"' | wc -l 14185 It becomes apparent that quite a number of commits have titles that, contain at least one quotation mark and if you attempt to refer to those commits in a new patch, checkpatch throws a false positive. This is because, checkpatch disallows the use of quotation marks in commit titles, only when referring to those commits in commit descriptions. Signed-off-by: Hamza Mahfooz --- 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; } -- 2.32.0