Lines Matching +full:display +full:- +full:width +full:- +full:chars
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";
85 push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org");
86 #Andrew wants in on most everything - 2009/01/14
87 #push(@penguin_chief, "Andrew Morton:akpm\@linux-foundation.org");
103 push(@signature_tags, "Signed-off-by:");
104 push(@signature_tags, "Reviewed-by:");
105 push(@signature_tags, "Acked-by:");
109 # rfc822 email address - preloaded methods go here.
111 my $rfc822_char = '[\\000-\\377]';
113 # VCS command support: class-like functions and strings
119 "available" => '(which("git") ne "") && (-e ".git")',
121 "git log --no-color --follow --since=\$email_git_since " .
122 '--numstat --no-merges ' .
123 '--format="GitCommit: %H%n' .
128 " -- \$file",
130 "git log --no-color " .
131 '--numstat ' .
132 '--format="GitCommit: %H%n' .
137 " -1 \$commit",
139 "git log --no-color " .
140 '--numstat ' .
141 '--format="GitCommit: %H%n' .
145 " -1 \$commit",
146 "blame_range_cmd" => "git blame -l -L \$diff_start,+\$diff_length \$file",
147 "blame_file_cmd" => "git blame -l \$file",
148 "commit_pattern" => "^GitCommit: ([0-9a-f]{40,40})",
149 "blame_commit_pattern" => "^([0-9a-f]+) ",
153 "file_exists_cmd" => "git ls-files \$file",
154 "list_files_cmd" => "git ls-files \$file",
159 "available" => '(which("hg") ne "") && (-d ".hg")',
161 "hg log --date=\$email_hg_since " .
162 "--template='HgCommit: {node}\\n" .
165 " -- \$file",
168 "--template='HgSubject: {desc}\\n'" .
169 " -r \$commit",
172 "--template='HgCommit: {node}\\n" .
175 " -r \$commit",
177 "blame_file_cmd" => "hg blame -n \$file",
178 "commit_pattern" => "^HgCommit: ([0-9a-f]{40,40})",
179 "blame_commit_pattern" => "^([ 0-9a-f]+):",
184 "list_files_cmd" => "hg manifest -R \$file",
188 if (-f $conf) {
215 if (-f $ignore_file) {
236 if ($_ =~ /^-{1,2}self-test(?:=|$)/) {
237 die "$P: using --self-test does not allow any other option or argument\n";
245 'git-all-signature-types!' => \$email_git_all_signature_types,
246 'git-blame!' => \$email_git_blame,
247 'git-blame-signatures!' => \$email_git_blame_signatures,
248 'git-fallback!' => \$email_git_fallback,
249 'git-chief-penguins!' => \$email_git_penguin_chiefs,
250 'git-min-signatures=i' => \$email_git_min_signatures,
251 'git-max-maintainers=i' => \$email_git_max_maintainers,
252 'git-min-percent=i' => \$email_git_min_percent,
253 'git-since=s' => \$email_git_since,
254 'hg-since=s' => \$email_hg_since,
256 'remove-duplicates!' => \$email_remove_duplicates,
275 'pattern-depth=i' => \$pattern_depth,
277 'kf|keywords-in-file!' => \$keywords_in_file,
279 'fe|file-emails!' => \$email_file_emails,
281 'find-maintainer-files' => \$find_maintainer_files,
282 'mpath|maintainer-path=s' => \$maintainer_path,
283 'self-test:s' => \$self_test,
287 die "$P: invalid argument - use --help if necessary\n";
306 if (-t STDIN && !@ARGV) {
308 die "$P: missing patchfile or -f file - use --help if necessary\n";
362 if ($line =~ m/^([A-Z]):\s*(.*)/) {
372 if ((-d $value)) {
394 return if (! -f $file);
412 if (-d $path) {
427 } elsif (-f "$path") {
443 if (-f $file && ($email_file_emails || $file =~ /\.yaml$/)) {
449 …poss_addr = $text =~ m$[\p{L}\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\…
468 return if (!$email_use_mailmap || !(-f "${lk_path}.mailmap"));
483 # (see man git-shortlog)
491 $mailmap->{names}->{$address} = $real_name;
497 $mailmap->{addresses}->{$wrong_address} = $real_address;
507 $mailmap->{names}->{$wrong_address} = $real_name;
508 $mailmap->{addresses}->{$wrong_address} = $real_address;
525 $mailmap->{names}->{$wrong_email} = $real_name;
526 $mailmap->{addresses}->{$wrong_email} = $real_address;
542 if ((-d $file)) {
544 } elsif (!(-f $file)) {
555 if ($file ne "MAINTAINERS" && -f $file && $keywords && $keywords_in_file) {
576 # of a git format-patch generated file (subject tags, etc...)
582 if (m/^ mode change [0-7]+ => [0-7]+ (\S+)\s*$/) {
588 } elsif (m/^diff --git a\/(\S+) b\/(\S+)\s*$/) {
593 } elsif (m/^Fixes:\s+([0-9a-fA-F]{6,40})/) {
595 } elsif (m/^\+\+\+\s+(\S+)/ or m/^---\s+(\S+)/) {
601 $patch_prefix = "^[+-].*"; #Now parsing the actual patch
602 } elsif (m/^\@\@ -(\d+),(\d+)/) {
618 . "Add -f to options?\n";
681 $x->{line} =~ /^\S[^:]/ &&
683 $self_test_info[$index]->{line} =~ /^([A-Z]):\s*\S/) {
688 if (grep(m@^\Q$x->{line}\E@, @section_headers)) {
689 print("$x->{file}:$x->{linenr}: warning: duplicate section header\t$x->{line}\n");
691 push(@section_headers, $x->{line});
695 $self_test_info[$nextline]->{line} =~ /^([A-Z]):\s*(\S.*)/) {
709 print("$x->{file}:$x->{linenr}: warning: section without email address\t$x->{line}\n");
712 print("$x->{file}:$x->{linenr}: warning: section without status \t$x->{line}\n");
715 print("$x->{file}:$x->{linenr}: warning: section without file pattern\t$x->{line}\n");
719 next if ($x->{line} !~ /^([A-Z]):\s*(.*)/);
731 if ((-d $value)) {
735 print("$x->{file}:$x->{linenr}: warning: no file matches\t$x->{line}\n");
747 my $output = `wget --spider -q --no-check-certificate --timeout 10 --tries 1 $value`;
756 print("$x->{file}:$x->{linenr}: warning: possible bad link\t$x->{line}\n");
767 print("$x->{file}:$x->{linenr}: warning: malformed entry\t$x->{line}\n");
772 my $output = `git ls-remote --exit-code -h "$url" $branch > /dev/null 2>&1`;
781 my $output = `wget --spider -q --no-check-certificate --timeout 10 --tries 1 $url`;
790 print("$x->{file}:$x->{linenr}: warning: possible bad link\t$x->{line}\n");
811 if ($line =~ m/^([A-Z]):\s*(.*)/) {
829 if ($line =~ m/^([A-Z]):\s*(.*)/) {
878 if ($line =~ m/^([A-Z]):\s*(.*)/) {
893 if ($line =~ m/^([A-Z]):\s*(.*)/) {
900 $value_pd++ if (substr($value,-1,1) ne "/");
901 $value_pd = -1 if ($value =~ /^\.\*/);
908 (($file_pd - $value_pd) < $pattern_depth)) {
937 my $count = $line =~ s/^([A-Z]):/$1:\t/g;
957 $email->[0] = deduplicate_email($email->[0]);
982 @email_to = grep($_->[0] !~ /${email_address}/, @email_to);
1020 if (substr($pattern, -1) eq "/") {
1039 $P [options] -f file|directory
1043 --email => print email address(es) if any
1044 --git => include recent git \*-by: signers
1045 --git-all-signature-types => include signers regardless of signature type
1047 --git-fallback => use git when no exact MAINTAINERS pattern (default: $email_git_fallback)
1048 --git-chief-penguins => include ${penguin_chiefs}
1049 --git-min-signatures => number of signatures required (default: $email_git_min_signatures)
1050 --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
1051 --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent)
1052 --git-blame => use git blame to find modified commits for patch or file
1053 --git-blame-signatures => when used with --git-blame, also include all commit signers
1054 --git-since => git history to use (default: $email_git_since)
1055 --hg-since => hg history to use (default: $email_hg_since)
1056 --interactive => display a menu (mostly useful if used with the --git option)
1057 --m => include maintainer(s) if any
1058 --r => include reviewer(s) if any
1059 --n => include name 'Full Name <addr\@domain.tld>'
1060 --l => include list(s) if any
1061 --moderated => include moderated lists(s) if any (default: true)
1062 --s => include subscriber only list(s) if any (default: false)
1063 --remove-duplicates => minimize duplicate email names/addresses
1064 --roles => show roles (status:subsystem, git-signer, list, etc...)
1065 --rolestats => show roles and statistics (commits/total_commits, %)
1066 --file-emails => add email addresses found in -f file (default: 0 (off))
1067 --fixes => for patches, add signatures of commits with 'Fixes: <commit>' (default: 1 (on))
1068 --scm => print SCM tree(s) if any
1069 --status => print status if any
1070 --subsystem => print subsystem name if any
1071 --web => print website(s) if any
1074 --separator [, ] => separator for multiple entries on 1 line
1075 using --separator also sets --nomultiline if --separator is not [, ]
1076 --multiline => print 1 entry per line
1079 --pattern-depth => Number of pattern directory traversals (default: 0 (all))
1080 --keywords => scan patch for keywords (default: $keywords)
1081 --keywords-in-file => scan file for keywords (default: $keywords_in_file)
1082 --sections => print all of the subsystem sections with pattern matches
1083 --letters => print all matching 'letter' types from all matching sections
1084 --mailmap => use .mailmap file (default: $email_use_mailmap)
1085 --no-tree => run without a kernel tree
1086 --self-test => show potential issues with MAINTAINERS file content
1087 --version => show version
1088 --help => show this help information
1091 [--email --tree --nogit --git-fallback --m --r --n --l --multiline
1092 --pattern-depth=0 --remove-duplicates --rolestats --keywords]
1095 Using "-f directory" may give unexpected results:
1096 Used with "--git", git signators for _all_ files in and below
1099 Used with "--nogit", directory is used as a pattern match,
1102 Used with "--git-blame", does not iterate all files in directory
1103 Using "--git-blame" is slow and may add old committers and authors
1105 Using "--roles" or "--rolestats" with git send-email --cc-cmd or any
1108 Using "--rolestats" and "--git-blame" shows the #/total=% commits,
1114 --git,
1115 --git-min-signatures, --git-max-maintainers, --git-min-percent, and
1116 --git-blame
1117 Use --hg-since not --git-since to control date selection
1124 The negative forms for --<foo> are --no<foo> and --no-<foo>.
1132 if ($lk_path ne "" && substr($lk_path,length($lk_path)-1,1) ne "/") {
1135 if ( (-f "${lk_path}COPYING")
1136 && (-f "${lk_path}CREDITS")
1137 && (-f "${lk_path}Kbuild")
1138 && (-e "${lk_path}MAINTAINERS")
1139 && (-f "${lk_path}Makefile")
1140 && (-f "${lk_path}README")
1141 && (-d "${lk_path}Documentation")
1142 && (-d "${lk_path}arch")
1143 && (-d "${lk_path}include")
1144 && (-d "${lk_path}drivers")
1145 && (-d "${lk_path}fs")
1146 && (-d "${lk_path}init")
1147 && (-d "${lk_path}ipc")
1148 && (-d "${lk_path}kernel")
1149 && (-d "${lk_path}lib")
1150 && (-d "${lk_path}scripts")) {
1159 if ($name =~ /[^\w \-]/ai) { ##has "must quote" chars
1218 if (($tv =~ m/^([A-Z]):\s*(.*)/)) {
1232 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1235 $index--;
1246 if (!($tv =~ m/^([A-Z]):\s*(.*)/)) {
1262 $subsystem = substr($subsystem, 0, $output_section_maxlen - 3);
1281 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1331 if ($tv =~ m/^([A-Z]):\s*(.*)/) {
1346 if ($list_additional =~ m/subscribers-only/) {
1449 my ($entry_name, $entry_address) = parse_email($entry->[0]);
1451 && ($role eq "" || !($entry->[1] =~ m/$role/))
1453 if ($entry->[1] eq "") {
1454 $entry->[1] = "$role";
1456 $entry->[1] = "$entry->[1],$role";
1460 if ($email eq $entry->[0]
1461 && ($role eq "" || !($entry->[1] =~ m/$role/))
1463 if ($entry->[1] eq "") {
1464 $entry->[1] = "$role";
1466 $entry->[1] = "$entry->[1],$role";
1477 if (-e "$path/$bin") {
1489 if (-e "$path/$conf") {
1505 if (exists $mailmap->{names}->{$email} ||
1506 exists $mailmap->{addresses}->{$email}) {
1507 if (exists $mailmap->{names}->{$email}) {
1508 $real_name = $mailmap->{names}->{$email};
1510 if (exists $mailmap->{addresses}->{$email}) {
1511 $real_address = $mailmap->{addresses}->{$email};
1514 if (exists $mailmap->{names}->{$address}) {
1515 $real_name = $mailmap->{names}->{$address};
1517 if (exists $mailmap->{addresses}->{$address}) {
1518 $real_address = $mailmap->{addresses}->{$address};
1578 # cut -f2- -d":"
1678 return @commits if (!(-f $file));
1729 warn("$P: No supported VCS found. Add --nogit to options?\n");
1785 $maintained = 1 if ($entry->[1] =~ /^(maintainer|supporter)/i);
1799 printf STDERR "\n%1s %2s %-65s",
1808 my $email = $entry->[0];
1809 my $role = $entry->[1];
1818 printf STDERR "%1s %2d %-65s", $sel, $count + 1, $email;
1847 gf use git-fallback [$email_git_fallback]
1895 $selected{$nr - 1} = !$selected{$nr - 1};
1910 if ($list[$i]->[1] =~ /^(maintainer|supporter)/i);
1915 if ($list[$i]->[1] =~ /^(author|commit|signer)/i);
1920 if ($list[$i]->[1] =~ /^(open list)/i);
1925 if ($list[$i]->[1] =~ /^(subscriber list)/i);
1930 $authored{$val - 1} = !$authored{$val - 1};
1940 $signed{$val - 1} = !$signed{$val - 1};
2035 print STDERR "git-blame can be very slow, please have patience..."
2076 $name = $deduplicate_name_hash{lc($name)}->[0];
2077 $address = $deduplicate_name_hash{lc($name)}->[1];
2080 $name = $deduplicate_address_hash{lc($address)}->[0];
2081 $address = $deduplicate_address_hash{lc($address)}->[1];
2182 # uniq -c
2185 # sort -rn
2303 my $commit = join(" -r ", @commits);
2344 my $commit = join(" -r ", @commits);
2463 $email =~ s/[\(\<\{]{0,1}([A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+)[\)\>\}]{0,1}/\<$1\>/g;
2469 # Split into name-like parts and remove stray punctuation particles
2470 my @nw = split(/[^\p{L}\'\,\.\+-]/, $name);
2471 @nw = grep(!/^[\'\,\.\+-]$/, @nw);
2477 my $first = $nw[@nw - 3];
2478 my $middle = $nw[@nw - 2];
2479 my $last = $nw[@nw - 1];
2482 (length($first) == 2 && substr($first, -1) eq ".")) ||
2484 (length($middle) == 2 && substr($middle, -1) eq "."))) {
2493 if (substr($name, -1) =~ /[,\.]/) {
2494 $name = substr($name, 0, length($name) - 1);
2498 $name = substr($name, 1, length($name) - 1);
2548 my $controls = '\\000-\\037\\177';
2555 # Use zero-width assertion to spot the limit of an atom. A simple
2580 # regexps in the Email Addressing FAQ are imperfect - they will miss escaped
2581 # chars in atoms, for example.