Browse Source

get_maintainer: allow usage outside of kernel tree

Add option '--no-tree' to get_maintainer.pl script to allow using this
script in projects that aren't the Linux kernel if they use the same
format for their MAINTAINERS file.  This command is also available in
checkpatch.pl, for example.

Link: http://lkml.kernel.org/r/04452ac6-1575-f612-72c6-6ea88e70a9d5@arm.com
Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Antonio Nino Diaz 7 years ago
parent
commit
31bb82c9ca
1 changed files with 6 additions and 3 deletions
  1. 6 3
      scripts/get_maintainer.pl

+ 6 - 3
scripts/get_maintainer.pl

@@ -48,6 +48,7 @@ my $output_roles = 0;
 my $output_rolestats = 1;
 my $output_rolestats = 1;
 my $output_section_maxlen = 50;
 my $output_section_maxlen = 50;
 my $scm = 0;
 my $scm = 0;
+my $tree = 1;
 my $web = 0;
 my $web = 0;
 my $subsystem = 0;
 my $subsystem = 0;
 my $status = 0;
 my $status = 0;
@@ -255,6 +256,7 @@ if (!GetOptions(
 		'subsystem!' => \$subsystem,
 		'subsystem!' => \$subsystem,
 		'status!' => \$status,
 		'status!' => \$status,
 		'scm!' => \$scm,
 		'scm!' => \$scm,
+		'tree!' => \$tree,
 		'web!' => \$web,
 		'web!' => \$web,
 		'letters=s' => \$letters,
 		'letters=s' => \$letters,
 		'pattern-depth=i' => \$pattern_depth,
 		'pattern-depth=i' => \$pattern_depth,
@@ -319,7 +321,7 @@ if ($email &&
     die "$P: Please select at least 1 email option\n";
     die "$P: Please select at least 1 email option\n";
 }
 }
 
 
-if (!top_of_kernel_tree($lk_path)) {
+if ($tree && !top_of_kernel_tree($lk_path)) {
     die "$P: The current directory does not appear to be "
     die "$P: The current directory does not appear to be "
 	. "a linux kernel source tree.\n";
 	. "a linux kernel source tree.\n";
 }
 }
@@ -1031,13 +1033,14 @@ Other options:
   --sections => print all of the subsystem sections with pattern matches
   --sections => print all of the subsystem sections with pattern matches
   --letters => print all matching 'letter' types from all matching sections
   --letters => print all matching 'letter' types from all matching sections
   --mailmap => use .mailmap file (default: $email_use_mailmap)
   --mailmap => use .mailmap file (default: $email_use_mailmap)
+  --no-tree => run without a kernel tree
   --self-test => show potential issues with MAINTAINERS file content
   --self-test => show potential issues with MAINTAINERS file content
   --version => show version
   --version => show version
   --help => show this help information
   --help => show this help information
 
 
 Default options:
 Default options:
-  [--email --nogit --git-fallback --m --r --n --l --multiline --pattern-depth=0
-   --remove-duplicates --rolestats]
+  [--email --tree --nogit --git-fallback --m --r --n --l --multiline
+   --pattern-depth=0 --remove-duplicates --rolestats]
 
 
 Notes:
 Notes:
   Using "-f directory" may give unexpected results:
   Using "-f directory" may give unexpected results: