Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932084AbbFDMk7 (ORCPT ); Thu, 4 Jun 2015 08:40:59 -0400 Received: from smtprelay0041.hostedemail.com ([216.40.44.41]:49787 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753144AbbFDMk6 (ORCPT ); Thu, 4 Jun 2015 08:40:58 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2110:2393:2559:2562:2828:2892:2919:3138:3139:3140:3141:3142:3353:3622:3653:3865:3866:3867:3868:3870:3871:3872:3873:4321:4470:4605:5007:6261:8660:9163:10004:10400:10848:11026:11232:11473:11658:11914:12295:12517:12519:12663:12740:13069:13095:13148:13230:13255:13311:13357:14096:14097:21063:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: stone83_5f8fea739a152 X-Filterd-Recvd-Size: 2485 Message-ID: <1433421655.4861.178.camel@perches.com> Subject: Re: [PATCH 3/3] checkpatch: Add --showfile to allow input via pipe to show filenames From: Joe Perches To: Petr Mladek Cc: Andrew Morton , Andy Whitcroft , linux-kernel@vger.kernel.org Date: Thu, 04 Jun 2015 05:40:55 -0700 In-Reply-To: <20150604121804.GP3135@pathway.suse.cz> References: <20150604121804.GP3135@pathway.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1720 Lines: 48 On Thu, 2015-06-04 at 14:18 +0200, Petr Mladek wrote: > On Wed 2015-06-03 08:53:40, Joe Perches wrote: > > Using "git diff | ./scripts/checkpatch -" does not have an > > easy mechanism to see the files and lines actually modified. > > > > Add --showfile to see the file and line specified in the diff. > > > > When --showfile is used without --terse, the second line of each > > message output is redundant, so it is removed. > > > Signed-off-by: Joe Perches > > I like idea but there is a problem, see below. [] > > @@ -5606,7 +5618,7 @@ sub process { > > ERROR("NOT_UNIFIED_DIFF", > > "Does not appear to be a unified-diff format patch\n"); > > } > > - if ($is_patch && $chk_signoff && $signoff == 0) { > > + if ($is_patch && $filename ne '-' && $chk_signoff && $signoff == 0) { > > You might use also "cat $patch | ./scripts/checkpatch -" and in this > case you would want to print the warning. Yeah, but I'm not straining for likely unusual use-cases. > It still prints invalid filename:linenum when you call: > ./scripts/checkpatch 0001-my-commit.patch I don't see this. It prints the file/line of the patch without -terse just as before. > A better solution would be to omit the filename:linenum information > for this patch-specific messages or print the patchname instead of > the filename. Anyway, I think the patch appropriate to apply for now and I'll ponder and listen to suggestions for improvement later. cheers, Joe -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/