X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=tig.pl;h=d7272a3183981ad8040d2c963f9f6fe1a4e03bf5;hb=cf2f4142baba6dc0bcc9d8af37e83cb8ca3add0e;hp=0d80e1fcb56b55a0d7dc1141624458e746e11539;hpb=d7f7f59419c69580f22d7b74eb5d399412ad5483;p=config%2Fdotfiles.git diff --git a/tig.pl b/tig.pl index 0d80e1f..d7272a3 100755 --- a/tig.pl +++ b/tig.pl @@ -40,7 +40,9 @@ my $format = '%x00' # separator from --graph . '%an' . '%x00' # author name . '%s' . '%x00' # subject . '%d'; # ref names -my @cmd = ('git', 'log', '--all', '--graph', "--format=$format"); +my @cmd = ('git', 'log', '--graph', "--format=$format", + # use either given arguments or --all to list all commits + (scalar @ARGV) ? @ARGV : '--all'); open my $fh, '-|', @cmd or die $!; my $pager = $ENV{PAGER}; @@ -66,7 +68,7 @@ while (my $line = <$fh>) { } # Commit line. - $line =~ /^([ *|.-]+)\x00(.+)\x00(.+)\x00(.+)\x00(.+)\x00(.*)$/ + $line =~ /^([ *|.\\-]+)\x00(.+)\x00(.+)\x00(.+)\x00(.*)\x00(.*)$/ or die $line; my $prefix = $1; my $hash = colored($2, $color_hash);