Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156072
b: refs/heads/master
c: afa81ee
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Jul 30, 2009
1 parent 94dc7d7 commit f7e0f06
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 870020f93af2323a81f179091a0780dc1d5b916b
refs/heads/master: afa81ee13033de791c41c1d9333853504653939b
19 changes: 16 additions & 3 deletions trunk/scripts/get_maintainer.pl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
my $email_git_penguin_chiefs = 0;
my $email_git_min_signatures = 1;
my $email_git_max_maintainers = 5;
my $email_git_min_percent = 5;
my $email_git_since = "1-year-ago";
my $output_multiline = 1;
my $output_separator = ", ";
Expand Down Expand Up @@ -65,6 +66,7 @@
'git-chief-penguins!' => \$email_git_penguin_chiefs,
'git-min-signatures=i' => \$email_git_min_signatures,
'git-max-maintainers=i' => \$email_git_max_maintainers,
'git-min-percent=i' => \$email_git_min_percent,
'git-since=s' => \$email_git_since,
'm!' => \$email_maintainer,
'n!' => \$email_usename,
Expand Down Expand Up @@ -307,6 +309,7 @@ sub usage {
--git-chief-penguins => include ${penguin_chiefs}
--git-min-signatures => number of signatures required (default: 1)
--git-max-maintainers => maximum maintainers to add (default: 5)
--git-min-percent => minimum percentage of commits required (default: 0)
--git-since => git history to use (default: 1-year-ago)
--m => include maintainer(s) if any
--n => include name 'Full Name <addr\@domain.tld>'
Expand Down Expand Up @@ -497,6 +500,7 @@ sub recent_git_signoffs {
my $output = "";
my $count = 0;
my @lines = ();
my $total_sign_offs;

if (which("git") eq "") {
warn("$P: git not found. Add --nogit to options?\n");
Expand All @@ -520,17 +524,26 @@ sub recent_git_signoffs {
$output =~ s/^\s*//gm;

@lines = split("\n", $output);

$total_sign_offs = 0;
foreach my $line (@lines) {
if ($line =~ m/([0-9]+)\s+(.*)/) {
$total_sign_offs += $1;
} else {
die("$P: Unexpected git output: ${line}\n");
}
}

foreach my $line (@lines) {
if ($line =~ m/([0-9]+)\s+(.*)/) {
my $sign_offs = $1;
$line = $2;
$count++;
if ($sign_offs < $email_git_min_signatures ||
$count > $email_git_max_maintainers) {
$count > $email_git_max_maintainers ||
$sign_offs * 100 / $total_sign_offs < $email_git_min_percent) {
last;
}
} else {
die("$P: Unexpected git output: ${line}\n");
}
if ($line =~ m/(.+)<(.+)>/) {
my $git_name = $1;
Expand Down

0 comments on commit f7e0f06

Please sign in to comment.