Lines Matching +full:check +full:- +full:patch

6 # the files modified in a patch or for a file
8 # usage: perl scripts/get_maintainer.pl [OPTIONS] <patch>
9 # perl scripts/get_maintainer.pl [OPTIONS] -f <file>
36 my $email_git_since = "1-year-ago";
37 my $email_hg_since = "-365";
68 push(@signature_tags, "Signed-off-by:");
69 push(@signature_tags, "Reviewed-by:");
70 push(@signature_tags, "Acked-by:");
74 # rfc822 email address - preloaded methods go here.
76 my $rfc822_char = '[\\000-\\377]';
78 # VCS command support: class-like functions and strings
84 "available" => '(which("git") ne "") && (-e ".git")',
86 "git log --no-color --follow --since=\$email_git_since " .
87 '--format="GitCommit: %H%n' .
92 " -- \$file",
94 "git log --no-color " .
95 '--format="GitCommit: %H%n' .
100 " -1 \$commit",
102 "git log --no-color " .
103 '--format="GitCommit: %H%n' .
107 " -1 \$commit",
108 "blame_range_cmd" => "git blame -l -L \$diff_start,+\$diff_length \$file",
109 "blame_file_cmd" => "git blame -l \$file",
110 "commit_pattern" => "^GitCommit: ([0-9a-f]{40,40})",
111 "blame_commit_pattern" => "^([0-9a-f]+) ",
118 "available" => '(which("hg") ne "") && (-d ".hg")',
120 "hg log --date=\$email_hg_since " .
121 "--template='HgCommit: {node}\\n" .
124 " -- \$file",
127 "--template='HgSubject: {desc}\\n'" .
128 " -r \$commit",
131 "--template='HgCommit: {node}\\n" .
134 " -r \$commit",
136 "blame_file_cmd" => "hg blame -n \$file",
137 "commit_pattern" => "^HgCommit: ([0-9a-f]{40,40})",
138 "blame_commit_pattern" => "^([ 0-9a-f]+):",
144 if (-f $conf) {
172 'git-all-signature-types!' => \$email_git_all_signature_types,
173 'git-blame!' => \$email_git_blame,
174 'git-blame-signatures!' => \$email_git_blame_signatures,
175 'git-fallback!' => \$email_git_fallback,
176 'git-min-signatures=i' => \$email_git_min_signatures,
177 'git-max-maintainers=i' => \$email_git_max_maintainers,
178 'git-min-percent=i' => \$email_git_min_percent,
179 'git-since=s' => \$email_git_since,
180 'hg-since=s' => \$email_hg_since,
182 'remove-duplicates!' => \$email_remove_duplicates,
197 'pattern-depth=i' => \$pattern_depth,
200 'fe|file-emails!' => \$file_emails,
205 die "$P: invalid argument - use --help if necessary\n";
218 if (-t STDIN && !@ARGV) {
220 die "$P: missing patchfile or -f file - use --help if necessary\n";
275 if ((-d $value)) {
304 return if (!$email_use_mailmap || !(-f "${lk_path}.mailmap"));
319 # (see man git-shortlog)
327 $mailmap->{names}->{$address} = $real_name;
333 $mailmap->{addresses}->{$wrong_address} = $real_address;
343 $mailmap->{names}->{$wrong_address} = $real_name;
344 $mailmap->{addresses}->{$wrong_address} = $real_address;
361 $mailmap->{names}->{$wrong_email} = $real_name;
362 $mailmap->{addresses}->{$wrong_email} = $real_address;
382 if ((-d $file)) {
390 if ($file ne "MAINTAINERS" && -f $file && ($keywords || $file_emails)) {
403 …my @poss_addr = $text =~ m$[A-Za--ÿ\"\' \,\.\+-]*\s*[\,]*\s*[\(\<\{]{0,1}[A-Za-z0-9_\.\+-]+\@[A-
411 open(my $patch, "< $file")
414 # We can check arbitrary information before the patch
417 # of a git format-patch generated file (subject tags, etc...)
421 while (<$patch>) {
429 $patch_prefix = "^[+-].*"; #Now parsing the actual patch
430 } elsif (m/^\@\@ -(\d+),(\d+)/) {
442 close($patch);
445 warn "$P: file '${file}' doesn't appear to be a patch. "
446 . "Add -f to options?\n";
589 $value_pd++ if (substr($value,-1,1) ne "/");
590 $value_pd = -1 if ($value =~ /^\.\*/);
597 (($file_pd - $value_pd) < $pattern_depth)) {
622 $line =~ s/^([A-Z]):/$1:\t/g;
638 $email->[0] = deduplicate_email($email->[0]);
689 if (substr($pattern, -1) eq "/") {
708 $P [options] -f file|directory
712 --email => print email address(es) if any
713 --git => include recent git \*-by: signers
714 --git-all-signature-types => include signers regardless of signature type
716 --git-fallback => use git when no exact MAINTAINERS pattern (default: $email_git_fallback)
717 --git-min-signatures => number of signatures required (default: $email_git_min_signatures)
718 --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers)
719 --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent)
720 --git-blame => use git blame to find modified commits for patch or file
721 --git-since => git history to use (default: $email_git_since)
722 --hg-since => hg history to use (default: $email_hg_since)
723 --interactive => display a menu (mostly useful if used with the --git option)
724 --m => include maintainer(s) if any
725 --r => include reviewer(s) if any
726 --n => include name 'Full Name <addr\@domain.tld>'
727 --l => include list(s) if any
728 --s => include subscriber only list(s) if any
729 --remove-duplicates => minimize duplicate email names/addresses
730 --roles => show roles (status:subsystem, git-signer, list, etc...)
731 --rolestats => show roles and statistics (commits/total_commits, %)
732 --file-emails => add email addresses found in -f file (default: 0 (off))
733 --scm => print SCM tree(s) if any
734 --status => print status if any
735 --subsystem => print subsystem name if any
736 --web => print website(s) if any
739 --separator [, ] => separator for multiple entries on 1 line
740 using --separator also sets --nomultiline if --separator is not [, ]
741 --multiline => print 1 entry per line
744 --pattern-depth => Number of pattern directory traversals (default: 0 (all))
745 --keywords => scan patch for keywords (default: $keywords)
746 --sections => print all of the subsystem sections with pattern matches
747 --mailmap => use .mailmap file (default: $email_use_mailmap)
748 --version => show version
749 --help => show this help information
752 [--email --nogit --git-fallback --m --r --n --l --multiline --pattern-depth=0
753 --remove-duplicates --rolestats]
756 Using "-f directory" may give unexpected results:
757 Used with "--git", git signators for _all_ files in and below
760 Used with "--nogit", directory is used as a pattern match,
763 Used with "--git-blame", does not iterate all files in directory
764 Using "--git-blame" is slow and may add old committers and authors
766 Using "--roles" or "--rolestats" with git send-email --cc-cmd or any
769 Using "--rolestats" and "--git-blame" shows the #/total=% commits,
775 --git,
776 --git-min-signatures, --git-max-maintainers, --git-min-percent, and
777 --git-blame
778 Use --hg-since not --git-since to control date selection
790 if ($lk_path ne "" && substr($lk_path,length($lk_path)-1,1) ne "/") {
793 if ( (-f "${lk_path}COPYING")
794 && (-f "${lk_path}MAINTAINERS")
795 && (-f "${lk_path}Makefile")
796 && (-d "${lk_path}docs")
797 && (-f "${lk_path}VERSION")
798 && (-d "${lk_path}linux-user/")
799 && (-d "${lk_path}system/")) {
824 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
841 if ($name =~ /[^\w \-]/i) { ##has "must quote" chars
881 $index--;
993 if ($list_additional =~ m/subscribers-only/) {
1019 my $tv = $typevalue[$i - 1];
1036 my $tv = $typevalue[$i - 1];
1117 my ($entry_name, $entry_address) = parse_email($entry->[0]);
1119 && ($role eq "" || !($entry->[1] =~ m/$role/))
1121 if ($entry->[1] eq "") {
1122 $entry->[1] = "$role";
1124 $entry->[1] = "$entry->[1],$role";
1128 if ($email eq $entry->[0]
1129 && ($role eq "" || !($entry->[1] =~ m/$role/))
1131 if ($entry->[1] eq "") {
1132 $entry->[1] = "$role";
1134 $entry->[1] = "$entry->[1],$role";
1145 if (-e "$path/$bin") {
1157 if (-e "$path/$conf") {
1173 if (exists $mailmap->{names}->{$email} ||
1174 exists $mailmap->{addresses}->{$email}) {
1175 if (exists $mailmap->{names}->{$email}) {
1176 $real_name = $mailmap->{names}->{$email};
1178 if (exists $mailmap->{addresses}->{$email}) {
1179 $real_address = $mailmap->{addresses}->{$email};
1182 if (exists $mailmap->{names}->{$address}) {
1183 $real_name = $mailmap->{names}->{$address};
1185 if (exists $mailmap->{addresses}->{$address}) {
1186 $real_address = $mailmap->{addresses}->{$address};
1246 # cut -f2- -d":"
1327 return @commits if (!(-f $file));
1378 warn("$P: No supported VCS found. Add --nogit to options?\n");
1381 warn("git clone https://gitlab.com/qemu-project/qemu.git\n");
1408 $maintained = 1 if ($entry->[1] =~ /^(maintainer|supporter)/i);
1422 printf STDERR "\n%1s %2s %-65s",
1431 my $email = $entry->[0];
1432 my $role = $entry->[1];
1441 printf STDERR "%1s %2d %-65s", $sel, $count + 1, $email;
1470 gf use git-fallback [$email_git_fallback]
1518 $selected{$nr - 1} = !$selected{$nr - 1};
1533 if ($list[$i]->[1] =~ /^(maintainer|supporter)/i);
1538 if ($list[$i]->[1] =~ /^(author|commit|signer)/i);
1543 if ($list[$i]->[1] =~ /^(open list)/i);
1548 if ($list[$i]->[1] =~ /^(subscriber list)/i);
1553 $authored{$val - 1} = !$authored{$val - 1};
1563 $signed{$val - 1} = !$signed{$val - 1};
1635 commit signers and mailing lists that could be CC'd on a patch.
1640 history of files in the patch. Also, each line of the current file can
1658 print STDERR "git-blame can be very slow, please have patience..."
1699 $name = $deduplicate_name_hash{lc($name)}->[0];
1700 $address = $deduplicate_name_hash{lc($name)}->[1];
1703 $name = $deduplicate_address_hash{lc($address)}->[0];
1704 $address = $deduplicate_address_hash{lc($address)}->[1];
1805 # uniq -c
1808 # sort -rn
1870 my $commit = join(" -r ", @commits);
1903 my $commit = join(" -r ", @commits);
1983 $email =~ s/[\(\<\{]{0,1}([A-Za-z0-9_\.\+-]+\@[A-Za-z0-9\.-]+)[\)\>\}]{0,1}/\<$1\>/g;
1989 my @nw = split(/[^A-Za--ÿ\'\,\.\+-]/, $name);
1991 my $first = $nw[@nw - 3];
1992 my $middle = $nw[@nw - 2];
1993 my $last = $nw[@nw - 1];
1995 if (((length($first) == 1 && $first =~ m/[A-Za-z]/) ||
1996 (length($first) == 2 && substr($first, -1) eq ".")) ||
1998 (length($middle) == 2 && substr($middle, -1) eq "."))) {
2005 if (substr($name, -1) =~ /[,\.]/) {
2006 $name = substr($name, 0, length($name) - 1);
2007 } elsif (substr($name, -2) =~ /[,\.]"/) {
2008 $name = substr($name, 0, length($name) - 2) . '"';
2012 $name = substr($name, 1, length($name) - 1);
2014 $name = '"' . substr($name, 2, length($name) - 2);
2064 my $controls = '\\000-\\037\\177';
2071 # Use zero-width assertion to spot the limit of an atom. A simple
2096 # regexps in the Email Addressing FAQ are imperfect - they will miss escaped