summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-01-13 18:57:43 +0000
committerNicholas Clark <nick@ccl4.org>2009-01-13 18:57:43 +0000
commit29638d28d4592a1802e976efd732f501c8ff0af8 (patch)
treeb9b7115afcd4265c4a3ae8f950f7b7e4f9d30b2a
parentc5654d5b66b28416dd42561adb54cb0e1ca1cefd (diff)
downloadperl-29638d28d4592a1802e976efd732f501c8ff0af8.tar.gz
If there is one argument, and it looks like a commit, list data from the files
that commit changed. For example, `perl Porting/Maintainers HEAD`.
-rw-r--r--Porting/Maintainers.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm
index e457efc7ee..a6aaaa00c8 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
@@ -110,6 +110,11 @@ sub process_options {
if ($Opened) {
chomp (@Files = `git ls-files -m --full-name`);
die if $?;
+ } 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;
}