Lines Matching +full:line +full:- +full:name
2 # SPDX-License-Identifier: GPL-2.0
11 # perl scripts/get_maintainer.pl [OPTIONS] -f <file>
43 my $email_git_since = "1-year-ago";
44 my $email_hg_since = "-365";
83 push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org");
84 #Andrew wants in on most everything - 2009/01/14
85 #push(@penguin_chief, "Andrew Morton:akpm\@linux-foundation.org");
101 push(@signature_tags, "Signed-off-by:");
102 push(@signature_tags, "Reviewed-by:");
103 push(@signature_tags, "Acked-by:");
107 # rfc822 email address - preloaded methods go here.
109 my $rfc822_char = '[\\000-\\377]';
111 # VCS command support: class-like functions and strings
117 "available" => '(which("git") ne "") && (-e ".git")',
119 "git log --no-color --follow --since=\$email_git_since " .
120 '--numstat --no-merges ' .
121 '--format="GitCommit: %H%n' .
126 " -- \$file",
128 "git log --no-color " .
129 '--numstat ' .
130 '--format="GitCommit: %H%n' .
135 " -1 \$commit",
137 "git log --no-color " .
138 '--numstat ' .
139 '--format="GitCommit: %H%n' .
143 " -1 \$commit",
144 "blame_range_cmd" => "git blame -l -L \$diff_start,+\$diff_length \$file",
145 "blame_file_cmd" => "git blame -l \$file",
146 "commit_pattern" => "^GitCommit: ([0-9a-f]{40,40})",
147 "blame_commit_pattern" => "^([0-9a-f]+) ",
151 "file_exists_cmd" => "git ls-files \$file",
152 "list_files_cmd" => "git ls-files \$file",
157 "available" => '(which("hg") ne "") && (-d ".hg")',
159 "hg log --date=\$email_hg_since " .
160 "--template='HgCommit: {node}\\n" .
163 " -- \$file",
166 "--template='HgSubject: {desc}\\n'" .
167 " -r \$commit",
170 "--template='HgCommit: {node}\\n" .
173 " -r \$commit",
175 "blame_file_cmd" => "hg blame -n \$file",
176 "commit_pattern" => "^HgCommit: ([0-9a-f]{40,40})",
177 "blame_commit_pattern" => "^([ 0-9a-f]+):",
182 "list_files_cmd" => "hg manifest -R \$file",
186 if (-f $conf) {
192 my $line = $_;
194 $line =~ s/\s*\n?$//g;
195 $line =~ s/^\s*//g;
196 $line =~ s/\s+/ /g;
198 next if ($line =~ m/^\s*#/);
199 next if ($line =~ m/^\s*$/);
201 my @words = split(" ", $line);
213 if (-f $ignore_file) {
217 my $line = $_;
219 $line =~ s/\s*\n?$//;
220 $line =~ s/^\s*//;
221 $line =~ s/\s+$//;
222 $line =~ s/#.*$//;
224 next if ($line =~ m/^\s*$/);
225 if (rfc822_valid($line)) {
226 push(@ignore_emails, $line);
234 if ($_ =~ /^-{1,2}self-test(?:=|$)/) {
235 die "$P: using --self-test does not allow any other option or argument\n";
243 'git-all-signature-types!' => \$email_git_all_signature_types,
244 'git-blame!' => \$email_git_blame,
245 'git-blame-signatures!' => \$email_git_blame_signatures,
246 'git-fallback!' => \$email_git_fallback,
247 'git-chief-penguins!' => \$email_git_penguin_chiefs,
248 'git-min-signatures=i' => \$email_git_min_signatures,
249 'git-max-maintainers=i' => \$email_git_max_maintainers,
250 'git-min-percent=i' => \$email_git_min_percent,
251 'git-since=s' => \$email_git_since,
252 'hg-since=s' => \$email_hg_since,
254 'remove-duplicates!' => \$email_remove_duplicates,
273 'pattern-depth=i' => \$pattern_depth,
276 'fe|file-emails!' => \$email_file_emails,
278 'find-maintainer-files' => \$find_maintainer_files,
279 'mpath|maintainer-path=s' => \$maintainer_path,
280 'self-test:s' => \$self_test,
284 die "$P: invalid argument - use --help if necessary\n";
303 if (-t STDIN && !@ARGV) {
304 # We're talking to a terminal, but have no command line arguments.
305 die "$P: missing patchfile or -f file - use --help if necessary\n";
355 my $line = $_;
356 chomp $line;
358 if ($line =~ m/^([A-Z]):\s*(.*)/) {
368 if ((-d $value)) {
376 push(@typevalue, $line);
379 push(@self_test_info, {file=>$file, linenr=>$i, line=>$line});
389 $file = $File::Find::name;
390 return if (! -f $file);
408 if (-d $path) {
423 } elsif (-f "$path") {
439 if (-f $file && ($email_file_emails || $file =~ /\.yaml$/)) {
445 …my @poss_addr = $text =~ m$[A-Za-zÀ-ÿ\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-…
464 return if (!$email_use_mailmap || !(-f "${lk_path}.mailmap"));
479 # (see man git-shortlog)
487 $mailmap->{names}->{$address} = $real_name;
493 $mailmap->{addresses}->{$wrong_address} = $real_address;
503 $mailmap->{names}->{$wrong_address} = $real_name;
504 $mailmap->{addresses}->{$wrong_address} = $real_address;
521 $mailmap->{names}->{$wrong_email} = $real_name;
522 $mailmap->{addresses}->{$wrong_email} = $real_address;
528 ## use the filenames on the command line or find the filenames in the patchfiles
538 if ((-d $file)) {
540 } elsif (!(-f $file)) {
551 if ($file ne "MAINTAINERS" && -f $file && $keywords) {
557 foreach my $line (keys %keyword_hash) {
558 if ($text =~ m/$keyword_hash{$line}/x) {
559 push(@keyword_tvi, $line);
574 # of a git format-patch generated file (subject tags, etc...)
580 if (m/^ mode change [0-7]+ => [0-7]+ (\S+)\s*$/) {
586 } elsif (m/^diff --git a\/(\S+) b\/(\S+)\s*$/) {
591 } elsif (m/^Fixes:\s+([0-9a-fA-F]{6,40})/) {
593 } elsif (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) {
599 $patch_prefix = "^[+-].*"; #Now parsing the actual patch
600 } elsif (m/^\@\@ -(\d+),(\d+)/) {
605 foreach my $line (keys %keyword_hash) {
606 if ($patch_line =~ m/${patch_prefix}$keyword_hash{$line}/x) {
607 push(@keyword_tvi, $line);
616 . "Add -f to options?\n";
679 $x->{line} =~ /^\S[^:]/ &&
681 $self_test_info[$index]->{line} =~ /^([A-Z]):\s*\S/) {
686 if (grep(m@^\Q$x->{line}\E@, @section_headers)) {
687 print("$x->{file}:$x->{linenr}: warning: duplicate section header\t$x->{line}\n");
689 push(@section_headers, $x->{line});
693 $self_test_info[$nextline]->{line} =~ /^([A-Z]):\s*(\S.*)/) {
707 print("$x->{file}:$x->{linenr}: warning: section without email address\t$x->{line}\n");
710 print("$x->{file}:$x->{linenr}: warning: section without status \t$x->{line}\n");
713 print("$x->{file}:$x->{linenr}: warning: section without file pattern\t$x->{line}\n");
717 next if ($x->{line} !~ /^([A-Z]):\s*(.*)/);
729 if ((-d $value)) {
733 print("$x->{file}:$x->{linenr}: warning: no file matches\t$x->{line}\n");
745 my $output = `wget --spider -q --no-check-certificate --timeout 10 --tries 1 $value`;
754 print("$x->{file}:$x->{linenr}: warning: possible bad link\t$x->{line}\n");
765 print("$x->{file}:$x->{linenr}: warning: malformed entry\t$x->{line}\n");
770 my $output = `git ls-remote --exit-code -h "$url" $branch > /dev/null 2>&1`;
779 my $output = `wget --spider -q --no-check-certificate --timeout 10 --tries 1 $url`;
788 print("$x->{file}:$x->{linenr}: warning: possible bad link\t$x->{line}\n");
808 my $line = $typevalue[$i];
809 if ($line =~ m/^([A-Z]):\s*(.*)/) {
826 my $line = $typevalue[$i];
827 if ($line =~ m/^([A-Z]):\s*(.*)/) {
875 my $line = $typevalue[$i];
876 if ($line =~ m/^([A-Z]):\s*(.*)/) {
890 my $line = $typevalue[$i];
891 if ($line =~ m/^([A-Z]):\s*(.*)/) {
898 $value_pd++ if (substr($value,-1,1) ne "/");
899 $value_pd = -1 if ($value =~ /^\.\*/);
906 (($file_pd - $value_pd) < $pattern_depth)) {
921 foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
922 add_categories($line);
925 my $start = find_starting_index($line);
926 my $end = find_ending_index($line);
928 my $line = $typevalue[$i];
929 if ($line =~ /^[FX]:/) { ##Restore file patterns
930 $line =~ s/([^\\])\.([^\*])/$1\?$2/g;
931 $line =~ s/([^\\])\.$/$1\?/g; ##Convert . back to ?
932 $line =~ s/\\\./\./g; ##Convert \. to .
933 $line =~ s/\.\*/\*/g; ##Convert .* to *
935 my $count = $line =~ s/^([A-Z]):/$1:\t/g;
937 print("$line\n");
949 foreach my $line (@keyword_tvi) {
950 add_categories($line);
955 $email->[0] = deduplicate_email($email->[0]);
980 @email_to = grep($_->[0] !~ /${email_address}/, @email_to);
986 my ($name, $address) = parse_email($email);
988 my $tmp_email = format_email($name, $address, $email_usename);
1017 if (substr($pattern, -1) eq "/") {
1036 $P [options] -f file|directory
1040 --email => print email address(es) if any
1041 --git => include recent git \*-by: signers
1042 --git-all-signature-types => include signers regardless of signature type
1044 --git-fallback => use git when no exact MAINTAINERS pattern (default: $email_git_fallback)
1045 --git-chief-penguins => include ${penguin_chiefs}
1046 --git-min-signatures => number of signatures required (default: $email_git_min_signatures)
1047 --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
1048 --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent)
1049 --git-blame => use git blame to find modified commits for patch or file
1050 --git-blame-signatures => when used with --git-blame, also include all commit signers
1051 --git-since => git history to use (default: $email_git_since)
1052 --hg-since => hg history to use (default: $email_hg_since)
1053 --interactive => display a menu (mostly useful if used with the --git option)
1054 --m => include maintainer(s) if any
1055 --r => include reviewer(s) if any
1056 --n => include name 'Full Name <addr\@domain.tld>'
1057 --l => include list(s) if any
1058 --moderated => include moderated lists(s) if any (default: true)
1059 --s => include subscriber only list(s) if any (default: false)
1060 --remove-duplicates => minimize duplicate email names/addresses
1061 --roles => show roles (status:subsystem, git-signer, list, etc...)
1062 --rolestats => show roles and statistics (commits/total_commits, %)
1063 --file-emails => add email addresses found in -f file (default: 0 (off))
1064 --fixes => for patches, add signatures of commits with 'Fixes: <commit>' (default: 1 (on))
1065 --scm => print SCM tree(s) if any
1066 --status => print status if any
1067 --subsystem => print subsystem name if any
1068 --web => print website(s) if any
1071 --separator [, ] => separator for multiple entries on 1 line
1072 using --separator also sets --nomultiline if --separator is not [, ]
1073 --multiline => print 1 entry per line
1076 --pattern-depth => Number of pattern directory traversals (default: 0 (all))
1077 --keywords => scan patch for keywords (default: $keywords)
1078 --sections => print all of the subsystem sections with pattern matches
1079 --letters => print all matching 'letter' types from all matching sections
1080 --mailmap => use .mailmap file (default: $email_use_mailmap)
1081 --no-tree => run without a kernel tree
1082 --self-test => show potential issues with MAINTAINERS file content
1083 --version => show version
1084 --help => show this help information
1087 [--email --tree --nogit --git-fallback --m --r --n --l --multiline
1088 --pattern-depth=0 --remove-duplicates --rolestats]
1091 Using "-f directory" may give unexpected results:
1092 Used with "--git", git signators for _all_ files in and below
1095 Used with "--nogit", directory is used as a pattern match,
1098 Used with "--git-blame", does not iterate all files in directory
1099 Using "--git-blame" is slow and may add old committers and authors
1101 Using "--roles" or "--rolestats" with git send-email --cc-cmd or any
1102 other automated tools that expect only ["name"] <email address>
1104 Using "--rolestats" and "--git-blame" shows the #/total=% commits,
1107 contain a thousand lines, 5 trivial commits may modify a single line.
1110 --git,
1111 --git-min-signatures, --git-max-maintainers, --git-min-percent, and
1112 --git-blame
1113 Use --hg-since not --git-since to control date selection
1116 Entries in this file can be any command line argument.
1117 This file is prepended to any additional command line arguments.
1120 The negative forms for --<foo> are --no<foo> and --no-<foo>.
1128 if ($lk_path ne "" && substr($lk_path,length($lk_path)-1,1) ne "/") {
1131 if ( (-f "${lk_path}COPYING")
1132 && (-f "${lk_path}CREDITS")
1133 && (-f "${lk_path}Kbuild")
1134 && (-e "${lk_path}MAINTAINERS")
1135 && (-f "${lk_path}Makefile")
1136 && (-f "${lk_path}README")
1137 && (-d "${lk_path}Documentation")
1138 && (-d "${lk_path}arch")
1139 && (-d "${lk_path}include")
1140 && (-d "${lk_path}drivers")
1141 && (-d "${lk_path}fs")
1142 && (-d "${lk_path}init")
1143 && (-d "${lk_path}ipc")
1144 && (-d "${lk_path}kernel")
1145 && (-d "${lk_path}lib")
1146 && (-d "${lk_path}scripts")) {
1155 my $name = "";
1159 $name = $1;
1167 $name =~ s/^\s+|\s+$//g;
1168 $name =~ s/^\"|\"$//g;
1171 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
1172 $name =~ s/(?<!\\)"/\\"/g; ##escape quotes
1173 $name = "\"$name\"";
1176 return ($name, $address);
1180 my ($name, $address, $usename) = @_;
1184 $name =~ s/^\s+|\s+$//g;
1185 $name =~ s/^\"|\"$//g;
1188 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
1189 $name =~ s/(?<!\\)"/\\"/g; ##escape quotes
1190 $name = "\"$name\"";
1194 if ("$name" eq "") {
1197 $formatted_email = "$name <$address>";
1211 if (($tv =~ m/^([A-Z]):\s*(.*)/)) {
1225 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1228 $index--;
1239 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1255 $subsystem = substr($subsystem, 0, $output_section_maxlen - 3);
1274 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1324 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1339 if ($list_additional =~ m/subscribers-only/) {
1386 my ($name, $address) = @_;
1388 return 1 if (($name eq "") && ($address eq ""));
1389 return 1 if (($name ne "") && exists($email_hash_name{lc($name)}));
1396 my ($line, $role) = @_;
1398 my ($name, $address) = parse_email($line);
1405 push(@email_to, [format_email($name, $address, $email_usename), $role]);
1406 } elsif (!email_inuse($name, $address)) {
1407 push(@email_to, [format_email($name, $address, $email_usename), $role]);
1408 $email_hash_name{lc($name)}++ if ($name ne "");
1435 my ($line, $role) = @_;
1437 my ($name, $address) = parse_email($line);
1438 my $email = format_email($name, $address, $email_usename);
1442 my ($entry_name, $entry_address) = parse_email($entry->[0]);
1443 if (($name eq $entry_name || $address eq $entry_address)
1444 && ($role eq "" || !($entry->[1] =~ m/$role/))
1446 if ($entry->[1] eq "") {
1447 $entry->[1] = "$role";
1449 $entry->[1] = "$entry->[1],$role";
1453 if ($email eq $entry->[0]
1454 && ($role eq "" || !($entry->[1] =~ m/$role/))
1456 if ($entry->[1] eq "") {
1457 $entry->[1] = "$role";
1459 $entry->[1] = "$entry->[1],$role";
1470 if (-e "$path/$bin") {
1482 if (-e "$path/$conf") {
1491 my ($line) = @_;
1493 my ($name, $address) = parse_email($line);
1494 my $email = format_email($name, $address, 1);
1495 my $real_name = $name;
1498 if (exists $mailmap->{names}->{$email} ||
1499 exists $mailmap->{addresses}->{$email}) {
1500 if (exists $mailmap->{names}->{$email}) {
1501 $real_name = $mailmap->{names}->{$email};
1503 if (exists $mailmap->{addresses}->{$email}) {
1504 $real_address = $mailmap->{addresses}->{$email};
1507 if (exists $mailmap->{names}->{$address}) {
1508 $real_name = $mailmap->{names}->{$address};
1510 if (exists $mailmap->{addresses}->{$address}) {
1511 $real_address = $mailmap->{addresses}->{$address};
1521 foreach my $line (@addresses) {
1522 push(@mapped_emails, mailmap_email($line));
1533 my ($name, $address) = parse_email($email);
1534 if (exists $address_map{$name}) {
1535 $address = $address_map{$name};
1536 $email = format_email($name, $address, 1);
1538 $address_map{$name} = $address;
1571 # cut -f2- -d":"
1635 foreach my $line (@lines) {
1636 if ($line =~ m/$VCS_cmds{"author_pattern"}/) {
1638 my ($name, $address) = parse_email($author);
1639 $author = format_email($name, $address, 1);
1657 foreach my $line (@lines) {
1658 if ($line =~ m/$VCS_cmds{"blame_commit_pattern"}/) {
1671 return @commits if (!(-f $file));
1722 warn("$P: No supported VCS found. Add --nogit to options?\n");
1778 $maintained = 1 if ($entry->[1] =~ /^(maintainer|supporter)/i);
1792 printf STDERR "\n%1s %2s %-65s",
1801 my $email = $entry->[0];
1802 my $role = $entry->[1];
1811 printf STDERR "%1s %2d %-65s", $sel, $count + 1, $email;
1840 gf use git-fallback [$email_git_fallback]
1888 $selected{$nr - 1} = !$selected{$nr - 1};
1903 if ($list[$i]->[1] =~ /^(maintainer|supporter)/i);
1908 if ($list[$i]->[1] =~ /^(author|commit|signer)/i);
1913 if ($list[$i]->[1] =~ /^(open list)/i);
1918 if ($list[$i]->[1] =~ /^(subscriber list)/i);
1923 $authored{$val - 1} = !$authored{$val - 1};
1933 $signed{$val - 1} = !$signed{$val - 1};
2010 history of files in the patch. Also, each line of the current file can
2028 print STDERR "git-blame can be very slow, please have patience..."
2060 my ($name, $address) = parse_email($email);
2061 $email = format_email($name, $address, 1);
2066 ($name, $address) = parse_email($email);
2068 if ($name ne "" && $deduplicate_name_hash{lc($name)}) {
2069 $name = $deduplicate_name_hash{lc($name)}->[0];
2070 $address = $deduplicate_name_hash{lc($name)}->[1];
2073 $name = $deduplicate_address_hash{lc($address)}->[0];
2074 $address = $deduplicate_address_hash{lc($address)}->[1];
2078 $deduplicate_name_hash{lc($name)} = [ $name, $address ];
2079 $deduplicate_address_hash{lc($address)} = [ $name, $address ];
2081 $email = format_email($name, $address, 1);
2093 foreach my $line (@lines) {
2094 if ($line =~ m/$VCS_cmds{"author_pattern"}/) {
2099 push(@commits, $1) if ($line =~ m/$VCS_cmds{"commit_pattern"}/);
2100 push(@subjects, $1) if ($line =~ m/$VCS_cmds{"subject_pattern"}/);
2125 foreach my $line (@lines) {
2126 $commit = $1 if ($line =~ m/$VCS_cmds{"commit_pattern"}/);
2127 $subject = $1 if ($line =~ m/$VCS_cmds{"subject_pattern"}/);
2128 if ($line =~ /^[ \t]*${signature_pattern}.*\@.*$/) {
2129 my @signatures = ($line);
2175 # uniq -c
2178 # sort -rn
2179 foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
2180 my $sign_offs = $hash{$line};
2184 next if (ignore_email_address($line));
2189 push_email_address($line, '');
2192 add_role($line, "$role:$sign_offs/$divisor=$fmt_percent%");
2194 add_role($line, $role);
2296 my $commit = join(" -r ", @commits);
2337 my $commit = join(" -r ", @commits);
2354 foreach my $line (@lines) {
2355 if ($line =~ m/$VCS_cmds{"author_pattern"}/) {
2456 $email =~ s/[\(\<\{]{0,1}([A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+)[\)\>\}]{0,1}/\<$1\>/g;
2457 my ($name, $address) = parse_email($email);
2458 if ($name eq '"[,\.]"') {
2459 $name = "";
2462 my @nw = split(/[^A-Za-zÀ-ÿ\'\,\.\+-]/, $name);
2464 my $first = $nw[@nw - 3];
2465 my $middle = $nw[@nw - 2];
2466 my $last = $nw[@nw - 1];
2468 if (((length($first) == 1 && $first =~ m/[A-Za-z]/) ||
2469 (length($first) == 2 && substr($first, -1) eq ".")) ||
2471 (length($middle) == 2 && substr($middle, -1) eq "."))) {
2472 $name = "$first $middle $last";
2474 $name = "$middle $last";
2478 if (substr($name, -1) =~ /[,\.]/) {
2479 $name = substr($name, 0, length($name) - 1);
2480 } elsif (substr($name, -2) =~ /[,\.]"/) {
2481 $name = substr($name, 0, length($name) - 2) . '"';
2484 if (substr($name, 0, 1) =~ /[,\.]/) {
2485 $name = substr($name, 1, length($name) - 1);
2486 } elsif (substr($name, 0, 2) =~ /"[,\.]/) {
2487 $name = '"' . substr($name, 2, length($name) - 2);
2490 my $fmt_email = format_email($name, $address, $email_usename);
2519 foreach my $line (@parms) {
2520 print("${line}\n");
2537 my $controls = '\\000-\\037\\177';
2544 # Use zero-width assertion to spot the limit of an atom. A simple
2569 # regexps in the Email Addressing FAQ are imperfect - they will miss escaped