Skip to contentSkip to conversation

get_maintainer.pl: Add optional .get_maintainer.MAINTAINERS override

PATCH In review Prarit Bhargava 3 participants 22 messages Jun 26, 2018 – Aug 4, 2018 GET_MAINTAINER script

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 get_maintainer.pl: Add optional .get_maintainer.MAINTAINERS override

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.

---
 scripts/get_maintainer.pl | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
scripts/get_maintainer.pl +34 -0
index c87fa734e3e1..239f4d2ce972 100755
@@ -384,6 +384,32 @@ sub find_ignore_git {
 read_all_maintainer_files();
 
 sub read_all_maintainer_files {
+	my $conf = which_conf(".get_maintainer.MAINTAINERS");
+	if ( -f $conf) {
+	    my @conf_args;
+	    my $add = 0;
+	    open(my $conffile, '<', "$conf")
+		or warn "$P: Can't find a readable .get_maintainer.MAINTAINERS file $!\n";
+	    while (<$conffile>) {
+		my $line = $_;
+		if ($line =~ m/^\+/ ) {
+		    $add = 1;
+		}
+		next if ($line =~ m/^\s*#/);
+		$line =~ s/^\+//g;
+		$line =~ s/^\-//g;
+		$line =~ s/\s*\n?$//;
+		push(@mfiles, $line);
+	    }
+	    close($conffile);
+	    if ($add eq 0) {
+		foreach my $file (@mfiles) {
+		     read_maintainer_file("$file");
+		}
+		return;
+	    }
+	}
+
     if (-d "${lk_path}MAINTAINERS") {
         opendir(DIR, "${lk_path}MAINTAINERS") or die $!;
         my @files = readdir(DIR);
@@ -1068,6 +1094,14 @@ Notes:
       Entries in this file can be any command line argument.
       This file is prepended to any additional command line arguments.
       Multiple lines and # comments are allowed.
+  File ".get_maintainer.ignore", if it exists in the linux kernel source root
+      directory, can contain a list of email addresses to ignore.  Multiple
+      lines and # comments are allowed.
+  File ".get_maintainer.MAINTAINERS", if it exists in the linux kernel source
+      root directory, can change the location of the MAINTAINERS file.
+      Entries beginning with a '+' are added to the default list, and
+      entries beginning with a '-' override the existing MAINTAINERS list
+      lookup.  Multiple lines and # comments are allowed.
   Most options have both positive and negative forms.
       The negative forms for --<foo> are --no<foo> and --no-<foo>.
 
Signature · 1 line
2.14.4
maintainer
#1 lore raw
Quoted 9 lines · Prarit Bhargava

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?

Quoted 60 lines
---
 scripts/get_maintainer.pl | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
scripts/get_maintainer.pl +34 -0
index c87fa734e3e1..239f4d2ce972 100755
@@ -384,6 +384,32 @@ sub find_ignore_git {
 read_all_maintainer_files();
 
 sub read_all_maintainer_files {
+	my $conf = which_conf(".get_maintainer.MAINTAINERS");
+	if ( -f $conf) {
+	    my @conf_args;
+	    my $add = 0;
+	    open(my $conffile, '<', "$conf")
+		or warn "$P: Can't find a readable .get_maintainer.MAINTAINERS file $!\n";
+	    while (<$conffile>) {
+		my $line = $_;
+		if ($line =~ m/^\+/ ) {
+		    $add = 1;
+		}
+		next if ($line =~ m/^\s*#/);
+		$line =~ s/^\+//g;
+		$line =~ s/^\-//g;
+		$line =~ s/\s*\n?$//;
+		push(@mfiles, $line);
+	    }
+	    close($conffile);
+	    if ($add eq 0) {
+		foreach my $file (@mfiles) {
+		     read_maintainer_file("$file");
+		}
+		return;
+	    }
+	}
+
     if (-d "${lk_path}MAINTAINERS") {
         opendir(DIR, "${lk_path}MAINTAINERS") or die $!;
         my @files = readdir(DIR);
@@ -1068,6 +1094,14 @@ Notes:
       Entries in this file can be any command line argument.
       This file is prepended to any additional command line arguments.
       Multiple lines and # comments are allowed.
+  File ".get_maintainer.ignore", if it exists in the linux kernel source root
+      directory, can contain a list of email addresses to ignore.  Multiple
+      lines and # comments are allowed.
+  File ".get_maintainer.MAINTAINERS", if it exists in the linux kernel source
+      root directory, can change the location of the MAINTAINERS file.
+      Entries beginning with a '+' are added to the default list, and
+      entries beginning with a '-' override the existing MAINTAINERS list
+      lookup.  Multiple lines and # comments are allowed.
   Most options have both positive and negative forms.
       The negative forms for --<foo> are --no<foo> and --no-<foo>.
 
#2 lore raw
Quoted 9 lines · Joe Perches
Quoted 8 lines · Prarit Bhargava

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.

Quoted 4 lines
Quoted 1 line

Also add a help entry for the .get_maintainers.ignore file.

I see no reason for this patch to be applied.
Why should it?

The kernel has other vendor/OS changes like my patch, for example, 4efb442cc12e ("kernel/panic.c: add TAINT_AUX"). From that commit message

Add an auxiliary taint flag to be used by distros and others. This obviates the need to forward-port whatever internal solutions people have in favor of a single flag which they can map arbitrarily to a definition of their pleasing.

The same principle should be applied to my patch in that distros no longer would need to forward-port internal solutions similar to this.

Quoted 1 line

Why shouldn't this be in your private repository?

If you don't want it I'll carry it forward but that's a loss for both of us, and as pointed out in the above commit, other distros. If you do want to reject the patch please let me know and I'll only submit the "get_maintainer.ignore" help chunk.

P.

Quoted 61 lines
Quoted 61 lines
---
 scripts/get_maintainer.pl | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
scripts/get_maintainer.pl +34 -0
index c87fa734e3e1..239f4d2ce972 100755
@@ -384,6 +384,32 @@ sub find_ignore_git {
 read_all_maintainer_files();
 
 sub read_all_maintainer_files {
+	my $conf = which_conf(".get_maintainer.MAINTAINERS");
+	if ( -f $conf) {
+	    my @conf_args;
+	    my $add = 0;
+	    open(my $conffile, '<', "$conf")
+		or warn "$P: Can't find a readable .get_maintainer.MAINTAINERS file $!\n";
+	    while (<$conffile>) {
+		my $line = $_;
+		if ($line =~ m/^\+/ ) {
+		    $add = 1;
+		}
+		next if ($line =~ m/^\s*#/);
+		$line =~ s/^\+//g;
+		$line =~ s/^\-//g;
+		$line =~ s/\s*\n?$//;
+		push(@mfiles, $line);
+	    }
+	    close($conffile);
+	    if ($add eq 0) {
+		foreach my $file (@mfiles) {
+		     read_maintainer_file("$file");
+		}
+		return;
+	    }
+	}
+
     if (-d "${lk_path}MAINTAINERS") {
         opendir(DIR, "${lk_path}MAINTAINERS") or die $!;
         my @files = readdir(DIR);
@@ -1068,6 +1094,14 @@ Notes:
       Entries in this file can be any command line argument.
       This file is prepended to any additional command line arguments.
       Multiple lines and # comments are allowed.
+  File ".get_maintainer.ignore", if it exists in the linux kernel source root
+      directory, can contain a list of email addresses to ignore.  Multiple
+      lines and # comments are allowed.
+  File ".get_maintainer.MAINTAINERS", if it exists in the linux kernel source
+      root directory, can change the location of the MAINTAINERS file.
+      Entries beginning with a '+' are added to the default list, and
+      entries beginning with a '-' override the existing MAINTAINERS list
+      lookup.  Multiple lines and # comments are allowed.
   Most options have both positive and negative forms.
       The negative forms for --<foo> are --no<foo> and --no-<foo>.
 
maintainer
#3 lore raw
Quoted 27 lines · Prarit Bhargava
Quoted 9 lines · Joe Perches
Quoted 8 lines · Prarit Bhargava

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.

Quoted 4 lines
Quoted 1 line

Also add a help entry for the .get_maintainers.ignore file.

I see no reason for this patch to be applied.
Why should it?

The kernel has other vendor/OS changes like my patch, for example, 4efb442cc12e ("kernel/panic.c: add TAINT_AUX"). From that commit message

Add an auxiliary taint flag to be used by distros and others. This obviates the need to forward-port whatever internal solutions people have in favor of a single flag which they can map arbitrarily to a definition of their pleasing.

The same principle should be applied to my patch in that distros no longer would need to forward-port internal solutions similar to this.

Quoted 6 lines
Quoted 1 line

Why shouldn't this be in your private repository?

If you don't want it I'll carry it forward but that's a loss for both of us, and as pointed out in the above commit, other distros. If you do want to reject the patch please let me know and I'll only submit the "get_maintainer.ignore" help chunk.

I doubt it's a really a loss for others as whatever .get_maintainers.<foo> files would likely need to be customized for each distro.

I think the whole thing should be ignored.

#4 lore raw
Quoted 30 lines · Joe Perches
Quoted 29 lines · Prarit Bhargava
Quoted 9 lines · Joe Perches
Quoted 8 lines · Prarit Bhargava

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.

Quoted 4 lines
Quoted 1 line

Also add a help entry for the .get_maintainers.ignore file.

I see no reason for this patch to be applied.
Why should it?

The kernel has other vendor/OS changes like my patch, for example, 4efb442cc12e ("kernel/panic.c: add TAINT_AUX"). From that commit message

Add an auxiliary taint flag to be used by distros and others. This obviates the need to forward-port whatever internal solutions people have in favor of a single flag which they can map arbitrarily to a definition of their pleasing.

The same principle should be applied to my patch in that distros no longer would need to forward-port internal solutions similar to this.

Quoted 1 line

Why shouldn't this be in your private repository?

Quoted 8 lines
Quoted 4 lines

If you don't want it I'll carry it forward but that's a loss for both of us, and as pointed out in the above commit, other distros. If you do want to reject the patch please let me know and I'll only submit the "get_maintainer.ignore" help chunk.

I doubt it's a really a loss for others as whatever .get_maintainers.<foo> files would likely need to be customized for each distro.

That's the point of the patch. Each distro would customize their own internal .get_maintainers.MAINTAINERS file.

In any case, consider it dropped.

P.

Quoted 3 lines

I think the whole thing should be ignored.

#5 lore raw
In reply to Joe Perches
Quoted 9 lines · Joe Perches
Quoted 8 lines · Prarit Bhargava

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.

Quoted 5 lines
Quoted 1 line

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=<path>/MAINTAINERS' option that would override the default ./MAINTAINERS file? Then we could just add that to our .get_maintainers.conf file.

Just trying to find ways to minimize our collection of private patches.

Cheers,
Don

Quoted 61 lines
Quoted 61 lines
---
 scripts/get_maintainer.pl | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
scripts/get_maintainer.pl +34 -0
index c87fa734e3e1..239f4d2ce972 100755
@@ -384,6 +384,32 @@ sub find_ignore_git {
 read_all_maintainer_files();
 
 sub read_all_maintainer_files {
+	my $conf = which_conf(".get_maintainer.MAINTAINERS");
+	if ( -f $conf) {
+	    my @conf_args;
+	    my $add = 0;
+	    open(my $conffile, '<', "$conf")
+		or warn "$P: Can't find a readable .get_maintainer.MAINTAINERS file $!\n";
+	    while (<$conffile>) {
+		my $line = $_;
+		if ($line =~ m/^\+/ ) {
+		    $add = 1;
+		}
+		next if ($line =~ m/^\s*#/);
+		$line =~ s/^\+//g;
+		$line =~ s/^\-//g;
+		$line =~ s/\s*\n?$//;
+		push(@mfiles, $line);
+	    }
+	    close($conffile);
+	    if ($add eq 0) {
+		foreach my $file (@mfiles) {
+		     read_maintainer_file("$file");
+		}
+		return;
+	    }
+	}
+
     if (-d "${lk_path}MAINTAINERS") {
         opendir(DIR, "${lk_path}MAINTAINERS") or die $!;
         my @files = readdir(DIR);
@@ -1068,6 +1094,14 @@ Notes:
       Entries in this file can be any command line argument.
       This file is prepended to any additional command line arguments.
       Multiple lines and # comments are allowed.
+  File ".get_maintainer.ignore", if it exists in the linux kernel source root
+      directory, can contain a list of email addresses to ignore.  Multiple
+      lines and # comments are allowed.
+  File ".get_maintainer.MAINTAINERS", if it exists in the linux kernel source
+      root directory, can change the location of the MAINTAINERS file.
+      Entries beginning with a '+' are added to the default list, and
+      entries beginning with a '-' override the existing MAINTAINERS list
+      lookup.  Multiple lines and # comments are allowed.
   Most options have both positive and negative forms.
       The negative forms for --<foo> are --no<foo> and --no-<foo>.
 
maintainer
#6 lore raw
Quoted 16 lines · Don Zickus
Quoted 9 lines · Joe Perches
Quoted 8 lines · Prarit Bhargava

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.

Quoted 5 lines
Quoted 1 line

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?

Quoted 5 lines

Hi Joe,

Would you be open to a '--mfile=<path>/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.

Quoted 1 line

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.

Quoted 2 lines

Cheers,
Don

cheers back, Joe

Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
scripts/get_maintainer.pl +20 -0
+		$line =~ s/\s*\n?$//;
+		push(@mfiles, $line);
+	    }
+	    close($conffile);
+	    if ($add eq 0) {
+		foreach my $file (@mfiles) {
+		     read_maintainer_file("$file");
+		}
+		return;
+	    }
+	}
+
     if (-d "${lk_path}MAINTAINERS") {
         opendir(DIR, "${lk_path}MAINTAINERS") or die $!;
         my @files = readdir(DIR);
@@ -1068,6 +1094,14 @@ Notes:
       Entries in this file can be any command line argument.
       This file is prepended to any additional command line arguments.
       Multiple lines and # comments are allowed.
+  File ".get_maintainer.ignore", if it exists in the linux kernel source root
+      directory, can contain a list of email addresses to ignore.  Multiple
+      lines and # comments are allowed.
+  File ".get_maintainer.MAINTAINERS", if it exists in the linux kernel source
+      root directory, can change the location of the MAINTAINERS file.
+      Entries beginning with a '+' are added to the default list, and
+      entries beginning with a '-' override the existing MAINTAINERS list
+      lookup.  Multiple lines and # comments are allowed.
   Most options have both positive and negative forms.
       The negative forms for --<foo> are --no<foo> and --no-<foo>.
 
#7 lore raw
Quoted 23 lines · Joe Perches
Quoted 16 lines · Don Zickus
Quoted 9 lines · Joe Perches
Quoted 8 lines · Prarit Bhargava

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.

Quoted 5 lines
Quoted 1 line

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?

Quoted 5 lines

Hi Joe,

Would you be open to a '--mfile=<path>/MAINTAINERS' option that would override the default ./MAINTAINERS file? Then we could just add that to our .get_maintainers.conf file.

Quoted 7 lines

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.

Quoted 7 lines
Quoted 2 lines

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=<dir> ? I think that could work.

Cheers,
Don

Quoted 36 lines
Quoted 3 lines

Cheers,
Don

cheers back, Joe

Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
scripts/get_maintainer.pl +20 -0
+		$line =~ s/\s*\n?$//;
+		push(@mfiles, $line);
+	    }
+	    close($conffile);
+	    if ($add eq 0) {
+		foreach my $file (@mfiles) {
+		     read_maintainer_file("$file");
+		}
+		return;
+	    }
+	}
+
     if (-d "${lk_path}MAINTAINERS") {
         opendir(DIR, "${lk_path}MAINTAINERS") or die $!;
         my @files = readdir(DIR);
@@ -1068,6 +1094,14 @@ Notes:
       Entries in this file can be any command line argument.
       This file is prepended to any additional command line arguments.
       Multiple lines and # comments are allowed.
+  File ".get_maintainer.ignore", if it exists in the linux kernel source root
+      directory, can contain a list of email addresses to ignore.  Multiple
+      lines and # comments are allowed.
+  File ".get_maintainer.MAINTAINERS", if it exists in the linux kernel source
+      root directory, can change the location of the MAINTAINERS file.
+      Entries beginning with a '+' are added to the default list, and
+      entries beginning with a '-' override the existing MAINTAINERS list
+      lookup.  Multiple lines and # comments are allowed.
   Most options have both positive and negative forms.
       The negative forms for --<foo> are --no<foo> and --no-<foo>.
 
#8 lore raw
Quoted 41 lines · Don Zickus
Quoted 23 lines · Joe Perches
Quoted 16 lines · Don Zickus
Quoted 9 lines · Joe Perches
Quoted 8 lines · Prarit Bhargava

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.

Quoted 5 lines
Quoted 1 line

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?

Quoted 5 lines

Hi Joe,

Would you be open to a '--mfile=<path>/MAINTAINERS' option that would override the default ./MAINTAINERS file? Then we could just add that to our .get_maintainers.conf file.

Quoted 7 lines

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.

Quoted 1 line
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

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=<dir> ? I think that could work.

So --find-maintainers-files=./kernel/pci

would only look for MAINTAINERS files under kernel/pci?

P.

Quoted 40 lines

Cheers,
Don

Quoted 36 lines
Quoted 3 lines

Cheers,
Don

cheers back, Joe

Quoted 30 lines
Quoted 30 lines
Quoted 30 lines
scripts/get_maintainer.pl +20 -0
+		$line =~ s/\s*\n?$//;
+		push(@mfiles, $line);
+	    }
+	    close($conffile);
+	    if ($add eq 0) {
+		foreach my $file (@mfiles) {
+		     read_maintainer_file("$file");
+		}
+		return;
+	    }
+	}
+
     if (-d "${lk_path}MAINTAINERS") {
         opendir(DIR, "${lk_path}MAINTAINERS") or die $!;
         my @files = readdir(DIR);
@@ -1068,6 +1094,14 @@ Notes:
       Entries in this file can be any command line argument.
       This file is prepended to any additional command line arguments.
       Multiple lines and # comments are allowed.
+  File ".get_maintainer.ignore", if it exists in the linux kernel source root
+      directory, can contain a list of email addresses to ignore.  Multiple
+      lines and # comments are allowed.
+  File ".get_maintainer.MAINTAINERS", if it exists in the linux kernel source
+      root directory, can change the location of the MAINTAINERS file.
+      Entries beginning with a '+' are added to the default list, and
+      entries beginning with a '-' override the existing MAINTAINERS list
+      lookup.  Multiple lines and # comments are allowed.
   Most options have both positive and negative forms.
       The negative forms for --<foo> are --no<foo> and --no-<foo>.
 
maintainer
#9 lore raw
Quoted 50 lines · Prarit Bhargava
Quoted 48 lines · Don Zickus
Quoted 23 lines · Joe Perches
Quoted 16 lines · Don Zickus
Quoted 9 lines · Joe Perches
Quoted 8 lines · Prarit Bhargava

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.

Quoted 5 lines
Quoted 1 line

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?

Quoted 5 lines

Hi Joe,

Would you be open to a '--mfile=<path>/MAINTAINERS' option that would override the default ./MAINTAINERS file? Then we could just add that to our .get_maintainers.conf file.

Quoted 7 lines

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.

Quoted 7 lines
Quoted 2 lines

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.

Quoted 5 lines
Quoted 1 line

So something like --find-maintainer-files=<dir> ? 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=<path_or_file> where
the existing behavior of --find-maintainer-files
without <path_or_file> 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(-)
scripts/get_maintainer.pl +22 -18
index c87fa734e3e1..2eb11b5c8f34 100755
@@ -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");
     }
 }
 
#10 lore raw
Quoted 28 lines · Joe Perches
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 1 line

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.

Quoted 5 lines
Quoted 1 line

So something like --find-maintainer-files=<dir> ? 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=<path_or_file> where
the existing behavior of --find-maintainer-files
without <path_or_file> 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(-)

<snip>

scripts/get_maintainer.pl sub find_ignore_git { · line 399

Quoted 3 lines
scripts/get_maintainer.pl +3 -0
+
+    if (defined $find_maintainer_files) {
+	die "$P: invalid find-maintainer-files <$path>" if (!-d $path);

^^^^^

Hi Joe,

Thanks for the patch!! If I remove the above 'die' line I can pass in a file or a dir. Otherwise the 'die' line prevents a 'file' from being used.

Not sure if that is important for this patch or not.

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

So the 'file' usage would be useful for us. But if you are against it, we can
easily patch it out on our end.

Prarit,

I believe this patch still does what we want (and handles your pci example).

Cheers,
Don

Quoted 16 lines
scripts/get_maintainer.pl +7 -2
+	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");
     }
 }
maintainer
#11 lore raw
Quoted 38 lines · Don Zickus
Quoted 28 lines · Joe Perches
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 1 line

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.

Quoted 5 lines
Quoted 1 line

So something like --find-maintainer-files=<dir> ? 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=<path_or_file> where
the existing behavior of --find-maintainer-files
without <path_or_file> 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(-)

<snip>

scripts/get_maintainer.pl sub find_ignore_git { · line 399

Quoted 3 lines
scripts/get_maintainer.pl +3 -0
+
+    if (defined $find_maintainer_files) {
+	die "$P: invalid find-maintainer-files <$path>" if (!-d $path);

^^^^^

Quoted 4 lines

Hi Joe,

Thanks for the patch!! If I remove the above 'die' line I can pass in a file or a dir. Otherwise the 'die' line prevents a 'file' from being used.

Change it to (!-e $file), I was just spitballing.

Quoted 1 line

Not sure if that is important for this patch or not.

It's not.

Quoted 6 lines

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

So the 'file' usage would be useful for us. But if you are against it, we can
easily patch it out on our end.

cheers, Joe

#12 lore raw
Quoted 39 lines · Joe Perches
Quoted 38 lines · Don Zickus
Quoted 28 lines · Joe Perches
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 1 line

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.

Quoted 5 lines
Quoted 1 line

So something like --find-maintainer-files=<dir> ? 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=<path_or_file> where
the existing behavior of --find-maintainer-files
without <path_or_file> 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(-)

<snip>

scripts/get_maintainer.pl sub find_ignore_git { · line 399

Quoted 3 lines
scripts/get_maintainer.pl +3 -0
+
+    if (defined $find_maintainer_files) {
+	die "$P: invalid find-maintainer-files <$path>" if (!-d $path);

^^^^^

Quoted 6 lines
Quoted 4 lines

Hi Joe,

Thanks for the patch!! If I remove the above 'die' line I can pass in a file or a dir. Otherwise the 'die' line prevents a 'file' from being used.

Change it to (!-e $file), I was just spitballing.

Perfect. Works for me! :-)

Cheers,
Don

Quoted 13 lines
Quoted 2 lines

Not sure if that is important for this patch or not.

It's not.

Quoted 6 lines

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

So the 'file' usage would be useful for us. But if you are against it, we can
easily patch it out on our end.

cheers, Joe

maintainer
#13 lore raw
In reply to Joe Perches
Quoted 4 lines · Joe Perches
Quoted 3 lines · Don Zickus

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

How about:

---
 scripts/get_maintainer.pl | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)
scripts/get_maintainer.pl +21 -18
index c87fa734e3e1..f7a7d46340a8 100755
@@ -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,29 @@ 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 && (-d $find_maintainer_files)) {
+	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");
     }
 }
 
#14 lore raw
Quoted 7 lines · Joe Perches
Quoted 4 lines · Joe Perches
Quoted 3 lines · Don Zickus

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

How about:

I think you tried to optimized and it broke my passed in file.

See below.

Quoted 56 lines
---
 scripts/get_maintainer.pl | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)
scripts/get_maintainer.pl +14 -16
index c87fa734e3e1..f7a7d46340a8 100755
@@ -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,29 @@ 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 && (-d $find_maintainer_files)) {

scripts/get_maintainer.pl sub find_ignore_git { · line 407

Quoted 10 lines
scripts/get_maintainer.pl +6 -1
+	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);

^^^ I see this 'die' when using --find-maintainer-files=<file>

I suspect the '-d $find_maintainer_files' should be a '-e' but that kinda breaks your optimization to use the 'else'??

the 'else' fails because it has $path==<file> and the 'else' appends MAINTAINERS to <file>, which fails the -f check.

You almost need a

     } else {
        push(@mfiles, "${lk_path}MAINTAINERS") if -f "${lk_path}MAINTAINERS";
+	push(@mfiles, "${path}") if -f "${path}";
    }

but that might be kinda kludgy.

Cheers,
Don

Quoted 6 lines
scripts/get_maintainer.pl +1 -1
     foreach my $file (@mfiles) {
-        read_maintainer_file("$file");
+	read_maintainer_file("$file");
     }
 }
 
#15 lore raw
In reply to Joe Perches
Quoted 7 lines · Joe Perches
Quoted 4 lines · Joe Perches
Quoted 3 lines · Don Zickus

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

How about:

Oh by the way, you can probably mimic my testing by doing

mkdir test
cp MAINTAINERS test/

./scripts/get_maintainer.pl --find-maintainer-files test/ <patch> ./scripts/get_maintainer.pl --find-maintainer-files test/MAINTAINERS <patch>

If that helps.

Cheers,
Don

Quoted 72 lines
---
 scripts/get_maintainer.pl | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)
scripts/get_maintainer.pl +21 -18
index c87fa734e3e1..f7a7d46340a8 100755
@@ -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,29 @@ 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 && (-d $find_maintainer_files)) {
+	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");
     }
 }
 
#16 lore raw
In reply to Joe Perches
Quoted 7 lines · Joe Perches
Quoted 4 lines · Joe Perches
Quoted 3 lines · Don Zickus

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

How about:

Hi Joe,

You are probably busy with stuff, but wanted to softly poke you to see what is going on with this patch and if there is anything we can help with?

Cheers,
Don

Quoted 72 lines
---
 scripts/get_maintainer.pl | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)
scripts/get_maintainer.pl +21 -18
index c87fa734e3e1..f7a7d46340a8 100755
@@ -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,29 @@ 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 && (-d $find_maintainer_files)) {
+	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");
     }
 }
 
maintainer
#17 lore raw
Quoted 7 lines · Don Zickus
Quoted 6 lines · Joe Perches
Quoted 4 lines · Joe Perches
Quoted 3 lines · Don Zickus

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

Quoted 6 lines
Quoted 1 line

How about:

Hi Joe,

You are probably busy with stuff, but wanted to softly poke you to see what is going on with this patch and if there is anything we can help with?

Hey Don. No worries.

Tell me again if the --find-maintainer-files=<path or file> should be exclusive or should it also read any existing MAINTAINERS file?

What if anything is wrong with what I suggested?

cheers, Joe

#18 lore raw
Quoted 12 lines · Joe Perches
Quoted 11 lines · Don Zickus
Quoted 7 lines · Joe Perches
Quoted 4 lines · Joe Perches
Quoted 3 lines · Don Zickus

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

How about:

Hi Joe,

Quoted 7 lines
Quoted 2 lines

You are probably busy with stuff, but wanted to softly poke you to see what is going on with this patch and if there is anything we can help with?

Hey Don. No worries.

Tell me again if the --find-maintainer-files=<path or file> should be exclusive or should it also read any existing MAINTAINERS file?

Hi Joe,

We were looking for it to be exclusive. If we backport a patch, we want our internal maintainers to be cc'd not the upstream maintainers. I don't think upstream needs any more spam. :-)

Quoted 2 lines

What if anything is wrong with what I suggested?

You posted multiple versions of a similar patch, each needed some tweaks. But were pretty close to working.

If I had a <dir> with a MAINTAINERS directory beneath it with files behind that, I just wanted to run:

get_maintainers.pl --find-maintainer-files <dir>/ # find <dir>/MAINTAINERS/ get_maintainers.pl --find-maintainer-files <dir>/MAINTAINER/<file> # restricted list

That's it. I attached a patch you provided that worked for me. I added a

+ push(@mfiles, "${path}") if -f "${path}";

to your last version of the patch to get things working for me. You may want a different solution there.

Cheers,
Don

---
 scripts/get_maintainer.pl | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)
scripts/get_maintainer.pl +22 -18
index c87fa734e3e1..f7a7d46340a8 100755
@@ -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 && (-d $find_maintainer_files)) {
+	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";
+	push(@mfiles, "${path}") if -f "${path}";
     }
 
+    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");
     }
 }
 
#19 lore raw
Quoted 18 lines · Don Zickus
Quoted 17 lines · Joe Perches
Quoted 7 lines · Don Zickus
Quoted 6 lines · Joe Perches
Quoted 4 lines · Joe Perches
Quoted 3 lines · Don Zickus

We have an internal use case of multiple MAINTAINER files, some folks have more rights to patches than others so they are not allowed to be cc'd (think embargoed stuff).

Quoted 6 lines
Quoted 1 line

How about:

Hi Joe,

You are probably busy with stuff, but wanted to softly poke you to see what is going on with this patch and if there is anything we can help with?

Hey Don. No worries.

Quoted 8 lines
Quoted 2 lines

Tell me again if the --find-maintainer-files=<path or file> should be exclusive or should it also read any existing MAINTAINERS file?

Hi Joe,

We were looking for it to be exclusive. If we backport a patch, we want our internal maintainers to be cc'd not the upstream maintainers. I don't think upstream needs any more spam. :-)

Hi Joe,

ping? Any feedback here?

Cheers,
Don

Quoted 96 lines
Quoted 3 lines

What if anything is wrong with what I suggested?

You posted multiple versions of a similar patch, each needed some tweaks. But were pretty close to working.

If I had a <dir> with a MAINTAINERS directory beneath it with files behind that, I just wanted to run:

get_maintainers.pl --find-maintainer-files <dir>/ # find <dir>/MAINTAINERS/ get_maintainers.pl --find-maintainer-files <dir>/MAINTAINER/<file> # restricted list

That's it. I attached a patch you provided that worked for me. I added a

+ push(@mfiles, "${path}") if -f "${path}";

to your last version of the patch to get things working for me. You may want a different solution there.

Cheers,
Don

---
 scripts/get_maintainer.pl | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)
scripts/get_maintainer.pl +22 -18
index c87fa734e3e1..f7a7d46340a8 100755
@@ -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 && (-d $find_maintainer_files)) {
+	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";
+	push(@mfiles, "${path}") if -f "${path}";
     }
 
+    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");
     }
 }
 
#20 lore raw
In reply to Joe Perches
Quoted 31 lines · Joe Perches
Quoted 16 lines · Don Zickus
Quoted 9 lines · Joe Perches
Quoted 8 lines · Prarit Bhargava

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.

Quoted 5 lines
Quoted 1 line

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?

Quoted 5 lines

Hi Joe,

Would you be open to a '--mfile=<path>/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.

Quoted 6 lines
Quoted 1 line

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.

Would you be ok with something like this? This seems to solve our problem cleanly. If you are ok with it or need some tweaks, I will send a more formal patch.

Cheers,
Don

scripts/get_maintainer.pl +3 -3
index 8e8ac50f018c..ced7fd664862 100755
@@ -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 $rh_only = 1;
 
 my $vcs_used = 0;
@@ -263,7 +263,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,
@@ -425,7 +425,7 @@ sub read_all_maintainer_files {
         find( { wanted => \&find_is_maintainer_file,
                 preprocess => \&find_ignore_git,
                 no_chdir => 1,
-        }, "${lk_path}");
+        }, "${lk_path}$find_maintainer_files");
     } else {
         push(@mfiles, "${lk_path}MAINTAINERS") if -f "${lk_path}MAINTAINERS";
     }
maintainer
#21 lore raw

PATCH 1/1 get_maintainer.pl: Add -mpath=<path or file> for MAINTAINERS file location

In reply to Don Zickus

Add the ability to have an override for the location of the MAINTAINERS file.

Miscellanea:

o Properly indent a few lines with leading spaces

---
 scripts/get_maintainer.pl | 48 +++++++++++++++++++++++++++++------------------
 1 file changed, 30 insertions(+), 18 deletions(-)
scripts/get_maintainer.pl +30 -18
index 82a482f858ee..0ebdefe74d5b 100755
@@ -62,7 +62,7 @@ my $self_test = undef;
 my $version = 0;
 my $help = 0;
 my $find_maintainer_files = 0;
-
+my $maintainer_path;
 my $vcs_used = 0;
 
 my $exit = 0;
@@ -265,6 +265,7 @@ if (!GetOptions(
 		'fe|file-emails!' => \$file_emails,
 		'f|file' => \$from_filename,
 		'find-maintainer-files' => \$find_maintainer_files,
+		'mpath|maintainer-path=s' => \$maintainer_path,
 		'self-test:s' => \$self_test,
 		'v|version' => \$version,
 		'h|help|usage' => \$help,
@@ -386,26 +387,37 @@ 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 = "${lk_path}MAINTAINERS";
+    if (defined $maintainer_path) {
+	$path = $maintainer_path;
+	# Perl Cookbook tilde expansion if necessary
+	$path =~ s@^~([^/]*)@ $1 ? (getpwnam($1))[7] : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($<))[7])@ex;
+    }
+
+    if (-d $path) {
+	$path .= '/' if ($path !~ m@/$@);
+	if ($path eq "${lk_path}MAINTAINERS/") {
+	    opendir(DIR, "$path") or die $!;
+	    my @files = readdir(DIR);
+	    closedir(DIR);
+	    foreach my $file (@files) {
+		push(@mfiles, "$path$file") if ($file !~ /^\./);
+	    }
+	}
+	if ($find_maintainer_files) {
+	    find( { wanted => \&find_is_maintainer_file,
+		    preprocess => \&find_ignore_git,
+		    no_chdir => 1,
+		}, "$path");
+	}
+    } elsif (-f "$path") {
+	push(@mfiles, "$path");
     } else {
-        push(@mfiles, "${lk_path}MAINTAINERS") if -f "${lk_path}MAINTAINERS";
+	die "$P: MAINTAINER file not found '$path'\n";
     }
-
+    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");
     }
 }