Add diffuse as merge and diff tool
PATCH 1/1 Add diffuse as merge and diff tool
Quoted 1 line
From
e54c153a67cef9b162eb51f4b7cefb65e59c3a13Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <[email protected]>
Date: Thu, 26 Mar 2009 20:42:31 +0100
Subject: [PATCH] Add diffuse as merge and diff tool
--- Documentation/git-mergetool.txt | 3 ++- Documentation/merge-config.txt | 7 ++++--- contrib/completion/git-completion.bash | 3 ++- contrib/difftool/git-difftool-helper | 12 ++++++++---- contrib/difftool/git-difftool.txt | 4 ++-- git-gui/lib/mergetool.tcl | 7 +++++++ git-mergetool.sh | 15 ++++++++++++--- 7 files changed, 37 insertions(+), 14 deletions(-)
Documentation/git-mergetool.txt +2 -1
@@ -26,7 +26,8 @@ OPTIONS --tool=<tool>:: Use the merge resolution program specified by <tool>. Valid merge tools are: - kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, and opendiff + kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge, + diffuse and opendiff + If a merge resolution program is not specified, 'git-mergetool' will use the configuration variable `merge.tool`. If the
Documentation/merge-config.txt +4 -3
@@ -22,9 +22,10 @@ merge.stat:: merge.tool:: Controls which merge resolution program is used by linkgit:git-mergetool[1]. Valid built-in values are: "kdiff3", - "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and - "opendiff". Any other value is treated is custom merge tool - and there must be a corresponding mergetool.<tool>.cmd option. + "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", + "diffuse" and "opendiff". Any other value is treated is custom + merge tool and there must be a corresponding mergetool.<tool>.cmd + option. merge.verbosity:: Controls the amount of output shown by the recursive merge
contrib/completion/git-completion.bash +2 -1
@@ -1173,7 +1173,8 @@ _git_mergetool () --tool=*) __gitcomp " kdiff3 tkdiff meld xxdiff emerge - vimdiff gvimdiff ecmerge opendiff + vimdiff gvimdiff ecmerge diffuse + opendiff " "" "${cur##--tool=}" return ;;
contrib/difftool/git-difftool-helper +8 -4
@@ -1,6 +1,6 @@ #!/bin/sh # git-difftool-helper is a GIT_EXTERNAL_DIFF-compatible diff tool launcher. -# It supports kdiff3, kompare, tkdiff, xxdiff, meld, opendiff, +# It supports kdiff3, kompare, tkdiff, xxdiff, meld, diffuse, opendiff, # emerge, ecmerge, vimdiff, gvimdiff, and custom user-configurable tools. # This script is typically launched by using the 'git difftool' # convenience command.
@@ -103,6 +103,10 @@ launch_merge_tool () { "$LOCAL" "$REMOTE" ;; + diffuse) + "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE" + ;; + opendiff) "$merge_tool_path" "$LOCAL" "$REMOTE" \ -merge "$MERGED" | cat
@@ -140,7 +144,7 @@ valid_custom_tool() { # Built-in merge tools are always valid. valid_tool() { case "$1" in - kdiff3 | kompare | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | ecmerge) + kdiff3 | kompare | tkdiff | xxdiff | meld | diffuse | opendiff | emerge | vimdiff | gvimdiff | ecmerge) ;; # happy *) if ! valid_custom_tool "$1"
@@ -194,9 +198,9 @@ if test -z "$merge_tool"; then if test -n "$DISPLAY"; then # If gnome then prefer meld, otherwise, prefer kdiff3 or kompare if test -n "$GNOME_DESKTOP_SESSION_ID" ; then - merge_tool_candidates="meld kdiff3 kompare tkdiff xxdiff gvimdiff" + merge_tool_candidates="meld kdiff3 kompare tkdiff xxdiff gvimdiff diffuse" else - merge_tool_candidates="kdiff3 kompare tkdiff xxdiff meld gvimdiff" + merge_tool_candidates="kdiff3 kompare tkdiff xxdiff meld gvimdiff diffuse" fi fi if echo "${VISUAL:-$EDITOR}" | grep 'emacs' > /dev/null 2>&1; then
contrib/difftool/git-difftool.txt +2 -2
@@ -28,8 +28,8 @@ OPTIONS --tool=<tool>:: Use the merge resolution program specified by <tool>. Valid merge tools are: - kdiff3, kompare, tkdiff, meld, xxdiff, emerge, - vimdiff, gvimdiff, ecmerge, and opendiff + kdiff3, kompare, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, + ecmerge, diffuse and opendiff + If a merge resolution program is not specified, 'git-difftool' will use the configuration variable `diff.tool`. If the
git-gui/lib/mergetool.tcl +7 -0
@@ -219,6 +219,13 @@ proc merge_resolve_tool2 {} { set cmdline [list "$merge_tool_path" "$LOCAL" "$REMOTE" -merge "$MERGED"] } } + diffuse { + if {$base_stage ne {}} { + set cmdline [list "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE" "$BASE" ] + } else { + set cmdline [list "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE" ] + } + } ecmerge { if {$base_stage ne {}} { set cmdline [list "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" --default --mode=merge3 --to="$MERGED"]
git-mergetool.sh +12 -3
@@ -239,6 +239,15 @@ merge_file () { fi check_unchanged ;; + diffuse) + touch "$BACKUP" + if base_present; then + "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE" "$BASE" | cat + else + "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE" | cat + fi + check_unchanged + ;; opendiff) touch "$BACKUP" if base_present; then
@@ -345,7 +354,7 @@ valid_custom_tool() valid_tool() { case "$1" in - kdiff3 | tkdiff | xxdiff | meld | opendiff | emerge | vimdiff | gvimdiff | ecmerge) + kdiff3 | tkdiff | xxdiff | meld | diffuse | opendiff | emerge | vimdiff | gvimdiff | ecmerge) ;; # happy *) if ! valid_custom_tool "$1"; then
@@ -398,9 +407,9 @@ fi if test -z "$merge_tool" ; then if test -n "$DISPLAY"; then if test -n "$GNOME_DESKTOP_SESSION_ID" ; then - merge_tool_candidates="meld kdiff3 tkdiff xxdiff gvimdiff" + merge_tool_candidates="meld kdiff3 tkdiff xxdiff gvimdiff diffuse" else - merge_tool_candidates="kdiff3 tkdiff xxdiff meld gvimdiff" + merge_tool_candidates="kdiff3 tkdiff xxdiff meld gvimdiff diffuse" fi fi if echo "${VISUAL:-$EDITOR}" | grep 'emacs' > /dev/null 2>&1; then
Signature · 1 line
1.6.2.1-2808-gb0085a7
Hi
Quoted 7 lines · Sebastian Pipping
From
e54c153a67cef9b162eb51f4b7cefb65e59c3a13Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <[email protected]>
Date: Thu, 26 Mar 2009 20:42:31 +0100
Subject: [PATCH] Add diffuse as merge and diff tool
Quoted 9 lines
--- Documentation/git-mergetool.txt | 3 ++- Documentation/merge-config.txt | 7 ++++--- contrib/completion/git-completion.bash | 3 ++- contrib/difftool/git-difftool-helper | 12 ++++++++---- contrib/difftool/git-difftool.txt | 4 ++-- git-gui/lib/mergetool.tcl | 7 +++++++ git-mergetool.sh | 15 ++++++++++++--- 7 files changed, 37 insertions(+), 14 deletions(-)
Hey, thanks for the patch.
Ouch.. too many places with duplicated information, huh?
I'm in the middle of refactoring git-(diff|merge)tool so that there is less duplication of code.
Junio also has a number of difftool-related patches in his proposed-updates "pu" branch.
Sebastian, would you mind if I rebased your patch on top of my work (once I send it out) so that it makes things easier on our kind maintainer? I have a big patch series coming down that does away with the redundancies so I think it'd be best if we transfered your changes on top of it. Would you mind if I rebased your patch and sent it out to the list?
It wouldn't be until much later tonight (or tomorrow) at the earliest since I have some unpacking to take care of but if that's cool with you just let me know.
You should see the refactoring patches from me shortly...
Signature · 1 line
David
Quoted 10 lines · David Aguilar
Quoted 8 lines
Documentation/git-mergetool.txt | 3 ++- Documentation/merge-config.txt | 7 ++++--- contrib/completion/git-completion.bash | 3 ++- contrib/difftool/git-difftool-helper | 12 ++++++++---- contrib/difftool/git-difftool.txt | 4 ++-- git-gui/lib/mergetool.tcl | 7 +++++++ git-mergetool.sh | 15 ++++++++++++--- 7 files changed, 37 insertions(+), 14 deletions(-)
Quoted 2 lines
Hey, thanks for the patch.
Ouch.. too many places with duplicated information, huh?
Yes.
Quoted 13 lines
I'm in the middle of refactoring git-(diff|merge)tool so that there is less duplication of code.
Junio also has a number of difftool-related patches in his proposed-updates "pu" branch.
Sebastian, would you mind if I rebased your patch on top of my work (once I send it out) so that it makes things easier on our kind maintainer? I have a big patch series coming down that does away with the redundancies so I think it'd be best if we transfered your changes on top of it. Would you mind if I rebased your patch and sent it out to the list?
Quoted 5 lines
It wouldn't be until much later tonight (or tomorrow) at the earliest since I have some unpacking to take care of but if that's cool with you just let me know.
You should see the refactoring patches from me shortly...
My patch is your patch, do as you please.
Just take care to keep the order of the files passed to Diffuse intact, especially with $MERGED second, as Diffuse sets focus on the second document after startup.
Sebastian