From: Pierre Dumuid Date: Thu, 15 Dec 2016 11:28:45 GMT Subject: [PATCH 4/6] Add DirDiffTool as additional option Message-ID: <20161215112847.14719-4-pmdumuid@gmail.com> In-Reply-To: <20161215112847.14719-1-pmdumuid@gmail.com> Signed-off-by: Pierre Dumuid --- gitk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gitk b/gitk index a894f1d..5f27716 100755 --- a/gitk +++ b/gitk @@ -2661,6 +2661,9 @@ proc makewindow {} { {mc "Diff this -> marked commit" command {diffvsmark 0}} {mc "Diff marked commit -> this" command {diffvsmark 1}} {mc "Revert this commit" command revert} + + {mc "DirDiffTool this -> selected" command {externalDiffToolVsSel 0}} + {mc "DirDiffTool selected -> this" command {externalDiffToolVsSel 1}} } $rowctxmenu configure -tearoff 0 @@ -9254,6 +9257,20 @@ proc diffvssel {dirn} { doseldiff $oldid $newid } +proc externalDiffToolVsSel {diffDirection} { + global rowmenuid selectedline + + if {$selectedline eq {}} return + if {$diffDirection} { + set oldid [commitonrow $selectedline] + set newid $rowmenuid + } else { + set oldid $rowmenuid + set newid [commitonrow $selectedline] + } + [exec git difftool -d $oldid $newid] +} + proc diffvsmark {dirn} { global rowmenuid markedid -- 2.10.2