Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp90621imm; Fri, 6 Jul 2018 14:38:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfO8SRr+jD0G/ILsmwUGyrktLwtW6uY9DT2BioGhOzIyFP8zHAQ2eoi672yWNYO0YLdspbT X-Received: by 2002:a63:b00f:: with SMTP id h15-v6mr10956915pgf.442.1530913127496; Fri, 06 Jul 2018 14:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530913127; cv=none; d=google.com; s=arc-20160816; b=Bd4be85o1oDACNF9Jh5sMbY1ZRk2X+MHSkgwlJVLW1pDLPaLtpaEeyvV06/VQiHi7m Z7v69AYfSbX8GDlhY27D6nFgTdVtukpmIITNj6J1CdCoiwtmW9Vg+KgRQBQBi13/vlYS vDX9IfkcRtZ8pzcRUSmIlVINstdy/xPdEgCq+LlW8a5ERQtLrrQgkk/wbAeY2lbRad3T z22PJdD+P2GTaIAx4aHk3mHWN8uTvT9Kxwg3lgXLE2ltLejRGyar3eDKlk7rSt2adgiE xOiv19jdSfqFjpIqPa80llsjQd4ui1nECd8LI0EL+FspbU6rMTuYyPqkT+BkpwjF9c9A dgZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=vwiXT9Vd0ffqGpniG5T9OhsPcYtZq7uEfyIamkbKK8k=; b=ixW5UZScBWzTb0gR+MCkG4VmTTFK8UQ8nrtPf5OtZRQdc1e36aZNsbZqmMQdqyY+9v p/u12Gaa+wpjIm4fWmwVTHGGYds26KBqu0AxS2AQmUrjCaKFlFDUK89nCNWWt6kctbI8 WkPilHdqBY0E93WwGBu11+Y2PJLBNUZrRdf6TwHwoNgjv79HWrInLv22GC/v4I0ct5ji 4azGOtj6NGHbJUfvg/pklVT74Ci6OABaAs8R00fAuaJYrJkFfLtpevtkW4FYMdOIikX6 opPUF5r4bLh2bkbfiJ8sGNLLSC4yPKCCwg3iZ1zDk922kw+CgXIqA/9HMYuYwpFZ+si1 2Pmw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g38-v6si8674945pgg.363.2018.07.06.14.38.31; Fri, 06 Jul 2018 14:38:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754120AbeGFVgc (ORCPT + 99 others); Fri, 6 Jul 2018 17:36:32 -0400 Received: from smtprelay0157.hostedemail.com ([216.40.44.157]:59148 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753631AbeGFVgc (ORCPT ); Fri, 6 Jul 2018 17:36:32 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 2EE5B180A8873; Fri, 6 Jul 2018 21:36:31 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:2:41:69:355:379:541:599:960:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1535:1593:1594:1605:1606:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3622:3653:3865:3866:3867:3868:3870:3871:3872:3873:3874:4117:4250:4321:4605:5007:6119:6299:7903:8700:8957:9010:9040:9592:10004:10848:11026:11232:11658:11914:12043:12114:12291:12295:12438:12555:12683:12740:12760:12895:13161:13229:13255:13439:14659:21060:21080:21220:21324:21433:21451:21611:21627:21740:30022:30054:30070:30079:30090:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: men15_901adb0c7aa14 X-Filterd-Recvd-Size: 6220 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Fri, 6 Jul 2018 21:36:30 +0000 (UTC) Message-ID: <948af2d06623e8fcca6f0c0fd300a65bbfd1c6fa.camel@perches.com> Subject: Re: [PATCH] get_maintainer.pl: Add optional .get_maintainer.MAINTAINERS override From: Joe Perches To: Prarit Bhargava , Don Zickus Cc: linux-kernel@vger.kernel.org, jtoppins@redhat.com Date: Fri, 06 Jul 2018 14:36:28 -0700 In-Reply-To: <716eb88d-31ac-c488-f799-dec9c9afb5af@redhat.com> References: <20180626182505.4176-1-prarit@redhat.com> <601f0e6bf3baa88b9f6145e635d728a435542292.camel@perches.com> <20180706175419.6irtvs64e6dbz7hk@redhat.com> <20180706184411.ilzbt7fxuje2nhx6@redhat.com> <716eb88d-31ac-c488-f799-dec9c9afb5af@redhat.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2018-07-06 at 15:39 -0400, Prarit Bhargava wrote: > > On 07/06/2018 02:44 PM, Don Zickus wrote: > > On Fri, Jul 06, 2018 at 11:31:13AM -0700, Joe Perches wrote: > > > On Fri, 2018-07-06 at 13:54 -0400, Don Zickus wrote: > > > > On Tue, Jun 26, 2018 at 01:16:11PM -0700, Joe Perches wrote: > > > > > On Tue, 2018-06-26 at 14:25 -0400, Prarit Bhargava wrote: > > > > > > OSes have additional maintainers that should be cc'd on patches or may > > > > > > want to circulate internal patches. > > > > > > > > > > > > Parse the .get_maintainer.MAINTAINERS file. Entries in the file > > > > > > can begin with a '+' to indicate the email and list entries should be > > > > > > added to the exiting MAINTAINERS output, or a '-' to indicate that the > > > > > > entries should override the existing MAINTAINERS file. > > > > > > > > > > > > Also add a help entry for the .get_maintainers.ignore file. > > > > > > > > > > I see no reason for this patch to be applied. > > > > > Why should it? > > > > > Why shouldn't this be in your private repository? > > > > > > > > Hi Joe, > > > > > > > > Would you be open to a '--mfile=/MAINTAINERS' option that would > > > > override the default ./MAINTAINERS file? Then we could just add that to our > > > > .get_maintainers.conf file. > > > > > > Hi Don. > > > > > > Sure. > > > > > > And that kinda already exists in mainline with > > > --find-maintainer-files where any subdirectory > > > that contains a MAINTAINER file is also read. > > > > Hi Joe, > > > > Yes, I saw and played with it. My only quirk with it was that option still > > found and added ./MAINTAINERS to the list which I/we were trying to avoid > > (we have our own private MAINTAINERS copy). > > > > But yes, it easily found our private MAINTAINERS file. > > > > > > > > > Just trying to find ways to minimize our collection of private patches. > > > > > > Perhaps that could be extended for your purpose > > > with some additional argument like a specific > > > optional directory/path where every subdirectory > > > would be found. > > > > So something like --find-maintainer-files= ? I think that could work. > > So --find-maintainers-files=./kernel/pci > > would only look for MAINTAINERS files under kernel/pci? Well, perhaps yes. Perhaps it would also read a top level MAINTAINERS file. Dunno. What seems right to you? I don't have an objection to --find-maintainer-files= where the existing behavior of --find-maintainer-files without is all subdirs. Perhaps something like the below (some of this is whitespace change only) --- scripts/get_maintainer.pl | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index c87fa734e3e1..2eb11b5c8f34 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl @@ -60,7 +60,7 @@ my $pattern_depth = 0; my $self_test = undef; my $version = 0; my $help = 0; -my $find_maintainer_files = 0; +my $find_maintainer_files; my $vcs_used = 0; @@ -262,7 +262,7 @@ if (!GetOptions( 'sections!' => \$sections, 'fe|file-emails!' => \$file_emails, 'f|file' => \$from_filename, - 'find-maintainer-files' => \$find_maintainer_files, + 'find-maintainer-files:s' => \$find_maintainer_files, 'self-test:s' => \$self_test, 'v|version' => \$version, 'h|help|usage' => \$help, @@ -384,26 +384,30 @@ sub find_ignore_git { read_all_maintainer_files(); sub read_all_maintainer_files { - if (-d "${lk_path}MAINTAINERS") { - opendir(DIR, "${lk_path}MAINTAINERS") or die $!; - my @files = readdir(DIR); - closedir(DIR); - foreach my $file (@files) { - push(@mfiles, "${lk_path}MAINTAINERS/$file") if ($file !~ /^\./); - } - } - - if ($find_maintainer_files) { - find( { wanted => \&find_is_maintainer_file, - preprocess => \&find_ignore_git, - no_chdir => 1, - }, "${lk_path}"); + my $path = defined $find_maintainer_files && $find_maintainer_files ne "" + ? $find_maintainer_files : $lk_path; + if (-d "${path}MAINTAINERS") { + opendir(DIR, "${path}MAINTAINERS") or die $!; + my @files = readdir(DIR); + closedir(DIR); + foreach my $file (@files) { + push(@mfiles, "${path}MAINTAINERS/$file") if ($file !~ /^\./); + } + } + + if (defined $find_maintainer_files) { + die "$P: invalid find-maintainer-files <$path>" if (!-d $path); + find( { wanted => \&find_is_maintainer_file, + preprocess => \&find_ignore_git, + no_chdir => 1, + }, "${path}"); } else { - push(@mfiles, "${lk_path}MAINTAINERS") if -f "${lk_path}MAINTAINERS"; + push(@mfiles, "${path}MAINTAINERS") if -f "${path}MAINTAINERS"; } + die "$P: No MAINTAINER files found in $path\n" if (scalar(@mfiles) == 0); foreach my $file (@mfiles) { - read_maintainer_file("$file"); + read_maintainer_file("$file"); } }