Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp23803img; Wed, 20 Mar 2019 13:10:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZo0UBvhlfYt5eQ2/7xrQFURSkPo8h33tDUbZq+eUJDI29o9fuQPR5GhisuwpcnMdWHVK6 X-Received: by 2002:a17:902:f302:: with SMTP id gb2mr10152117plb.51.1553112659439; Wed, 20 Mar 2019 13:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553112659; cv=none; d=google.com; s=arc-20160816; b=WbpSWrum9kkuoDIV6rIwSSWx52U7Wrpdqb17LHCcBPItWB/YtqSBTi7Il4a2ECE0t9 US9rRLzNlbosZBF0UpFS/M+4oZmfVMsqAwE4bnsJdal0vSetNHW9wdh3YxBfIkbteHQw f4cYwnRI6iZHWxl1gGLZWGmK5G1aA8i+EOb7HdoO5cprSVEB2MQCVzUEFLsKfF+AbHe3 IWLJXmZWMrennPJ6hUXJh1CVs5kYJDFUqcJtSdDso5netSZLs01p/GRFah2PYg+RnuUo 6E5DgV8h4eGBS8XHKVJSVj7nwvXpTmx0UvJ6t3V4avchdsad6sFq/HYhPc9ZEk1D1NYL jf1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=8AX+FlalmrG3d+Bz9YHLY5LL+lrAH7OKSq2XL6lLQHk=; b=IX44leW+nlWKPzPe2oqJzINRscYsGMadsZqIOzPgc8SDnpQKrK452x1iJfx/XH1505 /Qi2nt2IUqmrIg+U8IYqZN93MYrNfgX2kzpdR44kjgJzfG6+fFFHLyTQbk1pZeWCstWD n2s+xd6gfkhrUruppP0aZbdroQx3tVov3YoMTUlv9Ut+4BTsIuiBQfTuKpyeMLLEsJIS PwDNwU6sPlffvmJ3eWkvs82JnREqXkoG0dxQxxfaLEjUASqoXl3C4CLG4FhxxYi3G0nz hHEvBRuu+0vLGXBpsQFksyuUS18qBRYvNb3vJxhKE8CcJhfuDkhd194fiK1f9K4JYiKC ZuaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11si2501143plp.326.2019.03.20.13.10.40; Wed, 20 Mar 2019 13:10:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726695AbfCTUJU convert rfc822-to-8bit (ORCPT + 99 others); Wed, 20 Mar 2019 16:09:20 -0400 Received: from mga11.intel.com ([192.55.52.93]:4077 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726023AbfCTUJT (ORCPT ); Wed, 20 Mar 2019 16:09:19 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Mar 2019 13:09:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,249,1549958400"; d="scan'208";a="329094718" Received: from orsmsx107.amr.corp.intel.com ([10.22.240.5]) by fmsmga006.fm.intel.com with ESMTP; 20 Mar 2019 13:09:18 -0700 Received: from orsmsx155.amr.corp.intel.com (10.22.240.21) by ORSMSX107.amr.corp.intel.com (10.22.240.5) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 20 Mar 2019 13:09:18 -0700 Received: from orsmsx121.amr.corp.intel.com ([169.254.10.155]) by ORSMSX155.amr.corp.intel.com ([169.254.7.86]) with mapi id 14.03.0415.000; Wed, 20 Mar 2019 13:09:18 -0700 From: "Keller, Jacob E" To: "linux-kernel@vger.kernel.org" , "apw@canonical.com" , Joe Perches CC: Intel Wired LAN , "netdev@vger.kernel.org" Subject: RE: [PATCH] checkpatch: fix camel case seeding when run with --root Thread-Topic: [PATCH] checkpatch: fix camel case seeding when run with --root Thread-Index: AQHU2ss2CnInC/0Woki3g/1NaWN2raYU+4eA Date: Wed, 20 Mar 2019 20:09:17 +0000 Message-ID: <02874ECE860811409154E81DA85FBB589232E64D@ORSMSX121.amr.corp.intel.com> References: <20190315010334.5707-1-jacob.e.keller@intel.com> In-Reply-To: <20190315010334.5707-1-jacob.e.keller@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNTNmZjE0ZDgtYTBjNy00NTQ2LTg4MTgtYWU4NjFlMWE0MDhkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMUduUlVNS0tmME1YYldjWHpKcW91cG5LWFNjUDJpWWV6ODBkc3F6RzlcLzl4TnZuUmMrbk9KTmtHazBrcXpmNXUifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.22.254.138] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Keller, Jacob E > Sent: Thursday, March 14, 2019 6:04 PM > To: linux-kernel@vger.kernel.org > Cc: Intel Wired LAN ; netdev@vger.kernel.org; > Keller, Jacob E ; joe@perches.com > Subject: [PATCH] checkpatch: fix camel case seeding when run with --root > > checkpatch.pl avoids warning about camel case of some definitions by > seeding a file that tracks all of the currently committed camel case > definitions. > > To build this seed file, checkpatch.pl decides between using git or the > --root parameter. > > This works as long as you don't run checkpatch.pl from within > a different git tree that is not the Linux kernel. > > In this case, the check for ".git" will return true, and checkpatch will > attempt to seed a camel case file using the current directory. This > works fine if --root is not provided, but can result in an incorrect > camel case seed file resulting in false positive warnings. > > Fix this by checking for $root/.git instead, so that we use the --root > parameter properly when seeding the camel case list. > > Additionally, when generating the list of files to be checked, prefix > the $root path so that the correct file will be found. > > These changes allow checkpatch.pl to honor the --root parameter even if > being run from within another git repository. > > Signed-off-by: Jacob Keller > --- > (Resending with a not-invalid address for the netdev mailing list...) > Ping? Andy? Joe? This is a re-write of a rather old (couple of years old...) fix that I've been meaning to get around to submitting. I'd like to have this picked up since it resolves issues with using --root while inside another git tree. Thanks, Jake > scripts/checkpatch.pl | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index d0001fd1112d..358add495e18 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -903,8 +903,8 @@ sub seed_camelcase_includes { > > $camelcase_seeded = 1; > > - if (-e ".git") { > - my $git_last_include_commit = `git log --no-merges -- > pretty=format:"%h%n" -1 -- include`; > + if (-e "$root/.git") { > + my $git_last_include_commit = `cd $root && git log --no-merges -- > pretty=format:"%h%n" -1 -- include`; > chomp $git_last_include_commit; > $camelcase_cache = ".checkpatch- > camelcase.git.$git_last_include_commit"; > } else { > @@ -931,9 +931,10 @@ sub seed_camelcase_includes { > return; > } > > - if (-e ".git") { > - $files = `git ls-files "include/*.h"`; > + if (-e "$root/.git") { > + $files = `cd $root && git ls-files "include/*.h"`; > @include_files = split('\n', $files); > + @include_files = map("$root/$_", @include_files); > } > > foreach my $file (@include_files) { > -- > 2.18.0.219.gaf81d287a9da