From: Johannes Schindelin Date: Fri, 27 Dec 2013 02:35:13 +0000 (-0600) Subject: Teach implied-commit-order to support the --gitk option X-Git-Url: https://repo.or.cz/w/msysgit.git/commitdiff_plain/75d165a6760c7b5c8441d3d3a0ba564ee977d03a Teach implied-commit-order to support the --gitk option Signed-off-by: Johannes Schindelin --- diff --git a/share/msysGit/implied-commit-order.perl b/share/msysGit/implied-commit-order.perl index 0dffaf35..2f3f8098 100755 --- a/share/msysGit/implied-commit-order.perl +++ b/share/msysGit/implied-commit-order.perl @@ -361,6 +361,20 @@ sub read_commits ($) { close($in); } +my $use_gitk = 0; +my $dashdash = -1; +for (my $i = 0; $i <= $#ARGV; $i++) { + if ($ARGV[$i] eq '--') { + $dashdash = $i; + last; + } + if ($ARGV[$i] eq '--gitk') { + $use_gitk = 1; + splice(@ARGV, $i, 1); + $i--; + } +} + read_commits(\@ARGV); # Unfortunately, there is no scriptable way to use the --graph support of `git @@ -400,6 +414,10 @@ sub show () { push(@args, @ARGV[$i..$#ARGV]) if $i <= $#ARGV; last; } + if ($use_gitk) { + splice(@args, 0, 3); + exec('gitk', @args); + } exec('git', @args); }