Lines Matching +full:sub +full:- +full:mailbox

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";
86 push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org");
87 #Andrew wants in on most everything - 2009/01/14
88 #push(@penguin_chief, "Andrew Morton:akpm\@linux-foundation.org");
104 push(@signature_tags, "Signed-off-by:");
105 push(@signature_tags, "Reviewed-by:");
106 push(@signature_tags, "Acked-by:");
110 # rfc822 email address - preloaded methods go here.
112 my $rfc822_char = '[\\000-\\377]';
114 # VCS command support: class-like functions and strings
120 "available" => '(which("git") ne "") && (-e ".git")',
122 "git log --no-color --follow --since=\$email_git_since " .
123 '--numstat --no-merges ' .
124 '--format="GitCommit: %H%n' .
129 " -- \$file",
131 "git log --no-color " .
132 '--numstat ' .
133 '--format="GitCommit: %H%n' .
138 " -1 \$commit",
140 "git log --no-color " .
141 '--numstat ' .
142 '--format="GitCommit: %H%n' .
146 " -1 \$commit",
147 "blame_range_cmd" => "git blame -l -L \$diff_start,+\$diff_length \$file",
148 "blame_file_cmd" => "git blame -l \$file",
149 "commit_pattern" => "^GitCommit: ([0-9a-f]{40,40})",
150 "blame_commit_pattern" => "^([0-9a-f]+) ",
154 "file_exists_cmd" => "git ls-files \$file",
155 "list_files_cmd" => "git ls-files \$file",
160 "available" => '(which("hg") ne "") && (-d ".hg")',
162 "hg log --date=\$email_hg_since " .
163 "--template='HgCommit: {node}\\n" .
166 " -- \$file",
169 "--template='HgSubject: {desc}\\n'" .
170 " -r \$commit",
173 "--template='HgCommit: {node}\\n" .
176 " -r \$commit",
178 "blame_file_cmd" => "hg blame -n \$file",
179 "commit_pattern" => "^HgCommit: ([0-9a-f]{40,40})",
180 "blame_commit_pattern" => "^([ 0-9a-f]+):",
185 "list_files_cmd" => "hg manifest -R \$file",
189 if (-f $conf) {
216 if (-f $ignore_file) {
237 if ($_ =~ /^-{1,2}self-test(?:=|$)/) {
238 die "$P: using --self-test does not allow any other option or argument\n";
246 'git-all-signature-types!' => \$email_git_all_signature_types,
247 'git-blame!' => \$email_git_blame,
248 'git-blame-signatures!' => \$email_git_blame_signatures,
249 'git-fallback!' => \$email_git_fallback,
250 'git-chief-penguins!' => \$email_git_penguin_chiefs,
251 'git-min-signatures=i' => \$email_git_min_signatures,
252 'git-max-maintainers=i' => \$email_git_max_maintainers,
253 'git-min-percent=i' => \$email_git_min_percent,
254 'git-since=s' => \$email_git_since,
255 'hg-since=s' => \$email_hg_since,
257 'remove-duplicates!' => \$email_remove_duplicates,
277 'pattern-depth=i' => \$pattern_depth,
279 'kf|keywords-in-file!' => \$keywords_in_file,
281 'fe|file-emails!' => \$email_file_emails,
283 'find-maintainer-files' => \$find_maintainer_files,
284 'mpath|maintainer-path=s' => \$maintainer_path,
285 'self-test:s' => \$self_test,
289 die "$P: invalid argument - use --help if necessary\n";
308 if (-t STDIN && !@ARGV) {
310 die "$P: missing patchfile or -f file - use --help if necessary\n";
355 sub read_maintainer_file {
365 if ($line =~ m/^([A-Z]):\s*(.*)/) {
375 if ((-d $value)) {
393 sub find_is_maintainer_file {
397 return if (! -f $file);
401 sub find_ignore_git {
407 sub read_all_maintainer_files {
415 if (-d $path) {
430 } elsif (-f "$path") {
441 sub maintainers_in_file {
446 if (-f $file && ($email_file_emails || $file =~ /\.yaml$/)) {
452 …poss_addr = $text =~ m$[\p{L}\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\…
465 sub read_mailmap {
471 return if (!$email_use_mailmap || !(-f "${lk_path}.mailmap"));
486 # (see man git-shortlog)
494 $mailmap->{names}->{$address} = $real_name;
500 $mailmap->{addresses}->{$wrong_address} = $real_address;
510 $mailmap->{names}->{$wrong_address} = $real_name;
511 $mailmap->{addresses}->{$wrong_address} = $real_address;
528 $mailmap->{names}->{$wrong_email} = $real_name;
529 $mailmap->{addresses}->{$wrong_email} = $real_address;
545 if ((-d $file)) {
547 } elsif (!(-f $file)) {
558 if ($file ne "MAINTAINERS" && -f $file && $keywords && $keywords_in_file) {
579 # of a git format-patch generated file (subject tags, etc...)
585 if (m/^ mode change [0-7]+ => [0-7]+ (\S+)\s*$/) {
591 } elsif (m/^diff --git a\/(\S+) b\/(\S+)\s*$/) {
596 } elsif (m/^Fixes:\s+([0-9a-fA-F]{6,40})/) {
598 } elsif (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) {
604 $patch_prefix = "^[+-].*"; #Now parsing the actual patch
605 } elsif (m/^\@\@ -(\d+),(\d+)/) {
621 . "Add -f to options?\n";
676 sub self_test {
690 $x->{line} =~ /^\S[^:]/ &&
692 $self_test_info[$index]->{line} =~ /^([A-Z]):\s*\S/) {
697 if (grep(m@^\Q$x->{line}\E@, @section_headers)) {
698 print("$x->{file}:$x->{linenr}: warning: duplicate section header\t$x->{line}\n");
700 push(@section_headers, $x->{line});
704 $self_test_info[$nextline]->{line} =~ /^([A-Z]):\s*(\S.*)/) {
718 print("$x->{file}:$x->{linenr}: warning: section without email address\t$x->{line}\n");
721 print("$x->{file}:$x->{linenr}: warning: section without status \t$x->{line}\n");
724 print("$x->{file}:$x->{linenr}: warning: section without file pattern\t$x->{line}\n");
728 next if ($x->{line} !~ /^([A-Z]):\s*(.*)/);
740 if ((-d $value)) {
744 print("$x->{file}:$x->{linenr}: warning: no file matches\t$x->{line}\n");
756 my $output = `wget --spider -q --no-check-certificate --timeout 10 --tries 1 $value`;
765 print("$x->{file}:$x->{linenr}: warning: possible bad link\t$x->{line}\n");
776 print("$x->{file}:$x->{linenr}: warning: malformed entry\t$x->{line}\n");
781 my $output = `git ls-remote --exit-code -h "$url" $branch > /dev/null 2>&1`;
790 my $output = `wget --spider -q --no-check-certificate --timeout 10 --tries 1 $url`;
799 print("$x->{file}:$x->{linenr}: warning: possible bad link\t$x->{line}\n");
805 sub ignore_email_address {
815 sub range_is_maintained {
820 if ($line =~ m/^([A-Z]):\s*(.*)/) {
833 sub range_has_maintainer {
838 if ($line =~ m/^([A-Z]):\s*(.*)/) {
849 sub get_maintainers {
888 if ($line =~ m/^([A-Z]):\s*(.*)/) {
903 if ($line =~ m/^([A-Z]):\s*(.*)/) {
910 $value_pd++ if (substr($value,-1,1) ne "/");
911 $value_pd = -1 if ($value =~ /^\.\*/);
918 (($file_pd - $value_pd) < $pattern_depth)) {
947 my $count = $line =~ s/^([A-Z]):/$1:\t/g;
967 $email->[0] = deduplicate_email($email->[0]);
992 @email_to = grep($_->[0] !~ /${email_address}/, @email_to);
1028 sub file_match_pattern {
1030 if (substr($pattern, -1) eq "/") {
1046 sub usage {
1049 $P [options] -f file|directory
1053 --email => print email address(es) if any
1054 --git => include recent git \*-by: signers
1055 --git-all-signature-types => include signers regardless of signature type
1057 --git-fallback => use git when no exact MAINTAINERS pattern (default: $email_git_fallback)
1058 --git-chief-penguins => include ${penguin_chiefs}
1059 --git-min-signatures => number of signatures required (default: $email_git_min_signatures)
1060 --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
1061 --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent)
1062 --git-blame => use git blame to find modified commits for patch or file
1063 --git-blame-signatures => when used with --git-blame, also include all commit signers
1064 --git-since => git history to use (default: $email_git_since)
1065 --hg-since => hg history to use (default: $email_hg_since)
1066 --interactive => display a menu (mostly useful if used with the --git option)
1067 --m => include maintainer(s) if any
1068 --r => include reviewer(s) if any
1069 --n => include name 'Full Name <addr\@domain.tld>'
1070 --l => include list(s) if any
1071 --moderated => include moderated lists(s) if any (default: true)
1072 --s => include subscriber only list(s) if any (default: false)
1073 --remove-duplicates => minimize duplicate email names/addresses
1074 --roles => show roles (status:subsystem, git-signer, list, etc...)
1075 --rolestats => show roles and statistics (commits/total_commits, %)
1076 --file-emails => add email addresses found in -f file (default: 0 (off))
1077 --fixes => for patches, add signatures of commits with 'Fixes: <commit>' (default: 1 (on))
1078 --scm => print SCM tree(s) if any
1079 --status => print status if any
1080 --subsystem => print subsystem name if any
1081 --web => print website(s) if any
1082 --bug => print bug reporting info if any
1085 --separator [, ] => separator for multiple entries on 1 line
1086 using --separator also sets --nomultiline if --separator is not [, ]
1087 --multiline => print 1 entry per line
1090 --pattern-depth => Number of pattern directory traversals (default: 0 (all))
1091 --keywords => scan patch for keywords (default: $keywords)
1092 --keywords-in-file => scan file for keywords (default: $keywords_in_file)
1093 --sections => print all of the subsystem sections with pattern matches
1094 --letters => print all matching 'letter' types from all matching sections
1095 --mailmap => use .mailmap file (default: $email_use_mailmap)
1096 --no-tree => run without a kernel tree
1097 --self-test => show potential issues with MAINTAINERS file content
1098 --version => show version
1099 --help => show this help information
1102 [--email --tree --nogit --git-fallback --m --r --n --l --multiline
1103 --pattern-depth=0 --remove-duplicates --rolestats --keywords]
1106 Using "-f directory" may give unexpected results:
1107 Used with "--git", git signators for _all_ files in and below
1110 Used with "--nogit", directory is used as a pattern match,
1113 Used with "--git-blame", does not iterate all files in directory
1114 Using "--git-blame" is slow and may add old committers and authors
1116 Using "--roles" or "--rolestats" with git send-email --cc-cmd or any
1119 Using "--rolestats" and "--git-blame" shows the #/total=% commits,
1125 --git,
1126 --git-min-signatures, --git-max-maintainers, --git-min-percent, and
1127 --git-blame
1128 Use --hg-since not --git-since to control date selection
1135 The negative forms for --<foo> are --no<foo> and --no-<foo>.
1140 sub top_of_kernel_tree {
1143 if ($lk_path ne "" && substr($lk_path,length($lk_path)-1,1) ne "/") {
1146 if ( (-f "${lk_path}COPYING")
1147 && (-f "${lk_path}CREDITS")
1148 && (-f "${lk_path}Kbuild")
1149 && (-e "${lk_path}MAINTAINERS")
1150 && (-f "${lk_path}Makefile")
1151 && (-f "${lk_path}README")
1152 && (-d "${lk_path}Documentation")
1153 && (-d "${lk_path}arch")
1154 && (-d "${lk_path}include")
1155 && (-d "${lk_path}drivers")
1156 && (-d "${lk_path}fs")
1157 && (-d "${lk_path}init")
1158 && (-d "${lk_path}ipc")
1159 && (-d "${lk_path}kernel")
1160 && (-d "${lk_path}lib")
1161 && (-d "${lk_path}scripts")) {
1167 sub escape_name {
1170 if ($name =~ /[^\w \-]/ai) { ##has "must quote" chars
1178 sub parse_email {
1201 sub format_email {
1224 sub find_first_section {
1229 if (($tv =~ m/^([A-Z]):\s*(.*)/)) {
1238 sub find_starting_index {
1243 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1246 $index--;
1252 sub find_ending_index {
1257 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1266 sub get_subsystem_name {
1273 $subsystem = substr($subsystem, 0, $output_section_maxlen - 3);
1280 sub get_maintainer_role {
1292 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1319 sub get_list_role {
1331 sub add_categories {
1342 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1357 if ($list_additional =~ m/subscribers-only/) {
1405 sub email_inuse {
1415 sub push_email_address {
1435 sub push_email_addresses {
1454 sub add_role {
1462 my ($entry_name, $entry_address) = parse_email($entry->[0]);
1464 && ($role eq "" || !($entry->[1] =~ m/$role/))
1466 if ($entry->[1] eq "") {
1467 $entry->[1] = "$role";
1469 $entry->[1] = "$entry->[1],$role";
1473 if ($email eq $entry->[0]
1474 && ($role eq "" || !($entry->[1] =~ m/$role/))
1476 if ($entry->[1] eq "") {
1477 $entry->[1] = "$role";
1479 $entry->[1] = "$entry->[1],$role";
1486 sub which {
1490 if (-e "$path/$bin") {
1498 sub which_conf {
1502 if (-e "$path/$conf") {
1510 sub mailmap_email {
1518 if (exists $mailmap->{names}->{$email} ||
1519 exists $mailmap->{addresses}->{$email}) {
1520 if (exists $mailmap->{names}->{$email}) {
1521 $real_name = $mailmap->{names}->{$email};
1523 if (exists $mailmap->{addresses}->{$email}) {
1524 $real_address = $mailmap->{addresses}->{$email};
1527 if (exists $mailmap->{names}->{$address}) {
1528 $real_name = $mailmap->{names}->{$address};
1530 if (exists $mailmap->{addresses}->{$address}) {
1531 $real_address = $mailmap->{addresses}->{$address};
1537 sub mailmap {
1548 sub merge_by_realname {
1563 sub git_execute_cmd {
1574 sub hg_execute_cmd {
1584 sub extract_formatted_signatures {
1591 # cut -f2- -d":"
1603 sub vcs_find_signers {
1642 sub vcs_find_author {
1670 sub vcs_save_commits {
1686 sub vcs_blame {
1691 return @commits if (!(-f $file));
1735 sub vcs_exists {
1742 warn("$P: No supported VCS found. Add --nogit to options?\n");
1751 sub vcs_is_git {
1756 sub vcs_is_hg {
1760 sub vcs_add_commit_signers {
1786 sub interactive_get_maintainers {
1798 $maintained = 1 if ($entry->[1] =~ /^(maintainer|supporter)/i);
1812 printf STDERR "\n%1s %2s %-65s",
1821 my $email = $entry->[0];
1822 my $role = $entry->[1];
1831 printf STDERR "%1s %2d %-65s", $sel, $count + 1, $email;
1860 gf use git-fallback [$email_git_fallback]
1908 $selected{$nr - 1} = !$selected{$nr - 1};
1923 if ($list[$i]->[1] =~ /^(maintainer|supporter)/i);
1928 if ($list[$i]->[1] =~ /^(author|commit|signer)/i);
1933 if ($list[$i]->[1] =~ /^(open list)/i);
1938 if ($list[$i]->[1] =~ /^(subscriber list)/i);
1943 $authored{$val - 1} = !$authored{$val - 1};
1953 $signed{$val - 1} = !$signed{$val - 1};
2048 print STDERR "git-blame can be very slow, please have patience..."
2066 sub bool_invert {
2076 sub deduplicate_email {
2089 $name = $deduplicate_name_hash{lc($name)}->[0];
2090 $address = $deduplicate_name_hash{lc($name)}->[1];
2093 $name = $deduplicate_address_hash{lc($address)}->[0];
2094 $address = $deduplicate_address_hash{lc($address)}->[1];
2106 sub save_commits_by_author {
2139 sub save_commits_by_signer {
2176 sub vcs_assign {
2195 # uniq -c
2198 # sort -rn
2219 sub vcs_file_signoffs {
2291 sub vcs_file_blame {
2316 my $commit = join(" -r ", @commits);
2357 my $commit = join(" -r ", @commits);
2419 sub vcs_file_exists {
2437 sub vcs_list_files {
2454 sub uniq {
2462 sub sort_and_uniq {
2471 sub clean_file_emails {
2476 $email =~ s/[\(\<\{]{0,1}([A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+)[\)\>\}]{0,1}/\<$1\>/g;
2482 # Split into name-like parts and remove stray punctuation particles
2483 my @nw = split(/[^\p{L}\'\,\.\+-]/, $name);
2484 @nw = grep(!/^[\'\,\.\+-]$/, @nw);
2490 my $first = $nw[@nw - 3];
2491 my $middle = $nw[@nw - 2];
2492 my $last = $nw[@nw - 1];
2495 (length($first) == 2 && substr($first, -1) eq ".")) ||
2497 (length($middle) == 2 && substr($middle, -1) eq "."))) {
2506 if (substr($name, -1) =~ /[,\.]/) {
2507 $name = substr($name, 0, length($name) - 1);
2511 $name = substr($name, 1, length($name) - 1);
2520 sub merge_email {
2539 sub output {
2554 sub make_rfc822re {
2561 my $controls = '\\000-\\037\\177';
2568 # Use zero-width assertion to spot the limit of an atom. A simple
2582 my $mailbox = "(?:$addr_spec|$phrase$route_addr)";
2584 my $group = "$phrase:$rfc822_lwsp*(?:$mailbox(?:,\\s*$mailbox)*)?;\\s*";
2585 my $address = "(?:$mailbox|$group)";
2590 sub rfc822_strip_comments {
2593 # regexps in the Email Addressing FAQ are imperfect - they will miss escaped
2604 sub rfc822_valid {
2624 sub rfc822_validlist {