Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2625687pxu; Sun, 18 Oct 2020 09:12:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywTEQSM37nvoTFmn9BMZ/G4xeE0PD4rUiJLdTmJsypc4FazrPGizvGxWTMtv0l+TEMVsbp X-Received: by 2002:a05:6402:744:: with SMTP id p4mr13891103edy.190.1603037552830; Sun, 18 Oct 2020 09:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603037552; cv=none; d=google.com; s=arc-20160816; b=tCqDdUWCdG9Qa+KtCvgYwoqfiBgVOH7XYOikt+eRAQUfFSTWI7gnkW3QNrrRrZ9HAu WDJJ/IGPaS9j7UaF1ObX8lh7HXL7OatbipEAGFEjuOp8p5OLSWWiAPVzb2Meiz8LsOOM YhNzQYYm2lasB2OYIRjoY3ogQxF7tnCzo+tR1xkS+Gk8cQQBsEynhYcZm7GCYkq5Z2Y2 5mqzvhiyl5lro3pTu5D6uv3hK4H8QymNgzmAsoA1LzzgasABSLdzryAoy38+fNpUFP/j tJBaOVbt6jhIr4qhnwtaSPXCJQVCtQFO9JdtzIaloSggVZOzaaLtnzHxtlH4+t+sFrJ9 hoRw== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=M42SJ2rn7JPWwtkEbvj28aIoaVjq7SojSGKeO7FXFpg=; b=vF3jZfR99HWShKkXKWUZhsnmSrzk5bFeh0R4lVOpHgmUNqEAXxAhOGT3bgbteo3xgc BLiw9MtQUOTAIvsat7Ico2JV3iMOcykW70bWyolLRNoIDrOfyn/f5pije0A69Jdc0hQa SGJsBbU4kDtfWNJYsl9ZpSJwFkDd1tIicvpwoGKAryw+nnbv4NP0zHxTs25I+dSphdLI tNnPvCiYdtB9jA+RijLrjCNZmONyx7eZmtFPWstQ932lInqJpjejZvpNDyfTQ6HEMpAo N2qdf0dEzNXZx8wuUq54WqTl+Z6BNMMNb5T++jwr1SqVaR0L4spDdZCEo8mZTKXF9mVq qJdA== 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 w21si6076719ejj.377.2020.10.18.09.12.05; Sun, 18 Oct 2020 09:12:32 -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 S1726772AbgJRQHh (ORCPT + 99 others); Sun, 18 Oct 2020 12:07:37 -0400 Received: from smtprelay0187.hostedemail.com ([216.40.44.187]:44952 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725776AbgJRQHg (ORCPT ); Sun, 18 Oct 2020 12:07:36 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay06.hostedemail.com (Postfix) with ESMTP id 8F1BF18224956; Sun, 18 Oct 2020 16:07:35 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:334:355:368:369:379:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2691:2693:2828:3138:3139:3140:3141:3142:3354:3622:3653:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:4605:5007:6119:7903:9040:10004:10400:10848:11026:11232:11658:11914:12043:12262:12297:12438:12555:12660:12679:12740:12760:12895:13069:13311:13357:13439:14096:14097:14180:14181:14659:14721:21060:21063:21080:21365:21627:21990:30029:30054:30070:30080:30089:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: corn47_3708b142722f X-Filterd-Recvd-Size: 2939 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA; Sun, 18 Oct 2020 16:07:34 +0000 (UTC) Message-ID: Subject: Re: [PATCH] checkpatch: Allow not using -f with files that are in git From: Joe Perches To: Geert Uytterhoeven , Linus Torvalds Cc: Andrew Morton , Andy Whitcroft , LKML Date: Sun, 18 Oct 2020 09:07:33 -0700 In-Reply-To: References: <45b81a48e1568bd0126a96f5046eb7aaae9b83c9.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.4-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2020-10-18 at 16:03 +0200, Geert Uytterhoeven wrote: > Hi Joe, > > On Tue, Aug 25, 2020 at 2:12 AM Joe Perches wrote: > > If a file exists in git and checkpatch is used without the -f > > flag for scanning a file, then checkpatch will scan the file > > assuming it's a patch and emit: > > > > ERROR: Does not appear to be a unified-diff format patch > > > > Change the behavior to assume the -f flag if the file exists > > in git. > > > > Signed-off-by: Joe Perches > > Thanks for your patch! > > > --- a/scripts/checkpatch.pl > > +++ b/scripts/checkpatch.pl > > @@ -976,6 +976,16 @@ sub seed_camelcase_includes { > > } > > } > > > > +sub git_is_single_file { > > + my ($filename) = @_; > > + > > + return 0 if ((which("git") eq "") || !(-e "$gitroot")); > > + > > + my $output = `${git_command} ls-files -- $filename`; > > + my $count = $output =~ tr/\n//; > > + return $count eq 1 && $output =~ m{^${filename}$}; > > +} > > + > > sub git_commit_info { > > my ($commit, $id, $desc) = @_; > > > > This is now commit f5f613259f3fea81 ("checkpatch: allow not using -f > with files that are in git"), causing: > > Global symbol "$gitroot" requires explicit package name (did you > forget to declare "my $gitroot"?) at scripts/checkpatch.pl line 980. > Execution of scripts/checkpatch.pl aborted due to compilation errors. > > FWIW, host system is running Ubuntu 18.04.5 LTS (upgrade to 20.04 LTS > planned soon ;-). I believe there is a dependency on another patch in -next that wasn't pushed to Linus' tree. commit 5ec1f7de97b26a3fa364bbb31fdd2e42c8e6fa22 Author: Joe Perches Date: Thu Oct 8 11:53:44 2020 +1100 checkpatch: test $GIT_DIR changes So it'd be better to revert right now until this other patch is accepted or pushed.