From 75d165a6760c7b5c8441d3d3a0ba564ee977d03a Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 26 Dec 2013 20:35:13 -0600 Subject: [PATCH] Teach implied-commit-order to support the --gitk option Signed-off-by: Johannes Schindelin --- share/msysGit/implied-commit-order.perl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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); } -- 2.11.4.GIT