diff options
author | Joe Perches <joe@perches.com> | 2010-10-26 17:22:53 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 19:52:17 -0400 |
commit | e3e9d11479737692f797bad1762f71468d577a93 (patch) | |
tree | 60d2b27f9d3fc3c68eab8fd0883839fb3252c2d0 /scripts | |
parent | fab9ed12fcd0c182a72509382c3da55c527963e3 (diff) |
scripts/get_maintainer.pl: add default --git-fallback, remove default --git
Adding commit signers when there is a listed MAINTAINER for a file
can make the output list longer than necessary.
Change the --git default from on to off.
Add a new --git-fallback option (default on) used to add commit signers
only when there is no MAINTAINER for a file.
git history is used when --git-fallback is enabled and the pattern
directory depth is not the same as the file directory depth.
For instance:
X86 ARCHITECTURE (32-BIT AND 64-BIT)
M: Thomas Gleixner <tglx@linutronix.de>
M: Ingo Molnar <mingo@redhat.com>
M: "H. Peter Anvin" <hpa@zytor.com>
M: x86@kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
S: Maintained
F: Documentation/x86/
F: arch/x86/
If using "./scripts/get_maintainer -f arch/x86/lib/atomic64_32.c", the pattern
for "arch/x86/" does not match the directory depth of "arch/x86/lib"
so the MAINTAINERS entries and git history is used to produce:
$ ./scripts/get_maintainer.pl -f --rolestats arch/x86/lib/atomic64_32.c
Thomas Gleixner <tglx@linutronix.de> (maintainer:X86 ARCHITECTURE...)
Ingo Molnar <mingo@redhat.com> (maintainer:X86 ARCHITECTURE...)
"H. Peter Anvin" <hpa@zytor.com> (maintainer:X86 ARCHITECTURE...,commit_signer:1/1=100%)
x86@kernel.org (maintainer:X86 ARCHITECTURE...)
Luca Barbieri <luca@luca-barbieri.com> (commit_signer:1/1=100%)
linux-kernel@vger.kernel.org (open list)
Luca Barbieri is added because he signed the only commit to
arch/x86/lib/atomic64_32.c during the last year and he meets the
other default qualifications.
--git-min-percent (default:10)
--git-min-signatures (default:1)
If current users of ./scripts/get_maintainers.pl have scripts
that use --nogit that expect git history to be excluded, those
scripts should be updated to include --nogit-fallback or a
.get_maintainer.conf file should be created with --nogit-fallback.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/get_maintainer.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 77f4f2e4cd81..f46576949ccb 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -24,9 +24,10 @@ my $email_maintainer = 1; | |||
24 | my $email_list = 1; | 24 | my $email_list = 1; |
25 | my $email_subscriber_list = 0; | 25 | my $email_subscriber_list = 0; |
26 | my $email_git_penguin_chiefs = 0; | 26 | my $email_git_penguin_chiefs = 0; |
27 | my $email_git = 1; | 27 | my $email_git = 0; |
28 | my $email_git_all_signature_types = 0; | 28 | my $email_git_all_signature_types = 0; |
29 | my $email_git_blame = 0; | 29 | my $email_git_blame = 0; |
30 | my $email_git_fallback = 1; | ||
30 | my $email_git_min_signatures = 1; | 31 | my $email_git_min_signatures = 1; |
31 | my $email_git_max_maintainers = 5; | 32 | my $email_git_max_maintainers = 5; |
32 | my $email_git_min_percent = 5; | 33 | my $email_git_min_percent = 5; |
@@ -138,6 +139,7 @@ if (!GetOptions( | |||
138 | 'git!' => \$email_git, | 139 | 'git!' => \$email_git, |
139 | 'git-all-signature-types!' => \$email_git_all_signature_types, | 140 | 'git-all-signature-types!' => \$email_git_all_signature_types, |
140 | 'git-blame!' => \$email_git_blame, | 141 | 'git-blame!' => \$email_git_blame, |
142 | 'git-fallback!' => \$email_git_fallback, | ||
141 | 'git-chief-penguins!' => \$email_git_penguin_chiefs, | 143 | 'git-chief-penguins!' => \$email_git_penguin_chiefs, |
142 | 'git-min-signatures=i' => \$email_git_min_signatures, | 144 | 'git-min-signatures=i' => \$email_git_min_signatures, |
143 | 'git-max-maintainers=i' => \$email_git_max_maintainers, | 145 | 'git-max-maintainers=i' => \$email_git_max_maintainers, |
@@ -371,6 +373,7 @@ my @status = (); | |||
371 | foreach my $file (@files) { | 373 | foreach my $file (@files) { |
372 | 374 | ||
373 | my %hash; | 375 | my %hash; |
376 | my $exact_pattern_match = 0; | ||
374 | my $tvi = find_first_section(); | 377 | my $tvi = find_first_section(); |
375 | while ($tvi < @typevalue) { | 378 | while ($tvi < @typevalue) { |
376 | my $start = find_starting_index($tvi); | 379 | my $start = find_starting_index($tvi); |
@@ -405,6 +408,8 @@ foreach my $file (@files) { | |||
405 | my $value_pd = ($value =~ tr@/@@); | 408 | my $value_pd = ($value =~ tr@/@@); |
406 | my $file_pd = ($file =~ tr@/@@); | 409 | my $file_pd = ($file =~ tr@/@@); |
407 | $value_pd++ if (substr($value,-1,1) ne "/"); | 410 | $value_pd++ if (substr($value,-1,1) ne "/"); |
411 | $value_pd = -1 if ($value =~ /^\.\*/); | ||
412 | $exact_pattern_match = 1 if ($value_pd >= $file_pd); | ||
408 | if ($pattern_depth == 0 || | 413 | if ($pattern_depth == 0 || |
409 | (($file_pd - $value_pd) < $pattern_depth)) { | 414 | (($file_pd - $value_pd) < $pattern_depth)) { |
410 | $hash{$tvi} = $value_pd; | 415 | $hash{$tvi} = $value_pd; |
@@ -439,7 +444,8 @@ foreach my $file (@files) { | |||
439 | } | 444 | } |
440 | } | 445 | } |
441 | 446 | ||
442 | if ($email && $email_git) { | 447 | if ($email && |
448 | ($email_git || ($email_git_fallback && !$exact_pattern_match))) { | ||
443 | vcs_file_signoffs($file); | 449 | vcs_file_signoffs($file); |
444 | } | 450 | } |
445 | 451 | ||
@@ -540,6 +546,7 @@ MAINTAINER field selection options: | |||
540 | --git => include recent git \*-by: signers | 546 | --git => include recent git \*-by: signers |
541 | --git-all-signature-types => include signers regardless of signature type | 547 | --git-all-signature-types => include signers regardless of signature type |
542 | or use only ${signaturePattern} signers (default: $email_git_all_signature_types) | 548 | or use only ${signaturePattern} signers (default: $email_git_all_signature_types) |
549 | --git-fallback => use git when no exact MAINTAINERS pattern (default: $email_git_fallback) | ||
543 | --git-chief-penguins => include ${penguin_chiefs} | 550 | --git-chief-penguins => include ${penguin_chiefs} |
544 | --git-min-signatures => number of signatures required (default: $email_git_min_signatures) | 551 | --git-min-signatures => number of signatures required (default: $email_git_min_signatures) |
545 | --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers) | 552 | --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers) |