git-gui: Support calling merge tools.

Adds an item to the diff context menu in conflict mode,
which invokes a merge tool for the selected file. Tool
command-line handling code was ported from git-mergetool.

Automatic default tool selection and custom merge tools
are not supported. If merge.tool is not set, git-gui
defaults to meld.

This implementation uses a checkout-index hack in order
to retrieve all stages with autocrlf and filters properly
applied. It requires temporarily moving the original
conflict file out of the way.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
This commit is contained in:
Alexander Gavrilov
2008-08-31 00:56:51 +04:00
committed by Shawn O. Pearce
parent 042c232535
commit 7e30682ce0
3 changed files with 260 additions and 0 deletions

View File

@ -657,6 +657,8 @@ proc apply_config {} {
}
set default_config(branch.autosetupmerge) true
set default_config(merge.tool) {}
set default_config(merge.keepbackup) true
set default_config(merge.diffstat) true
set default_config(merge.summary) false
set default_config(merge.verbosity) 2
@ -2775,6 +2777,11 @@ create_common_diff_popup $ctxm
set ctxmmg .vpane.lower.diff.body.ctxmmg
menu $ctxmmg -tearoff 0
$ctxmmg add command \
-label [mc "Run Merge Tool"] \
-command {merge_resolve_tool}
lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
$ctxmmg add separator
$ctxmmg add command \
-label [mc "Use Remote Version"] \
-command {merge_resolve_one 3}