diff options
Diffstat (limited to 'mergetools')
-rw-r--r-- | mergetools/araxis | 18 | ||||
-rw-r--r-- | mergetools/bc | 23 | ||||
-rw-r--r-- | mergetools/bc3 | 1 | ||||
-rw-r--r-- | mergetools/codecompare | 23 | ||||
-rw-r--r-- | mergetools/deltawalker | 25 | ||||
-rw-r--r-- | mergetools/diffmerge | 18 | ||||
-rw-r--r-- | mergetools/diffuse | 15 | ||||
-rw-r--r-- | mergetools/ecmerge | 14 | ||||
-rw-r--r-- | mergetools/emerge | 26 | ||||
-rw-r--r-- | mergetools/examdiff | 16 | ||||
-rw-r--r-- | mergetools/guiffy | 18 | ||||
-rw-r--r-- | mergetools/gvimdiff | 1 | ||||
-rw-r--r-- | mergetools/gvimdiff2 | 1 | ||||
-rw-r--r-- | mergetools/gvimdiff3 | 1 | ||||
-rw-r--r-- | mergetools/kdiff3 | 27 | ||||
-rw-r--r-- | mergetools/kompare | 11 | ||||
-rw-r--r-- | mergetools/meld | 36 | ||||
-rw-r--r-- | mergetools/opendiff | 14 | ||||
-rw-r--r-- | mergetools/p4merge | 36 | ||||
-rw-r--r-- | mergetools/smerge | 12 | ||||
-rw-r--r-- | mergetools/tkdiff | 16 | ||||
-rw-r--r-- | mergetools/tortoisemerge | 32 | ||||
-rw-r--r-- | mergetools/vimdiff | 48 | ||||
-rw-r--r-- | mergetools/vimdiff2 | 1 | ||||
-rw-r--r-- | mergetools/vimdiff3 | 1 | ||||
-rw-r--r-- | mergetools/winmerge | 15 | ||||
-rw-r--r-- | mergetools/xxdiff | 23 |
27 files changed, 472 insertions, 0 deletions
diff --git a/mergetools/araxis b/mergetools/araxis new file mode 100644 index 0000000000..e2407b65b7 --- /dev/null +++ b/mergetools/araxis @@ -0,0 +1,18 @@ +diff_cmd () { + "$merge_tool_path" -wait -2 "$LOCAL" "$REMOTE" >/dev/null 2>&1 +} + +merge_cmd () { + 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 +} + +translate_merge_tool_path() { + echo compare +} diff --git a/mergetools/bc b/mergetools/bc new file mode 100644 index 0000000000..3a69e60faa --- /dev/null +++ b/mergetools/bc @@ -0,0 +1,23 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" "$LOCAL" "$REMOTE" "$BASE" \ + -mergeoutput="$MERGED" + else + "$merge_tool_path" "$LOCAL" "$REMOTE" \ + -mergeoutput="$MERGED" + fi +} + +translate_merge_tool_path() { + if type bcomp >/dev/null 2>/dev/null + then + echo bcomp + else + echo bcompare + fi +} diff --git a/mergetools/bc3 b/mergetools/bc3 new file mode 100644 index 0000000000..5d8dd48184 --- /dev/null +++ b/mergetools/bc3 @@ -0,0 +1 @@ +. "$MERGE_TOOLS_DIR/bc" diff --git a/mergetools/codecompare b/mergetools/codecompare new file mode 100644 index 0000000000..9f60e8da65 --- /dev/null +++ b/mergetools/codecompare @@ -0,0 +1,23 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" -MF="$LOCAL" -TF="$REMOTE" -BF="$BASE" \ + -RF="$MERGED" + else + "$merge_tool_path" -MF="$LOCAL" -TF="$REMOTE" \ + -RF="$MERGED" + fi +} + +translate_merge_tool_path() { + if merge_mode + then + echo CodeMerge + else + echo CodeCompare + fi +} diff --git a/mergetools/deltawalker b/mergetools/deltawalker new file mode 100644 index 0000000000..ee6f374bce --- /dev/null +++ b/mergetools/deltawalker @@ -0,0 +1,25 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1 +} + +merge_cmd () { + # Adding $(pwd)/ in front of $MERGED should not be necessary. + # However without it, DeltaWalker (at least v1.9.8 on Windows) + # crashes with a JRE exception. The DeltaWalker user manual, + # shows $(pwd)/ whenever the '-merged' options is given. + # Adding it here seems to work around the problem. + if $base_present + then + "$merge_tool_path" "$LOCAL" "$REMOTE" "$BASE" -merged="$(pwd)/$MERGED" + else + "$merge_tool_path" "$LOCAL" "$REMOTE" -merged="$(pwd)/$MERGED" + fi >/dev/null 2>&1 +} + +translate_merge_tool_path () { + echo DeltaWalker +} + +exit_code_trustable () { + true +} diff --git a/mergetools/diffmerge b/mergetools/diffmerge new file mode 100644 index 0000000000..9b6355b98a --- /dev/null +++ b/mergetools/diffmerge @@ -0,0 +1,18 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" >/dev/null 2>&1 +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" --merge --result="$MERGED" \ + "$LOCAL" "$BASE" "$REMOTE" + else + "$merge_tool_path" --merge \ + --result="$MERGED" "$LOCAL" "$REMOTE" + fi +} + +exit_code_trustable () { + true +} diff --git a/mergetools/diffuse b/mergetools/diffuse new file mode 100644 index 0000000000..5a3ae8b569 --- /dev/null +++ b/mergetools/diffuse @@ -0,0 +1,15 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" | cat +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" \ + "$LOCAL" "$MERGED" "$REMOTE" \ + "$BASE" | cat + else + "$merge_tool_path" \ + "$LOCAL" "$MERGED" "$REMOTE" | cat + fi +} diff --git a/mergetools/ecmerge b/mergetools/ecmerge new file mode 100644 index 0000000000..6c5101c4f7 --- /dev/null +++ b/mergetools/ecmerge @@ -0,0 +1,14 @@ +diff_cmd () { + "$merge_tool_path" --default --mode=diff2 "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" "$BASE" "$LOCAL" "$REMOTE" \ + --default --mode=merge3 --to="$MERGED" + else + "$merge_tool_path" "$LOCAL" "$REMOTE" \ + --default --mode=merge2 --to="$MERGED" + fi +} diff --git a/mergetools/emerge b/mergetools/emerge new file mode 100644 index 0000000000..d1ce513ff5 --- /dev/null +++ b/mergetools/emerge @@ -0,0 +1,26 @@ +diff_cmd () { + "$merge_tool_path" -f emerge-files-command "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" \ + -f emerge-files-with-ancestor-command \ + "$LOCAL" "$REMOTE" "$BASE" \ + "$(basename "$MERGED")" + else + "$merge_tool_path" \ + -f emerge-files-command \ + "$LOCAL" "$REMOTE" \ + "$(basename "$MERGED")" + fi +} + +translate_merge_tool_path() { + echo emacs +} + +exit_code_trustable () { + true +} diff --git a/mergetools/examdiff b/mergetools/examdiff new file mode 100644 index 0000000000..e72b06fc4d --- /dev/null +++ b/mergetools/examdiff @@ -0,0 +1,16 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" -nh +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" -merge "$LOCAL" "$BASE" "$REMOTE" -o:"$MERGED" -nh + else + "$merge_tool_path" -merge "$LOCAL" "$REMOTE" -o:"$MERGED" -nh + fi +} + +translate_merge_tool_path() { + mergetool_find_win32_cmd "ExamDiff.com" "ExamDiff Pro" +} diff --git a/mergetools/guiffy b/mergetools/guiffy new file mode 100644 index 0000000000..8b23a13c41 --- /dev/null +++ b/mergetools/guiffy @@ -0,0 +1,18 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" -s "$LOCAL" \ + "$REMOTE" "$BASE" "$MERGED" + else + "$merge_tool_path" -m "$LOCAL" \ + "$REMOTE" "$MERGED" + fi +} + +exit_code_trustable () { + true +} diff --git a/mergetools/gvimdiff b/mergetools/gvimdiff new file mode 100644 index 0000000000..04a5bb0ea8 --- /dev/null +++ b/mergetools/gvimdiff @@ -0,0 +1 @@ +. "$MERGE_TOOLS_DIR/vimdiff" diff --git a/mergetools/gvimdiff2 b/mergetools/gvimdiff2 new file mode 100644 index 0000000000..04a5bb0ea8 --- /dev/null +++ b/mergetools/gvimdiff2 @@ -0,0 +1 @@ +. "$MERGE_TOOLS_DIR/vimdiff" diff --git a/mergetools/gvimdiff3 b/mergetools/gvimdiff3 new file mode 100644 index 0000000000..04a5bb0ea8 --- /dev/null +++ b/mergetools/gvimdiff3 @@ -0,0 +1 @@ +. "$MERGE_TOOLS_DIR/vimdiff" diff --git a/mergetools/kdiff3 b/mergetools/kdiff3 new file mode 100644 index 0000000000..0264ed5b20 --- /dev/null +++ b/mergetools/kdiff3 @@ -0,0 +1,27 @@ +diff_cmd () { + "$merge_tool_path" \ + --L1 "$MERGED (A)" --L2 "$MERGED (B)" \ + "$LOCAL" "$REMOTE" >/dev/null 2>&1 +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" --auto \ + --L1 "$MERGED (Base)" \ + --L2 "$MERGED (Local)" \ + --L3 "$MERGED (Remote)" \ + -o "$MERGED" "$BASE" "$LOCAL" "$REMOTE" \ + >/dev/null 2>&1 + else + "$merge_tool_path" --auto \ + --L1 "$MERGED (Local)" \ + --L2 "$MERGED (Remote)" \ + -o "$MERGED" "$LOCAL" "$REMOTE" \ + >/dev/null 2>&1 + fi +} + +exit_code_trustable () { + true +} diff --git a/mergetools/kompare b/mergetools/kompare new file mode 100644 index 0000000000..e8c0bfa678 --- /dev/null +++ b/mergetools/kompare @@ -0,0 +1,11 @@ +can_merge () { + return 1 +} + +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} + +exit_code_trustable () { + true +} diff --git a/mergetools/meld b/mergetools/meld new file mode 100644 index 0000000000..7a08470f88 --- /dev/null +++ b/mergetools/meld @@ -0,0 +1,36 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if test -z "${meld_has_output_option:+set}" + then + check_meld_for_output_version + fi + + if test "$meld_has_output_option" = true + then + "$merge_tool_path" --output="$MERGED" \ + "$LOCAL" "$BASE" "$REMOTE" + else + "$merge_tool_path" "$LOCAL" "$MERGED" "$REMOTE" + fi +} + +# Check whether we should use 'meld --output <file>' +check_meld_for_output_version () { + meld_path="$(git config mergetool.meld.path)" + meld_path="${meld_path:-meld}" + + if meld_has_output_option=$(git config --bool mergetool.meld.hasOutput) + then + : use configured value + elif "$meld_path" --help 2>&1 | + grep -e '--output=' -e '\[OPTION\.\.\.\]' >/dev/null + then + : old ones mention --output and new ones just say OPTION... + meld_has_output_option=true + else + meld_has_output_option=false + fi +} diff --git a/mergetools/opendiff b/mergetools/opendiff new file mode 100644 index 0000000000..b608dd6de3 --- /dev/null +++ b/mergetools/opendiff @@ -0,0 +1,14 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" | cat +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" "$LOCAL" "$REMOTE" \ + -ancestor "$BASE" -merge "$MERGED" | cat + else + "$merge_tool_path" "$LOCAL" "$REMOTE" \ + -merge "$MERGED" | cat + fi +} diff --git a/mergetools/p4merge b/mergetools/p4merge new file mode 100644 index 0000000000..7a5b291dd2 --- /dev/null +++ b/mergetools/p4merge @@ -0,0 +1,36 @@ +diff_cmd () { + empty_file= + + # p4merge does not like /dev/null + if test "/dev/null" = "$LOCAL" + then + LOCAL="$(create_empty_file)" + fi + if test "/dev/null" = "$REMOTE" + then + REMOTE="$(create_empty_file)" + fi + + "$merge_tool_path" "$LOCAL" "$REMOTE" + + if test -n "$empty_file" + then + rm -f "$empty_file" + fi +} + +merge_cmd () { + if ! $base_present + then + cp -- "$LOCAL" "$BASE" + create_virtual_base "$BASE" "$REMOTE" + fi + "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED" +} + +create_empty_file () { + empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$" + >"$empty_file" + + printf "%s" "$empty_file" +} diff --git a/mergetools/smerge b/mergetools/smerge new file mode 100644 index 0000000000..9c2e6f6fd7 --- /dev/null +++ b/mergetools/smerge @@ -0,0 +1,12 @@ +diff_cmd () { + "$merge_tool_path" mergetool "$LOCAL" "$REMOTE" -o "$MERGED" +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" mergetool "$BASE" "$LOCAL" "$REMOTE" -o "$MERGED" + else + "$merge_tool_path" mergetool "$LOCAL" "$REMOTE" -o "$MERGED" + fi +} diff --git a/mergetools/tkdiff b/mergetools/tkdiff new file mode 100644 index 0000000000..eee5cb57e3 --- /dev/null +++ b/mergetools/tkdiff @@ -0,0 +1,16 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" -a "$BASE" -o "$MERGED" "$LOCAL" "$REMOTE" + else + "$merge_tool_path" -o "$MERGED" "$LOCAL" "$REMOTE" + fi +} + +exit_code_trustable () { + true +} diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge new file mode 100644 index 0000000000..d7ab666a59 --- /dev/null +++ b/mergetools/tortoisemerge @@ -0,0 +1,32 @@ +can_diff () { + return 1 +} + +merge_cmd () { + if $base_present + then + basename="$(basename "$merge_tool_path" .exe)" + if test "$basename" = "tortoisegitmerge" + then + "$merge_tool_path" \ + -base "$BASE" -mine "$LOCAL" \ + -theirs "$REMOTE" -merged "$MERGED" + else + "$merge_tool_path" \ + -base:"$BASE" -mine:"$LOCAL" \ + -theirs:"$REMOTE" -merged:"$MERGED" + fi + else + echo "$merge_tool_path cannot be used without a base" 1>&2 + return 1 + fi +} + +translate_merge_tool_path() { + if type tortoisegitmerge >/dev/null 2>/dev/null + then + echo tortoisegitmerge + else + echo tortoisemerge + fi +} diff --git a/mergetools/vimdiff b/mergetools/vimdiff new file mode 100644 index 0000000000..10d86f3e19 --- /dev/null +++ b/mergetools/vimdiff @@ -0,0 +1,48 @@ +diff_cmd () { + "$merge_tool_path" -R -f -d \ + -c 'wincmd l' -c 'cd $GIT_PREFIX' "$LOCAL" "$REMOTE" +} + +merge_cmd () { + case "$1" in + gvimdiff|vimdiff) + if $base_present + then + "$merge_tool_path" -f -d -c '4wincmd w | wincmd J' \ + "$LOCAL" "$BASE" "$REMOTE" "$MERGED" + else + "$merge_tool_path" -f -d -c 'wincmd l' \ + "$LOCAL" "$MERGED" "$REMOTE" + fi + ;; + gvimdiff2|vimdiff2) + "$merge_tool_path" -f -d -c 'wincmd l' \ + "$LOCAL" "$MERGED" "$REMOTE" + ;; + gvimdiff3|vimdiff3) + if $base_present + then + "$merge_tool_path" -f -d -c 'hid | hid | hid' \ + "$LOCAL" "$REMOTE" "$BASE" "$MERGED" + else + "$merge_tool_path" -f -d -c 'hid | hid' \ + "$LOCAL" "$REMOTE" "$MERGED" + fi + ;; + esac +} + +translate_merge_tool_path() { + case "$1" in + gvimdiff|gvimdiff2|gvimdiff3) + echo gvim + ;; + vimdiff|vimdiff2|vimdiff3) + echo vim + ;; + esac +} + +exit_code_trustable () { + true +} diff --git a/mergetools/vimdiff2 b/mergetools/vimdiff2 new file mode 100644 index 0000000000..04a5bb0ea8 --- /dev/null +++ b/mergetools/vimdiff2 @@ -0,0 +1 @@ +. "$MERGE_TOOLS_DIR/vimdiff" diff --git a/mergetools/vimdiff3 b/mergetools/vimdiff3 new file mode 100644 index 0000000000..04a5bb0ea8 --- /dev/null +++ b/mergetools/vimdiff3 @@ -0,0 +1 @@ +. "$MERGE_TOOLS_DIR/vimdiff" diff --git a/mergetools/winmerge b/mergetools/winmerge new file mode 100644 index 0000000000..74d03259fd --- /dev/null +++ b/mergetools/winmerge @@ -0,0 +1,15 @@ +diff_cmd () { + "$merge_tool_path" -u -e "$LOCAL" "$REMOTE" + return 0 +} + +merge_cmd () { + # mergetool.winmerge.trustExitCode is implicitly false. + # touch $BACKUP so that we can check_unchanged. + "$merge_tool_path" -u -e -dl Local -dr Remote \ + "$LOCAL" "$REMOTE" "$MERGED" +} + +translate_merge_tool_path() { + mergetool_find_win32_cmd "WinMergeU.exe" "WinMerge" +} diff --git a/mergetools/xxdiff b/mergetools/xxdiff new file mode 100644 index 0000000000..ce5b8e9f29 --- /dev/null +++ b/mergetools/xxdiff @@ -0,0 +1,23 @@ +diff_cmd () { + "$merge_tool_path" \ + -R 'Accel.Search: "Ctrl+F"' \ + -R 'Accel.SearchForward: "Ctrl+G"' \ + "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" -X --show-merged-pane \ + -R 'Accel.SaveAsMerged: "Ctrl+S"' \ + -R 'Accel.Search: "Ctrl+F"' \ + -R 'Accel.SearchForward: "Ctrl+G"' \ + --merged-file "$MERGED" "$LOCAL" "$BASE" "$REMOTE" + else + "$merge_tool_path" -X $extra \ + -R 'Accel.SaveAsMerged: "Ctrl+S"' \ + -R 'Accel.Search: "Ctrl+F"' \ + -R 'Accel.SearchForward: "Ctrl+G"' \ + --merged-file "$MERGED" "$LOCAL" "$REMOTE" + fi +} |