Lines Matching +full:sub +full:- +full:mailbox
9 # perl scripts/get_maintainer.pl [OPTIONS] -f <file>
40 my $email_git_since = "1-year-ago";
41 my $email_hg_since = "-365";
88 push(@signature_tags, "Signed-off-by:");
89 push(@signature_tags, "Reviewed-by:");
90 push(@signature_tags, "Acked-by:");
94 # rfc822 email address - preloaded methods go here.
96 my $rfc822_char = '[\\000-\\377]';
98 # VCS command support: class-like functions and strings
104 "available" => '(which("git") ne "") && (-e ".git")',
106 "git log --no-color --follow --since=\$email_git_since " .
107 '--numstat --no-merges ' .
108 '--format="GitCommit: %H%n' .
113 " -- \$file",
115 "git log --no-color " .
116 '--numstat ' .
117 '--format="GitCommit: %H%n' .
122 " -1 \$commit",
124 "git log --no-color " .
125 '--numstat ' .
126 '--format="GitCommit: %H%n' .
130 " -1 \$commit",
131 "blame_range_cmd" => "git blame -l -L \$diff_start,+\$diff_length \$file",
132 "blame_file_cmd" => "git blame -l \$file",
133 "commit_pattern" => "^GitCommit: ([0-9a-f]{40,40})",
134 "blame_commit_pattern" => "^([0-9a-f]+) ",
138 "file_exists_cmd" => "git ls-files \$file",
143 "available" => '(which("hg") ne "") && (-d ".hg")',
145 "hg log --date=\$email_hg_since " .
146 "--template='HgCommit: {node}\\n" .
149 " -- \$file",
152 "--template='HgSubject: {desc}\\n'" .
153 " -r \$commit",
156 "--template='HgCommit: {node}\\n" .
159 " -r \$commit",
161 "blame_file_cmd" => "hg blame -n \$file",
162 "commit_pattern" => "^HgCommit: ([0-9a-f]{40,40})",
163 "blame_commit_pattern" => "^([ 0-9a-f]+):",
171 if (-f $conf) {
198 if (-f $ignore_file) {
220 'git-all-signature-types!' => \$email_git_all_signature_types,
221 'git-blame!' => \$email_git_blame,
222 'git-blame-signatures!' => \$email_git_blame_signatures,
223 'git-fallback!' => \$email_git_fallback,
224 'git-chief-penguins!' => \$email_git_penguin_chiefs,
225 'git-min-signatures=i' => \$email_git_min_signatures,
226 'git-max-maintainers=i' => \$email_git_max_maintainers,
227 'git-min-percent=i' => \$email_git_min_percent,
228 'git-since=s' => \$email_git_since,
229 'hg-since=s' => \$email_hg_since,
231 'remove-duplicates!' => \$email_remove_duplicates,
247 'pattern-depth=i' => \$pattern_depth,
250 'fe|file-emails!' => \$file_emails,
252 'find-maintainer-files' => \$find_maintainer_files,
256 die "$P: invalid argument - use --help if necessary\n";
269 if (-t STDIN && !@ARGV) {
271 die "$P: missing patchfile or -f file - use --help if necessary\n";
304 . "a U-Boot source tree.\n";
313 sub read_maintainer_file {
321 if ($line =~ m/^([A-Z]):\s*(.*)/) {
331 if ((-d $value)) {
346 sub find_is_maintainer_file {
350 return if (! -f $file);
354 sub find_ignore_git {
358 if (-d "${lk_path}MAINTAINERS") {
373 push(@mfiles, "${lk_path}MAINTAINERS") if -f "${lk_path}MAINTAINERS";
388 sub read_mailmap {
394 return if (!$email_use_mailmap || !(-f "${lk_path}.mailmap"));
409 # (see man git-shortlog)
417 $mailmap->{names}->{$address} = $real_name;
423 $mailmap->{addresses}->{$wrong_address} = $real_address;
433 $mailmap->{names}->{$wrong_address} = $real_name;
434 $mailmap->{addresses}->{$wrong_address} = $real_address;
451 $mailmap->{names}->{$wrong_email} = $real_name;
452 $mailmap->{addresses}->{$wrong_email} = $real_address;
472 if ((-d $file)) {
474 } elsif (!(-f $file)) {
482 if ($file ne "MAINTAINERS" && -f $file && ($keywords || $file_emails)) {
495 …my @poss_addr = $text =~ m$[A-Za-zÀ-ÿ\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-…
509 # of a git format-patch generated file (subject tags, etc...)
515 if (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) {
521 $patch_prefix = "^[+-].*"; #Now parsing the actual patch
522 } elsif (m/^\@\@ -(\d+),(\d+)/) {
538 . "Add -f to options?\n";
587 sub ignore_email_address {
597 sub range_is_maintained {
602 if ($line =~ m/^([A-Z]):\s*(.*)/) {
615 sub range_has_maintainer {
620 if ($line =~ m/^([A-Z]):\s*(.*)/) {
631 sub get_maintainers {
669 if ($line =~ m/^([A-Z]):\s*(.*)/) {
684 if ($line =~ m/^([A-Z]):\s*(.*)/) {
691 $value_pd++ if (substr($value,-1,1) ne "/");
692 $value_pd = -1 if ($value =~ /^\.\*/);
699 (($file_pd - $value_pd) < $pattern_depth)) {
728 my $count = $line =~ s/^([A-Z]):/$1:\t/g;
746 $email->[0] = deduplicate_email($email->[0]);
769 @email_to = grep($_->[0] !~ /${email_address}/, @email_to);
800 sub file_match_pattern {
802 if (substr($pattern, -1) eq "/") {
818 sub usage {
821 $P [options] -f file|directory
825 --email => print email address(es) if any
826 --git => include recent git \*-by: signers
827 --git-all-signature-types => include signers regardless of signature type
829 --git-fallback => use git when no exact MAINTAINERS pattern (default: $email_git_fallback)
830 --git-chief-penguins => include ${penguin_chiefs}
831 --git-min-signatures => number of signatures required (default: $email_git_min_signatures)
832 --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
833 --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent)
834 --git-blame => use git blame to find modified commits for patch or file
835 --git-blame-signatures => when used with --git-blame, also include all commit signers
836 --git-since => git history to use (default: $email_git_since)
837 --hg-since => hg history to use (default: $email_hg_since)
838 --interactive => display a menu (mostly useful if used with the --git option)
839 --m => include maintainer(s) if any
840 --r => include reviewer(s) if any
841 --n => include name 'Full Name <addr\@domain.tld>'
842 --l => include list(s) if any
843 --s => include subscriber only list(s) if any
844 --remove-duplicates => minimize duplicate email names/addresses
845 --roles => show roles (status:subsystem, git-signer, list, etc...)
846 --rolestats => show roles and statistics (commits/total_commits, %)
847 --file-emails => add email addresses found in -f file (default: 0 (off))
848 --scm => print SCM tree(s) if any
849 --status => print status if any
850 --subsystem => print subsystem name if any
851 --web => print website(s) if any
854 --separator [, ] => separator for multiple entries on 1 line
855 using --separator also sets --nomultiline if --separator is not [, ]
856 --multiline => print 1 entry per line
859 --pattern-depth => Number of pattern directory traversals (default: 0 (all))
860 --keywords => scan patch for keywords (default: $keywords)
861 --sections => print all of the subsystem sections with pattern matches
862 --letters => print all matching 'letter' types from all matching sections
863 --mailmap => use .mailmap file (default: $email_use_mailmap)
864 --version => show version
865 --help => show this help information
868 [--email --nogit --git-fallback --m --r --n --l --multiline --pattern-depth=0
869 --remove-duplicates --rolestats]
872 Using "-f directory" may give unexpected results:
873 Used with "--git", git signators for _all_ files in and below
876 Used with "--nogit", directory is used as a pattern match,
879 Used with "--git-blame", does not iterate all files in directory
880 Using "--git-blame" is slow and may add old committers and authors
882 Using "--roles" or "--rolestats" with git send-email --cc-cmd or any
885 Using "--rolestats" and "--git-blame" shows the #/total=% commits,
891 --git,
892 --git-min-signatures, --git-max-maintainers, --git-min-percent, and
893 --git-blame
894 Use --hg-since not --git-since to control date selection
901 The negative forms for --<foo> are --no<foo> and --no-<foo>.
906 sub top_of_kernel_tree {
909 if ($lk_path ne "" && substr($lk_path,length($lk_path)-1,1) ne "/") {
912 if ( (-f "${lk_path}Kbuild")
913 && (-e "${lk_path}MAINTAINERS")
914 && (-f "${lk_path}Makefile")
915 && (-f "${lk_path}README")
916 && (-d "${lk_path}arch")
917 && (-d "${lk_path}board")
918 && (-d "${lk_path}common")
919 && (-d "${lk_path}doc")
920 && (-d "${lk_path}drivers")
921 && (-d "${lk_path}dts")
922 && (-d "${lk_path}fs")
923 && (-d "${lk_path}lib")
924 && (-d "${lk_path}include")
925 && (-d "${lk_path}net")
926 && (-d "${lk_path}post")
927 && (-d "${lk_path}scripts")
928 && (-d "${lk_path}test")
929 && (-d "${lk_path}tools")) {
935 sub parse_email {
954 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
962 sub format_email {
971 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
989 sub find_first_section {
994 if (($tv =~ m/^([A-Z]):\s*(.*)/)) {
1003 sub find_starting_index {
1008 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1011 $index--;
1017 sub find_ending_index {
1022 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1031 sub get_subsystem_name {
1038 $subsystem = substr($subsystem, 0, $output_section_maxlen - 3);
1045 sub get_maintainer_role {
1057 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1084 sub get_list_role {
1096 sub add_categories {
1107 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1122 if ($list_additional =~ m/subscribers-only/) {
1148 my $tv = $typevalue[$i - 1];
1149 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1165 my $tv = $typevalue[$i - 1];
1166 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1189 sub email_inuse {
1199 sub push_email_address {
1219 sub push_email_addresses {
1238 sub add_role {
1246 my ($entry_name, $entry_address) = parse_email($entry->[0]);
1248 && ($role eq "" || !($entry->[1] =~ m/$role/))
1250 if ($entry->[1] eq "") {
1251 $entry->[1] = "$role";
1253 $entry->[1] = "$entry->[1],$role";
1257 if ($email eq $entry->[0]
1258 && ($role eq "" || !($entry->[1] =~ m/$role/))
1260 if ($entry->[1] eq "") {
1261 $entry->[1] = "$role";
1263 $entry->[1] = "$entry->[1],$role";
1270 sub which {
1274 if (-e "$path/$bin") {
1282 sub which_conf {
1286 if (-e "$path/$conf") {
1294 sub mailmap_email {
1302 if (exists $mailmap->{names}->{$email} ||
1303 exists $mailmap->{addresses}->{$email}) {
1304 if (exists $mailmap->{names}->{$email}) {
1305 $real_name = $mailmap->{names}->{$email};
1307 if (exists $mailmap->{addresses}->{$email}) {
1308 $real_address = $mailmap->{addresses}->{$email};
1311 if (exists $mailmap->{names}->{$address}) {
1312 $real_name = $mailmap->{names}->{$address};
1314 if (exists $mailmap->{addresses}->{$address}) {
1315 $real_address = $mailmap->{addresses}->{$address};
1321 sub mailmap {
1332 sub merge_by_realname {
1347 sub git_execute_cmd {
1358 sub hg_execute_cmd {
1368 sub extract_formatted_signatures {
1375 # cut -f2- -d":"
1387 sub vcs_find_signers {
1426 sub vcs_find_author {
1454 sub vcs_save_commits {
1470 sub vcs_blame {
1475 return @commits if (!(-f $file));
1519 sub vcs_exists {
1526 warn("$P: No supported VCS found. Add --nogit to options?\n");
1535 sub vcs_is_git {
1540 sub vcs_is_hg {
1544 sub interactive_get_maintainers {
1556 $maintained = 1 if ($entry->[1] =~ /^(maintainer|supporter)/i);
1570 printf STDERR "\n%1s %2s %-65s",
1579 my $email = $entry->[0];
1580 my $role = $entry->[1];
1589 printf STDERR "%1s %2d %-65s", $sel, $count + 1, $email;
1618 gf use git-fallback [$email_git_fallback]
1666 $selected{$nr - 1} = !$selected{$nr - 1};
1681 if ($list[$i]->[1] =~ /^(maintainer|supporter)/i);
1686 if ($list[$i]->[1] =~ /^(author|commit|signer)/i);
1691 if ($list[$i]->[1] =~ /^(open list)/i);
1696 if ($list[$i]->[1] =~ /^(subscriber list)/i);
1701 $authored{$val - 1} = !$authored{$val - 1};
1711 $signed{$val - 1} = !$signed{$val - 1};
1806 print STDERR "git-blame can be very slow, please have patience..."
1824 sub bool_invert {
1834 sub deduplicate_email {
1847 $name = $deduplicate_name_hash{lc($name)}->[0];
1848 $address = $deduplicate_name_hash{lc($name)}->[1];
1851 $name = $deduplicate_address_hash{lc($address)}->[0];
1852 $address = $deduplicate_address_hash{lc($address)}->[1];
1864 sub save_commits_by_author {
1897 sub save_commits_by_signer {
1934 sub vcs_assign {
1953 # uniq -c
1956 # sort -rn
1977 sub vcs_file_signoffs {
2049 sub vcs_file_blame {
2074 my $commit = join(" -r ", @commits);
2115 my $commit = join(" -r ", @commits);
2177 sub vcs_file_exists {
2195 sub uniq {
2203 sub sort_and_uniq {
2212 sub clean_file_emails {
2217 $email =~ s/[\(\<\{]{0,1}([A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+)[\)\>\}]{0,1}/\<$1\>/g;
2223 my @nw = split(/[^A-Za-zÀ-ÿ\'\,\.\+-]/, $name);
2225 my $first = $nw[@nw - 3];
2226 my $middle = $nw[@nw - 2];
2227 my $last = $nw[@nw - 1];
2229 if (((length($first) == 1 && $first =~ m/[A-Za-z]/) ||
2230 (length($first) == 2 && substr($first, -1) eq ".")) ||
2232 (length($middle) == 2 && substr($middle, -1) eq "."))) {
2239 if (substr($name, -1) =~ /[,\.]/) {
2240 $name = substr($name, 0, length($name) - 1);
2241 } elsif (substr($name, -2) =~ /[,\.]"/) {
2242 $name = substr($name, 0, length($name) - 2) . '"';
2246 $name = substr($name, 1, length($name) - 1);
2248 $name = '"' . substr($name, 2, length($name) - 2);
2257 sub merge_email {
2276 sub output {
2291 sub make_rfc822re {
2298 my $controls = '\\000-\\037\\177';
2305 # Use zero-width assertion to spot the limit of an atom. A simple
2319 my $mailbox = "(?:$addr_spec|$phrase$route_addr)";
2321 my $group = "$phrase:$rfc822_lwsp*(?:$mailbox(?:,\\s*$mailbox)*)?;\\s*";
2322 my $address = "(?:$mailbox|$group)";
2327 sub rfc822_strip_comments {
2330 # regexps in the Email Addressing FAQ are imperfect - they will miss escaped
2341 sub rfc822_valid {
2361 sub rfc822_validlist {