X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=Porting%2FMaintainers.pm;h=0b03e0579e50801800be577b201cd0ee556ad8d1;hb=12fc04c96e084fc3d1f066acd95f1b212e9bc1e3;hp=b271e9fea0a9f01e13b347d48f2d6366fd7f4779;hpb=adc423160116ecb9496dc37182c54ecac309855c;p=p5sagit%2Fp5-mst-13.2.git diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm index b271e9f..0b03e05 100644 --- a/Porting/Maintainers.pm +++ b/Porting/Maintainers.pm @@ -71,7 +71,7 @@ sub get_maintainer_modules { sub usage { print <<__EOF__; -$0: Usage: $0 [[--maintainer M --module M --files]|[--check] file ...] +$0: Usage: $0 [[--maintainer M --module M --files]|[--check] [commit] | [file ...] --maintainer M list all maintainers matching M --module M list all modules matching M --files list all files @@ -79,7 +79,7 @@ $0: Usage: $0 [[--maintainer M --module M --files]|[--check] file ...] with a file checks if it has a maintainer with a dir checks all files have a maintainer otherwise checks for multiple maintainers ---opened list all modules of files opened by perforce +--opened list all modules of modified files Matching is case-ignoring regexp, author matching is both by the short id and by the full name and email. A "module" may not be just a module, it may be a file or files or a subdirectory. @@ -106,14 +106,15 @@ sub process_options { ); my @Files; - + if ($Opened) { - @Files = `p4 opened`; + chomp (@Files = `git ls-files -m --full-name`); die if $?; - foreach (@Files) { - s!#.*!!s; - s!^//depot/(?:perl|.*?/perl)/!!; - } + } elsif (@ARGV == 1 && + $ARGV[0] =~ /^(?:HEAD|[0-9a-f]{4,40})(?:~\d+)?\^*$/) { + my $command = "git diff --name-only $ARGV[0]^ $ARGV[0]"; + chomp (@Files = `$command`); + die "'$command' failed: $?" if $?; } else { @Files = @ARGV; } @@ -244,12 +245,16 @@ sub show_results { if (defined $ModuleByFile{$file}) { my $module = $ModuleByFile{$file}; my $maintainer = $Modules{$ModuleByFile{$file}}{MAINTAINER}; - printf "%-15s $module $maintainer $Maintainers{$maintainer}\n", $file; + my $upstream = $Modules{$module}{UPSTREAM}||'unknown'; + printf "%-15s [%-7s] $module $maintainer $Maintainers{$maintainer}\n", $file, $upstream; } else { printf "%-15s ?\n", $file; } } } + elsif ($Opened) { + print STDERR "(No files are modified)\n"; + } else { usage(); }