From: Nicholas Clark Date: Tue, 13 Jan 2009 18:57:43 +0000 (+0000) Subject: If there is one argument, and it looks like a commit, list data from the files X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=29638d28d4592a1802e976efd732f501c8ff0af8;p=p5sagit%2Fp5-mst-13.2.git 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`. --- diff --git a/Porting/Maintainers.pm b/Porting/Maintainers.pm index e457efc..a6aaaa0 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; }