git-svn: add support for --stat in the log command
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Feb 15, 2007 at 00:40 UTC
488a63ec233ce7edc5fd70172c196628b1d6a82b
1 file changed
+9
-2
git-svn.perl
+9
-2
@@ -3234,7 +3234,7 @@ sub show_commit_normal {
3234
print "\n";
3235
3236
}
3237
- foreach my $x (qw/raw diff/) {
3237
+ foreach my $x (qw/raw stat diff/) {
3238
if ($c->{$x}) {
3239
print "\n";
3240
print $_ foreach @{$c->{$x}}
@@ -3266,7 +3266,7 @@ sub cmd_show_log {
3266
@args = (git_svn_log_cmd($r_min, $r_max, @args), @args);
3267
my $log = command_output_pipe(@args);
3268
run_pager();
3269
- my (@k, $c, $d);
3269
+ my (@k, $c, $d, $stat);
3270
my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
3271
while (<$log>) {
3272
if (/^${esc_color}commit ($::sha1_short)/o) {
@@ -3294,6 +3294,13 @@ sub cmd_show_log {
3294
push @{$c->{diff}}, $_;
3295
} elsif ($d) {
3296
push @{$c->{diff}}, $_;
3297
+ } elsif (/^\ .+\ \|\s*\d+\ $esc_color[\+\-]*
3298
+ $esc_color*[\+\-]*$esc_color$/x) {
3299
+ $stat = 1;
3300
+ push @{$c->{stat}}, $_;
3301
+ } elsif ($stat && /^ \d+ files changed, \d+ insertions/) {
3302
+ push @{$c->{stat}}, $_;
3303
+ $stat = undef;
3304
} elsif (/^${esc_color} (git-svn-id:.+)$/o) {
3305
($c->{url}, $c->{r}, undef) = ::extract_metadata($1);
3306
} elsif (s/^${esc_color} //o) {