Lines Matching +full:- +full:- +full:commits

2 # SPDX-License-Identifier: GPL-2.0
11 # perl scripts/get_maintainer.pl [OPTIONS] -f <file>
23 use open qw(:std :encoding(UTF-8));
44 my $email_git_since = "1-year-ago";
45 my $email_hg_since = "-365";
87 push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org");
88 #Andrew wants in on most everything - 2009/01/14
89 #push(@penguin_chief, "Andrew Morton:akpm\@linux-foundation.org");
105 push(@signature_tags, "Signed-off-by:");
106 push(@signature_tags, "Reviewed-by:");
107 push(@signature_tags, "Acked-by:");
111 # rfc822 email address - preloaded methods go here.
113 my $rfc822_char = '[\\000-\\377]';
115 # VCS command support: class-like functions and strings
121 "available" => '(which("git") ne "") && (-e ".git")',
123 "git log --no-color --follow --since=\$email_git_since " .
124 '--numstat --no-merges ' .
125 '--format="GitCommit: %H%n' .
130 " -- \$file",
132 "git log --no-color " .
133 '--numstat ' .
134 '--format="GitCommit: %H%n' .
139 " -1 \$commit",
141 "git log --no-color " .
142 '--numstat ' .
143 '--format="GitCommit: %H%n' .
147 " -1 \$commit",
148 "blame_range_cmd" => "git blame -l -L \$diff_start,+\$diff_length \$file",
149 "blame_file_cmd" => "git blame -l \$file",
150 "commit_pattern" => "^GitCommit: ([0-9a-f]{40,40})",
151 "blame_commit_pattern" => "^([0-9a-f]+) ",
155 "file_exists_cmd" => "git ls-files \$file",
156 "list_files_cmd" => "git ls-files \$file",
161 "available" => '(which("hg") ne "") && (-d ".hg")',
163 "hg log --date=\$email_hg_since " .
164 "--template='HgCommit: {node}\\n" .
167 " -- \$file",
170 "--template='HgSubject: {desc}\\n'" .
171 " -r \$commit",
174 "--template='HgCommit: {node}\\n" .
177 " -r \$commit",
179 "blame_file_cmd" => "hg blame -n \$file",
180 "commit_pattern" => "^HgCommit: ([0-9a-f]{40,40})",
181 "blame_commit_pattern" => "^([ 0-9a-f]+):",
186 "list_files_cmd" => "hg manifest -R \$file",
190 if (-f $conf) {
217 if (-f $ignore_file) {
238 if ($_ =~ /^-{1,2}self-test(?:=|$)/) {
239 die "$P: using --self-test does not allow any other option or argument\n";
247 'git-all-signature-types!' => \$email_git_all_signature_types,
248 'git-blame!' => \$email_git_blame,
249 'git-blame-signatures!' => \$email_git_blame_signatures,
250 'git-fallback!' => \$email_git_fallback,
251 'git-chief-penguins!' => \$email_git_penguin_chiefs,
252 'git-min-signatures=i' => \$email_git_min_signatures,
253 'git-max-maintainers=i' => \$email_git_max_maintainers,
254 'git-min-percent=i' => \$email_git_min_percent,
255 'git-since=s' => \$email_git_since,
256 'hg-since=s' => \$email_hg_since,
258 'remove-duplicates!' => \$email_remove_duplicates,
279 'pattern-depth=i' => \$pattern_depth,
281 'kf|keywords-in-file!' => \$keywords_in_file,
283 'fe|file-emails!' => \$email_file_emails,
285 'find-maintainer-files' => \$find_maintainer_files,
286 'mpath|maintainer-path=s' => \$maintainer_path,
287 'self-test:s' => \$self_test,
291 die "$P: invalid argument - use --help if necessary\n";
310 if (-t STDIN && !@ARGV) {
312 die "$P: missing patchfile or -f file - use --help if necessary\n";
320 $output_substatus = $email && $output_roles && -t STDOUT;
371 if ($line =~ m/^([A-Z]):\s*(.*)/) {
381 if ((-d $value)) {
403 return if (! -f $file);
421 if (-d $path) {
436 } elsif (-f "$path") {
452 if (-f $file && ($email_file_emails || $file =~ /\.yaml$/)) {
458 …poss_addr = $text =~ m$[\p{L}\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\…
477 return if (!$email_use_mailmap || !(-f "${lk_path}.mailmap"));
492 # (see man git-shortlog)
500 $mailmap->{names}->{$address} = $real_name;
506 $mailmap->{addresses}->{$wrong_address} = $real_address;
516 $mailmap->{names}->{$wrong_address} = $real_name;
517 $mailmap->{addresses}->{$wrong_address} = $real_address;
534 $mailmap->{names}->{$wrong_email} = $real_name;
535 $mailmap->{addresses}->{$wrong_email} = $real_address;
551 if ((-d $file)) {
553 } elsif (!(-f $file)) {
564 if ($file ne "MAINTAINERS" && -f $file && $keywords && $keywords_in_file) {
585 # of a git format-patch generated file (subject tags, etc...)
591 if (m/^ mode change [0-7]+ => [0-7]+ (\S+)\s*$/) {
597 } elsif (m/^diff --git a\/(\S+) b\/(\S+)\s*$/) {
602 } elsif (m/^Fixes:\s+([0-9a-fA-F]{6,40})/) {
604 } elsif (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) {
610 $patch_prefix = "^[+-].*"; #Now parsing the actual patch
611 } elsif (m/^\@\@ -(\d+),(\d+)/) {
627 . "Add -f to options?\n";
702 $x->{line} =~ /^\S[^:]/ &&
704 $self_test_info[$index]->{line} =~ /^([A-Z]):\s*\S/) {
709 if (grep(m@^\Q$x->{line}\E@, @section_headers)) {
710 print("$x->{file}:$x->{linenr}: warning: duplicate section header\t$x->{line}\n");
712 push(@section_headers, $x->{line});
716 $self_test_info[$nextline]->{line} =~ /^([A-Z]):\s*(\S.*)/) {
730 print("$x->{file}:$x->{linenr}: warning: section without email address\t$x->{line}\n");
733 print("$x->{file}:$x->{linenr}: warning: section without status \t$x->{line}\n");
736 print("$x->{file}:$x->{linenr}: warning: section without file pattern\t$x->{line}\n");
740 next if ($x->{line} !~ /^([A-Z]):\s*(.*)/);
752 if ((-d $value)) {
756 print("$x->{file}:$x->{linenr}: warning: no file matches\t$x->{line}\n");
768 my $output = `wget --spider -q --no-check-certificate --timeout 10 --tries 1 $value`;
777 print("$x->{file}:$x->{linenr}: warning: possible bad link\t$x->{line}\n");
788 print("$x->{file}:$x->{linenr}: warning: malformed entry\t$x->{line}\n");
793 my $output = `git ls-remote --exit-code -h "$url" $branch > /dev/null 2>&1`;
802 my $output = `wget --spider -q --no-check-certificate --timeout 10 --tries 1 $url`;
811 print("$x->{file}:$x->{linenr}: warning: possible bad link\t$x->{line}\n");
832 if ($line =~ m/^([A-Z]):\s*(.*)/) {
850 if ($line =~ m/^([A-Z]):\s*(.*)/) {
901 if ($line =~ m/^([A-Z]):\s*(.*)/) {
916 if ($line =~ m/^([A-Z]):\s*(.*)/) {
923 $value_pd++ if (substr($value,-1,1) ne "/");
924 $value_pd = -1 if ($value =~ /^\.\*/);
931 (($file_pd - $value_pd) < $pattern_depth)) {
960 my $count = $line =~ s/^([A-Z]):/$1:\t/g;
980 $email->[0] = deduplicate_email($email->[0]);
1005 @email_to = grep($_->[0] !~ /${email_address}/, @email_to);
1043 if (substr($pattern, -1) eq "/") {
1062 $P [options] -f file|directory
1066 --email => print email address(es) if any
1067 --git => include recent git \*-by: signers
1068 --git-all-signature-types => include signers regardless of signature type
1070 --git-fallback => use git when no exact MAINTAINERS pattern (default: $email_git_fallback)
1071 --git-chief-penguins => include ${penguin_chiefs}
1072 --git-min-signatures => number of signatures required (default: $email_git_min_signatures)
1073 --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
1074 --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent)
1075 --git-blame => use git blame to find modified commits for patch or file
1076 --git-blame-signatures => when used with --git-blame, also include all commit signers
1077 --git-since => git history to use (default: $email_git_since)
1078 --hg-since => hg history to use (default: $email_hg_since)
1079 --interactive => display a menu (mostly useful if used with the --git option)
1080 --m => include maintainer(s) if any
1081 --r => include reviewer(s) if any
1082 --n => include name 'Full Name <addr\@domain.tld>'
1083 --l => include list(s) if any
1084 --moderated => include moderated lists(s) if any (default: true)
1085 --s => include subscriber only list(s) if any (default: false)
1086 --remove-duplicates => minimize duplicate email names/addresses
1087 --roles => show roles (role:subsystem, git-signer, list, etc...)
1088 --rolestats => show roles and statistics (commits/total_commits, %)
1089--substatus => show subsystem status if not Maintained (default: match --roles when output is tty)"
1090 --file-emails => add email addresses found in -f file (default: 0 (off))
1091 --fixes => for patches, add signatures of commits with 'Fixes: <commit>' (default: 1 (on))
1092 --scm => print SCM tree(s) if any
1093 --status => print status if any
1094 --subsystem => print subsystem name if any
1095 --web => print website(s) if any
1096 --bug => print bug reporting info if any
1099 --separator [, ] => separator for multiple entries on 1 line
1100 using --separator also sets --nomultiline if --separator is not [, ]
1101 --multiline => print 1 entry per line
1104 --pattern-depth => Number of pattern directory traversals (default: 0 (all))
1105 --keywords => scan patch for keywords (default: $keywords)
1106 --keywords-in-file => scan file for keywords (default: $keywords_in_file)
1107 --sections => print all of the subsystem sections with pattern matches
1108 --letters => print all matching 'letter' types from all matching sections
1109 --mailmap => use .mailmap file (default: $email_use_mailmap)
1110 --no-tree => run without a kernel tree
1111 --self-test => show potential issues with MAINTAINERS file content
1112 --version => show version
1113 --help => show this help information
1116 [--email --tree --nogit --git-fallback --m --r --n --l --multiline
1117 --pattern-depth=0 --remove-duplicates --rolestats --keywords]
1120 Using "-f directory" may give unexpected results:
1121 Used with "--git", git signators for _all_ files in and below
1124 Used with "--nogit", directory is used as a pattern match,
1127 Used with "--git-blame", does not iterate all files in directory
1128 Using "--git-blame" is slow and may add old committers and authors
1130 Using "--roles" or "--rolestats" with git send-email --cc-cmd or any
1133 Using "--rolestats" and "--git-blame" shows the #/total=% commits,
1134 not the percentage of the entire file authored. # of commits is
1136 contain a thousand lines, 5 trivial commits may modify a single line.
1139 --git,
1140 --git-min-signatures, --git-max-maintainers, --git-min-percent, and
1141 --git-blame
1142 Use --hg-since not --git-since to control date selection
1149 The negative forms for --<foo> are --no<foo> and --no-<foo>.
1157 if ($lk_path ne "" && substr($lk_path,length($lk_path)-1,1) ne "/") {
1160 if ( (-f "${lk_path}COPYING")
1161 && (-f "${lk_path}CREDITS")
1162 && (-f "${lk_path}Kbuild")
1163 && (-e "${lk_path}MAINTAINERS")
1164 && (-f "${lk_path}Makefile")
1165 && (-f "${lk_path}README")
1166 && (-d "${lk_path}Documentation")
1167 && (-d "${lk_path}arch")
1168 && (-d "${lk_path}include")
1169 && (-d "${lk_path}drivers")
1170 && (-d "${lk_path}fs")
1171 && (-d "${lk_path}init")
1172 && (-d "${lk_path}ipc")
1173 && (-d "${lk_path}kernel")
1174 && (-d "${lk_path}lib")
1175 && (-d "${lk_path}scripts")) {
1184 if ($name =~ /[^\w \-]/ai) { ##has "must quote" chars
1243 if (($tv =~ m/^([A-Z]):\s*(.*)/)) {
1257 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1260 $index--;
1271 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1287 $subsystem = substr($subsystem, 0, $output_section_maxlen - 3);
1307 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1349 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1364 if ($list_additional =~ m/subscribers-only/) {
1474 my ($entry_name, $entry_address) = parse_email($entry->[0]);
1476 && ($role eq "" || !($entry->[1] =~ m/$role/))
1478 if ($entry->[1] eq "") {
1479 $entry->[1] = "$role";
1481 $entry->[1] = "$entry->[1],$role";
1485 if ($email eq $entry->[0]
1486 && ($role eq "" || !($entry->[1] =~ m/$role/))
1488 if ($entry->[1] eq "") {
1489 $entry->[1] = "$role";
1491 $entry->[1] = "$entry->[1],$role";
1502 if (-e "$path/$bin") {
1514 if (-e "$path/$conf") {
1530 if (exists $mailmap->{names}->{$email} ||
1531 exists $mailmap->{addresses}->{$email}) {
1532 if (exists $mailmap->{names}->{$email}) {
1533 $real_name = $mailmap->{names}->{$email};
1535 if (exists $mailmap->{addresses}->{$email}) {
1536 $real_address = $mailmap->{addresses}->{$email};
1539 if (exists $mailmap->{names}->{$address}) {
1540 $real_name = $mailmap->{names}->{$address};
1542 if (exists $mailmap->{addresses}->{$address}) {
1543 $real_address = $mailmap->{addresses}->{$address};
1603 # cut -f2- -d":"
1617 my $commits;
1631 $commits = grep(/$pattern/, @lines); # of commits
1651 return ($commits, $signers_ref, $authors_ref, \@stats);
1685 my @commits = ();
1691 push(@commits, $1);
1695 return @commits;
1701 my @commits = ();
1703 return @commits if (!(-f $file));
1719 push(@commits, $all_commits[$i]);
1731 push(@commits, vcs_save_commits($cmd));
1736 @commits = vcs_save_commits($cmd);
1739 foreach my $commit (@commits) {
1743 return @commits;
1754 warn("$P: No supported VCS found. Add --nogit to options?\n");
1810 $maintained = 1 if ($entry->[1] =~ /^(maintainer|supporter)/i);
1824 printf STDERR "\n%1s %2s %-65s",
1833 my $email = $entry->[0];
1834 my $role = $entry->[1];
1843 printf STDERR "%1s %2d %-65s", $sel, $count + 1, $email;
1872 gf use git-fallback [$email_git_fallback]
1875 c# minimum commits [$email_git_min_signatures]
1921 $selected{$nr - 1} = !$selected{$nr - 1};
1936 if ($list[$i]->[1] =~ /^(maintainer|supporter)/i);
1941 if ($list[$i]->[1] =~ /^(author|commit|signer)/i);
1946 if ($list[$i]->[1] =~ /^(open list)/i);
1951 if ($list[$i]->[1] =~ /^(subscriber list)/i);
1956 $authored{$val - 1} = !$authored{$val - 1};
1966 $signed{$val - 1} = !$signed{$val - 1};
2044 be matched to its commit author and that commits signers with blame.
2061 print STDERR "git-blame can be very slow, please have patience..."
2102 $name = $deduplicate_name_hash{lc($name)}->[0];
2103 $address = $deduplicate_name_hash{lc($name)}->[1];
2106 $name = $deduplicate_address_hash{lc($address)}->[0];
2107 $address = $deduplicate_address_hash{lc($address)}->[1];
2123 my @commits = ();
2132 push(@commits, $1) if ($line =~ m/$VCS_cmds{"commit_pattern"}/);
2139 if (@{$ref}[0] eq $commits[$i] &&
2147 [ ($commits[$i], $subjects[$i]) ]);
2208 # uniq -c
2211 # sort -rn
2241 my $commits;
2249 ($commits, $signers_ref, $authors_ref, $stats_ref) = vcs_find_signers($cmd, $file);
2255 # print("commits: <$commits>\nsigners:<@signers>\nauthors: <@authors>\nstats: <@stats>\n");
2261 vcs_assign("commit_signer", $commits, @signers);
2262 vcs_assign("authored", $commits, @authors);
2309 my @commits = ();
2317 @commits = uniq(@all_commits);
2318 $total_commits = @commits;
2329 my $commit = join(" -r ", @commits);
2341 foreach my $commit (@commits) {
2368 @commits = uniq(@commits);
2369 @commits = sort(@commits);
2370 my $commit = join(" -r ", @commits);
2401 foreach my $commit (@commits) {
2423 vcs_assign("commits", $total_commits, @signers);
2428 vcs_assign("modified commits", $total_commits, @signers);
2489 $email =~ s/[\(\<\{]{0,1}([A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+)[\)\>\}]{0,1}/\<$1\>/g;
2495 # Split into name-like parts and remove stray punctuation particles
2496 my @nw = split(/[^\p{L}\'\,\.\+-]/, $name);
2497 @nw = grep(!/^[\'\,\.\+-]$/, @nw);
2503 my $first = $nw[@nw - 3];
2504 my $middle = $nw[@nw - 2];
2505 my $last = $nw[@nw - 1];
2508 (length($first) == 2 && substr($first, -1) eq ".")) ||
2510 (length($middle) == 2 && substr($middle, -1) eq "."))) {
2519 if (substr($name, -1) =~ /[,\.]/) {
2520 $name = substr($name, 0, length($name) - 1);
2524 $name = substr($name, 1, length($name) - 1);
2574 my $controls = '\\000-\\037\\177';
2581 # Use zero-width assertion to spot the limit of an atom. A simple
2606 # regexps in the Email Addressing FAQ are imperfect - they will miss escaped