Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753129AbcJWHkm (ORCPT ); Sun, 23 Oct 2016 03:40:42 -0400 Received: from mout.gmx.net ([212.227.17.22]:56560 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751664AbcJWHkl (ORCPT ); Sun, 23 Oct 2016 03:40:41 -0400 From: Heinrich Schuchardt To: Andy Whitcroft , Joe Perches Cc: linux-kernel@vger.kernel.org, Heinrich Schuchardt Subject: [PATCH 1/1] checkpatch: remove false warning for commit reference Date: Sun, 23 Oct 2016 09:34:51 +0200 Message-Id: <1477208091-4887-1-git-send-email-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1465608362-4677-1-git-send-email-xypron.glpk@gmx.de> References: <1465608362-4677-1-git-send-email-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:PUdtwF9h4nPv+4gYohJzkKkjYQjrPBz0SXzDuA/DCntQnj6Wzkf V/zKPnFPgiIxvRBOSLcJx7v+bxbG3RJ8TE6W6iJkLhi3FG4zxBrH4dKTyVddF6A5DJ7ATHs 1o4Z624dJPnqGhYmHpEn9kTRoZmd9bcXM1kpS5bdIKUpOcGVuyIX96k8KkVGuYwFog1Suyc VI2uQATKYM5FcS2NaXmXA== X-UI-Out-Filterresults: notjunk:1;V01:K0:yXSLT9djRHY=:o6j5yV1KrwcK++VyBCKj5b 9fgL59lyZrWweHTG5r3SVyVdS7ALBwSdmE37cUIxivQO2+xxiNedSd7R01c7CS5A2KV1+dYAd rA7eXGgurZZo6umwcQ4hIJCHO4BQDl6XJ5x7qdT0KTh6JuiMfNTM9Iy3mKXO9b1S0bK1C1Ncg cBHlZJPGDyFvP+2WoNPLYxMB74bRFsEnnlxU9TLGMXX+U61b7GLCR96zTubP6VsB+AnBXoGer hUdUytMNf0mUB1B3XtXkjSyyuNogBGVfgRErzPHlbHopwKF4RBeSedEvZK7wz/wh7HmEqELA8 ZnQNS4T8Qj+CtqmN0m3vd/Tx/N3faoSt2z3dbKLd8K67B2Xbnp2DULbkbCuMasQ7E7PdELxy3 db12JeJM2XbOix7EZo9MFO8JJOyyyKPh3rzg3SZrsyKa5N69y3hRYS1/kg9teUlQS5VjjsuHn 7RB13crgaSNBSnhvyobmsc7oL30glS1PK5DnOofNrJlUrkU5BTHjv4BMDhnAqNXHUz7D14zHS BlyFlx3i1/1IqIBoYq0iUVCo46AAETkOp3L1UTxnjYPE2h2ComQQtZojZ+qsRqpp1v39F+WvD 7utdbpTPFryPlAx1L7ZpfdGWxsGVGb9MZVxxUmhdmgUNT3S1bdSAuDmSnN60MCVgRiBD8+rCs lMIXT68OyL4cwTuX1n1TWg7Hm6KvC3XkLTqYM1/oFqZ3OCSwNnFqWcx1NpqW1dazQsx2j644Z N6uA5D1hQTTNYIW5oKEMWDnUGL7vSzu+vhDPCfq3KTiiesrIInNeDIL1RP8= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1454 Lines: 41 Checkpatch warns of an incorrect commit reference style for any hexadecimal number of 12 digits and more. Numbers of 12 digits are not necessarily commit ids. For an example provoking the problem see https://patchwork.kernel.org/patch/9170897/ Checkpatch should only warn if the number refers to an existing commit. Signed-off-by: Heinrich Schuchardt --- scripts/checkpatch.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a8368d1..12e6a1f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -848,6 +848,7 @@ sub git_commit_info { # echo "commit $(cut -c 1-12,41-)" # done } elsif ($lines[0] =~ /^fatal: ambiguous argument '$commit': unknown revision or path not in the working tree\./) { + $id = undef; } else { $id = substr($lines[0], 0, 12); $desc = substr($lines[0], 41); @@ -2577,7 +2578,9 @@ sub process { ($id, $description) = git_commit_info($orig_commit, $id, $orig_desc); - if ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens) { + if ($id && ($short || $long || $space || $case + || ($orig_desc ne $description) + || !$hasparens)) { ERROR("GIT_COMMIT_ID", "Please use git commit description style 'commit <12+ chars of sha1> (\"\")' - ie: '${init_char}ommit $id (\"$description\")'\n" . $herecurr); } -- 2.1.4