Lines Matching +full:line +full:- +full:name

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) {
195 my $line = $_;
197 $line =~ s/\s*\n?$//g;
198 $line =~ s/^\s*//g;
199 $line =~ s/\s+/ /g;
201 next if ($line =~ m/^\s*#/);
202 next if ($line =~ m/^\s*$/);
204 my @words = split(" ", $line);
216 if (-f $ignore_file) {
220 my $line = $_;
222 $line =~ s/\s*\n?$//;
223 $line =~ s/^\s*//;
224 $line =~ s/\s+$//;
225 $line =~ s/#.*$//;
227 next if ($line =~ m/^\s*$/);
228 if (rfc822_valid($line)) {
229 push(@ignore_emails, $line);
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) {
309 # We're talking to a terminal, but have no command line arguments.
310 die "$P: missing patchfile or -f file - use --help if necessary\n";
362 my $line = $_;
363 chomp $line;
365 if ($line =~ m/^([A-Z]):\s*(.*)/) {
375 if ((-d $value)) {
383 push(@typevalue, $line);
386 push(@self_test_info, {file=>$file, linenr=>$i, line=>$line});
396 $file = $File::Find::name;
397 return if (! -f $file);
415 if (-d $path) {
430 } elsif (-f "$path") {
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\…
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;
535 ## use the filenames on the command line or find the filenames in the patchfiles
545 if ((-d $file)) {
547 } elsif (!(-f $file)) {
558 if ($file ne "MAINTAINERS" && -f $file && $keywords && $keywords_in_file) {
563 foreach my $line (keys %keyword_hash) {
564 if ($text =~ m/$keyword_hash{$line}/x) {
565 push(@keyword_tvi, $line);
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+)/) {
610 foreach my $line (keys %keyword_hash) {
611 if ($patch_line =~ m/${patch_prefix}$keyword_hash{$line}/x) {
612 push(@keyword_tvi, $line);
621 . "Add -f to options?\n";
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");
819 my $line = $typevalue[$i];
820 if ($line =~ m/^([A-Z]):\s*(.*)/) {
837 my $line = $typevalue[$i];
838 if ($line =~ m/^([A-Z]):\s*(.*)/) {
887 my $line = $typevalue[$i];
888 if ($line =~ m/^([A-Z]):\s*(.*)/) {
902 my $line = $typevalue[$i];
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)) {
933 foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
934 add_categories($line, "");
937 my $start = find_starting_index($line);
938 my $end = find_ending_index($line);
940 my $line = $typevalue[$i];
941 if ($line =~ /^[FX]:/) { ##Restore file patterns
942 $line =~ s/([^\\])\.([^\*])/$1\?$2/g;
943 $line =~ s/([^\\])\.$/$1\?/g; ##Convert . back to ?
944 $line =~ s/\\\./\./g; ##Convert \. to .
945 $line =~ s/\.\*/\*/g; ##Convert .* to *
947 my $count = $line =~ s/^([A-Z]):/$1:\t/g;
949 print("$line\n");
961 foreach my $line (@keyword_tvi) {
962 add_categories($line, ":Keyword:$keyword_hash{$line}");
967 $email->[0] = deduplicate_email($email->[0]);
992 @email_to = grep($_->[0] !~ /${email_address}/, @email_to);
999 my ($name, $address) = parse_email($email);
1001 my $tmp_email = format_email($name, $address, $email_usename);
1030 if (substr($pattern, -1) eq "/") {
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
1117 other automated tools that expect only ["name"] <email address>
1119 Using "--rolestats" and "--git-blame" shows the #/total=% commits,
1122 contain a thousand lines, 5 trivial commits may modify a single line.
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
1131 Entries in this file can be any command line argument.
1132 This file is prepended to any additional command line arguments.
1135 The negative forms for --<foo> are --no<foo> and --no-<foo>.
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")) {
1168 my ($name) = @_;
1170 if ($name =~ /[^\w \-]/ai) { ##has "must quote" chars
1171 $name =~ s/(?<!\\)"/\\"/g; ##escape quotes
1172 $name = "\"$name\"";
1175 return $name;
1181 my $name = "";
1185 $name = $1;
1193 $name =~ s/^\s+|\s+$//g;
1194 $name =~ s/^\"|\"$//g;
1195 $name = escape_name($name);
1198 return ($name, $address);
1202 my ($name, $address, $usename) = @_;
1206 $name =~ s/^\s+|\s+$//g;
1207 $name =~ s/^\"|\"$//g;
1208 $name = escape_name($name);
1212 if ("$name" eq "") {
1215 $formatted_email = "$name <$address>";
1229 if (($tv =~ m/^([A-Z]):\s*(.*)/)) {
1243 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1246 $index--;
1257 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1273 $subsystem = substr($subsystem, 0, $output_section_maxlen - 3);
1292 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1342 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1357 if ($list_additional =~ m/subscribers-only/) {
1406 my ($name, $address) = @_;
1408 return 1 if (($name eq "") && ($address eq ""));
1409 return 1 if (($name ne "") && exists($email_hash_name{lc($name)}));
1416 my ($line, $role) = @_;
1418 my ($name, $address) = parse_email($line);
1425 push(@email_to, [format_email($name, $address, $email_usename), $role]);
1426 } elsif (!email_inuse($name, $address)) {
1427 push(@email_to, [format_email($name, $address, $email_usename), $role]);
1428 $email_hash_name{lc($name)}++ if ($name ne "");
1455 my ($line, $role) = @_;
1457 my ($name, $address) = parse_email($line);
1458 my $email = format_email($name, $address, $email_usename);
1462 my ($entry_name, $entry_address) = parse_email($entry->[0]);
1463 if (($name eq $entry_name || $address eq $entry_address)
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";
1490 if (-e "$path/$bin") {
1502 if (-e "$path/$conf") {
1511 my ($line) = @_;
1513 my ($name, $address) = parse_email($line);
1514 my $email = format_email($name, $address, 1);
1515 my $real_name = $name;
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};
1541 foreach my $line (@addresses) {
1542 push(@mapped_emails, mailmap_email($line));
1553 my ($name, $address) = parse_email($email);
1554 if (exists $address_map{$name}) {
1555 $address = $address_map{$name};
1556 $email = format_email($name, $address, 1);
1558 $address_map{$name} = $address;
1591 # cut -f2- -d":"
1655 foreach my $line (@lines) {
1656 if ($line =~ m/$VCS_cmds{"author_pattern"}/) {
1658 my ($name, $address) = parse_email($author);
1659 $author = format_email($name, $address, 1);
1677 foreach my $line (@lines) {
1678 if ($line =~ m/$VCS_cmds{"blame_commit_pattern"}/) {
1691 return @commits if (!(-f $file));
1742 warn("$P: No supported VCS found. Add --nogit to options?\n");
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};
2030 history of files in the patch. Also, each line of the current file can
2048 print STDERR "git-blame can be very slow, please have patience..."
2080 my ($name, $address) = parse_email($email);
2081 $email = format_email($name, $address, 1);
2086 ($name, $address) = parse_email($email);
2088 if ($name ne "" && $deduplicate_name_hash{lc($name)}) {
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];
2098 $deduplicate_name_hash{lc($name)} = [ $name, $address ];
2099 $deduplicate_address_hash{lc($address)} = [ $name, $address ];
2101 $email = format_email($name, $address, 1);
2113 foreach my $line (@lines) {
2114 if ($line =~ m/$VCS_cmds{"author_pattern"}/) {
2119 push(@commits, $1) if ($line =~ m/$VCS_cmds{"commit_pattern"}/);
2120 push(@subjects, $1) if ($line =~ m/$VCS_cmds{"subject_pattern"}/);
2145 foreach my $line (@lines) {
2146 $commit = $1 if ($line =~ m/$VCS_cmds{"commit_pattern"}/);
2147 $subject = $1 if ($line =~ m/$VCS_cmds{"subject_pattern"}/);
2148 if ($line =~ /^[ \t]*${signature_pattern}.*\@.*$/) {
2149 my @signatures = ($line);
2195 # uniq -c
2198 # sort -rn
2199 foreach my $line (sort {$hash{$b} <=> $hash{$a}} keys %hash) {
2200 my $sign_offs = $hash{$line};
2204 next if (ignore_email_address($line));
2209 push_email_address($line, '');
2212 add_role($line, "$role:$sign_offs/$divisor=$fmt_percent%");
2214 add_role($line, $role);
2316 my $commit = join(" -r ", @commits);
2357 my $commit = join(" -r ", @commits);
2374 foreach my $line (@lines) {
2375 if ($line =~ m/$VCS_cmds{"author_pattern"}/) {
2476 $email =~ s/[\(\<\{]{0,1}([A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+)[\)\>\}]{0,1}/\<$1\>/g;
2477 my ($name, $address) = parse_email($email);
2480 $name =~ s/^"(.*)"$/$1/;
2482 # Split into name-like parts and remove stray punctuation particles
2483 my @nw = split(/[^\p{L}\'\,\.\+-]/, $name);
2484 @nw = grep(!/^[\'\,\.\+-]$/, @nw);
2486 # Make a best effort to extract the name, and only the name, by taking
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 "."))) {
2498 $name = "$first $middle $last";
2500 $name = "$middle $last";
2503 $name = "@nw";
2506 if (substr($name, -1) =~ /[,\.]/) {
2507 $name = substr($name, 0, length($name) - 1);
2510 if (substr($name, 0, 1) =~ /[,\.]/) {
2511 $name = substr($name, 1, length($name) - 1);
2514 my $fmt_email = format_email($name, $address, $email_usename);
2543 foreach my $line (@parms) {
2544 print("${line}\n");
2561 my $controls = '\\000-\\037\\177';
2568 # Use zero-width assertion to spot the limit of an atom. A simple
2593 # regexps in the Email Addressing FAQ are imperfect - they will miss escaped