Code

mergetool--lib: add support for araxis merge
authorDavid Aguilar <davvid@gmail.com>
Sun, 24 May 2009 00:24:41 +0000 (00:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 24 May 2009 18:21:05 +0000 (11:21 -0700)
Araxis merge is now a built-in diff/merge tool.
This adds araxis to git-completion and updates
the documentation to mention araxis.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-difftool.txt
Documentation/git-mergetool.txt
Documentation/merge-config.txt
contrib/completion/git-completion.bash
git-mergetool--lib.sh

index 15b247bab4195286e55447388308473af4e2d001..96a6c51a4b83207fa23fc8f09cb02f57b1085ea4 100644 (file)
@@ -31,7 +31,7 @@ OPTIONS
        Use the diff tool specified by <tool>.
        Valid merge tools are:
        kdiff3, kompare, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff,
-       ecmerge, diffuse and opendiff
+       ecmerge, diffuse, opendiff and araxis.
 +
 If a diff tool is not specified, 'git-difftool'
 will use the configuration variable `diff.tool`.  If the
index ff9700d17a333f50d6509bc14a0bd81fad876d3b..68ed6c095664b8f06635ba7eaa85b85086b24280 100644 (file)
@@ -27,7 +27,7 @@ OPTIONS
        Use the merge resolution program specified by <tool>.
        Valid merge tools are:
        kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge,
-       diffuse, tortoisemerge and opendiff
+       diffuse, tortoisemerge, opendiff and araxis.
 +
 If a merge resolution program is not specified, 'git-mergetool'
 will use the configuration variable `merge.tool`.  If the
index 4832bc75e2604c997e004018023e3b93cb394b87..c0f96e70708cab74a13ec8696db003289f99b455 100644 (file)
@@ -23,7 +23,7 @@ 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",
-       "diffuse", "ecmerge", "tortoisemerge", and
+       "diffuse", "ecmerge", "tortoisemerge", "araxis", and
        "opendiff".  Any other value is treated is custom merge tool
        and there must be a corresponding mergetool.<tool>.cmd option.
 
index 1683e6d7b8bc677469d52acf4d6ff187e084cf3a..ead530d3a3d8a86735bdfb144de21ccee262062b 100755 (executable)
@@ -911,7 +911,7 @@ _git_diff ()
 }
 
 __git_mergetools_common="diffuse ecmerge emerge kdiff3 meld opendiff
-                       tkdiff vimdiff gvimdiff xxdiff
+                       tkdiff vimdiff gvimdiff xxdiff araxis
 "
 
 _git_difftool ()
index 8b5e6a8c64238be2534689113984b7eaf07e94e2..bfb01f7842e6192e0b3fbc0e3f2ab96269578289 100644 (file)
@@ -18,6 +18,9 @@ translate_merge_tool_path () {
        emerge)
                echo emacs
                ;;
+       araxis)
+               echo compare
+               ;;
        *)
                echo "$1"
                ;;
@@ -43,7 +46,7 @@ check_unchanged () {
 valid_tool () {
        case "$1" in
        kdiff3 | tkdiff | xxdiff | meld | opendiff | \
-       emerge | vimdiff | gvimdiff | ecmerge | diffuse)
+       emerge | vimdiff | gvimdiff | ecmerge | diffuse | araxis)
                ;; # happy
        tortoisemerge)
                if ! merge_mode; then
@@ -263,6 +266,24 @@ run_merge_tool () {
                        status=1
                fi
                ;;
+       araxis)
+               if merge_mode; then
+                       touch "$BACKUP"
+                       if $base_present; then
+                               "$merge_tool_path" -wait -merge -3 -a1 \
+                                       "$BASE" "$LOCAL" "$REMOTE" "$MERGED" \
+                                       >/dev/null 2>&1
+                       else
+                               "$merge_tool_path" -wait -2 \
+                                       "$LOCAL" "$REMOTE" "$MERGED" \
+                                       >/dev/null 2>&1
+                       fi
+                       check_unchanged
+               else
+                       "$merge_tool_path" -wait -2 "$LOCAL" "$REMOTE" \
+                               >/dev/null 2>&1
+               fi
+               ;;
        *)
                merge_tool_cmd="$(get_merge_tool_cmd "$1")"
                if test -z "$merge_tool_cmd"; then
@@ -302,7 +323,7 @@ guess_merge_tool () {
                else
                        tools="opendiff kdiff3 tkdiff xxdiff meld $tools"
                fi
-               tools="$tools gvimdiff diffuse ecmerge"
+               tools="$tools gvimdiff diffuse ecmerge araxis"
        fi
        if echo "${VISUAL:-$EDITOR}" | grep emacs > /dev/null 2>&1; then
                # $EDITOR is emacs so add emerge as a candidate