diff options
Diffstat (limited to 'mergetools')
-rw-r--r-- | mergetools/araxis | 20 | ||||
-rw-r--r-- | mergetools/bc3 | 25 | ||||
-rw-r--r-- | mergetools/codecompare | 25 | ||||
-rw-r--r-- | mergetools/deltawalker | 21 | ||||
-rw-r--r-- | mergetools/diffmerge | 15 | ||||
-rw-r--r-- | mergetools/diffuse | 17 | ||||
-rw-r--r-- | mergetools/ecmerge | 16 | ||||
-rw-r--r-- | mergetools/emerge | 23 | ||||
-rw-r--r-- | mergetools/gvimdiff | 1 | ||||
-rw-r--r-- | mergetools/gvimdiff2 | 1 | ||||
-rw-r--r-- | mergetools/kdiff3 | 24 | ||||
-rw-r--r-- | mergetools/kompare | 7 | ||||
-rw-r--r-- | mergetools/meld | 32 | ||||
-rw-r--r-- | mergetools/opendiff | 16 | ||||
-rw-r--r-- | mergetools/p4merge | 38 | ||||
-rw-r--r-- | mergetools/tkdiff | 12 | ||||
-rw-r--r-- | mergetools/tortoisemerge | 34 | ||||
-rw-r--r-- | mergetools/vimdiff | 36 | ||||
-rw-r--r-- | mergetools/vimdiff2 | 1 | ||||
-rw-r--r-- | mergetools/xxdiff | 25 |
20 files changed, 389 insertions, 0 deletions
diff --git a/mergetools/araxis b/mergetools/araxis new file mode 100644 index 0000000000..64f97c5e97 --- /dev/null +++ b/mergetools/araxis @@ -0,0 +1,20 @@ +diff_cmd () { + "$merge_tool_path" -wait -2 "$LOCAL" "$REMOTE" >/dev/null 2>&1 +} + +merge_cmd () { + 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 +} + +translate_merge_tool_path() { + echo compare +} diff --git a/mergetools/bc3 b/mergetools/bc3 new file mode 100644 index 0000000000..b6319d206e --- /dev/null +++ b/mergetools/bc3 @@ -0,0 +1,25 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} + +merge_cmd () { + touch "$BACKUP" + if $base_present + then + "$merge_tool_path" "$LOCAL" "$REMOTE" "$BASE" \ + -mergeoutput="$MERGED" + else + "$merge_tool_path" "$LOCAL" "$REMOTE" \ + -mergeoutput="$MERGED" + fi + check_unchanged +} + +translate_merge_tool_path() { + if type bcomp >/dev/null 2>/dev/null + then + echo bcomp + else + echo bcompare + fi +} diff --git a/mergetools/codecompare b/mergetools/codecompare new file mode 100644 index 0000000000..3f0486bc80 --- /dev/null +++ b/mergetools/codecompare @@ -0,0 +1,25 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} + +merge_cmd () { + touch "$BACKUP" + 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 + check_unchanged +} + +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..b3c71b6236 --- /dev/null +++ b/mergetools/deltawalker @@ -0,0 +1,21 @@ +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 +} diff --git a/mergetools/diffmerge b/mergetools/diffmerge new file mode 100644 index 0000000000..85ac720157 --- /dev/null +++ b/mergetools/diffmerge @@ -0,0 +1,15 @@ +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 + status=$? +} diff --git a/mergetools/diffuse b/mergetools/diffuse new file mode 100644 index 0000000000..02e0843f47 --- /dev/null +++ b/mergetools/diffuse @@ -0,0 +1,17 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" | cat +} + +merge_cmd () { + 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 +} diff --git a/mergetools/ecmerge b/mergetools/ecmerge new file mode 100644 index 0000000000..13c2e439de --- /dev/null +++ b/mergetools/ecmerge @@ -0,0 +1,16 @@ +diff_cmd () { + "$merge_tool_path" --default --mode=diff2 "$LOCAL" "$REMOTE" +} + +merge_cmd () { + touch "$BACKUP" + 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 + check_unchanged +} diff --git a/mergetools/emerge b/mergetools/emerge new file mode 100644 index 0000000000..f96d9e550a --- /dev/null +++ b/mergetools/emerge @@ -0,0 +1,23 @@ +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 + status=$? +} + +translate_merge_tool_path() { + echo emacs +} 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/kdiff3 b/mergetools/kdiff3 new file mode 100644 index 0000000000..a30034f116 --- /dev/null +++ b/mergetools/kdiff3 @@ -0,0 +1,24 @@ +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 + status=$? +} diff --git a/mergetools/kompare b/mergetools/kompare new file mode 100644 index 0000000000..433686c12a --- /dev/null +++ b/mergetools/kompare @@ -0,0 +1,7 @@ +can_merge () { + return 1 +} + +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} diff --git a/mergetools/meld b/mergetools/meld new file mode 100644 index 0000000000..cb672a5519 --- /dev/null +++ b/mergetools/meld @@ -0,0 +1,32 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if test -z "${meld_has_output_option:+set}" + then + check_meld_for_output_version + fi + touch "$BACKUP" + 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_unchanged +} + +# Check whether 'meld --output <file>' is supported +check_meld_for_output_version () { + meld_path="$(git config mergetool.meld.path)" + meld_path="${meld_path:-meld}" + + if "$meld_path" --help 2>&1 | grep -e --output >/dev/null + then + 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..0942b2a733 --- /dev/null +++ b/mergetools/opendiff @@ -0,0 +1,16 @@ +diff_cmd () { + "$merge_tool_path" "$LOCAL" "$REMOTE" | cat +} + +merge_cmd () { + touch "$BACKUP" + if $base_present + then + "$merge_tool_path" "$LOCAL" "$REMOTE" \ + -ancestor "$BASE" -merge "$MERGED" | cat + else + "$merge_tool_path" "$LOCAL" "$REMOTE" \ + -merge "$MERGED" | cat + fi + check_unchanged +} diff --git a/mergetools/p4merge b/mergetools/p4merge new file mode 100644 index 0000000000..5a608abf9c --- /dev/null +++ b/mergetools/p4merge @@ -0,0 +1,38 @@ +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 () { + touch "$BACKUP" + if ! $base_present + then + cp -- "$LOCAL" "$BASE" + create_virtual_base "$BASE" "$REMOTE" + fi + "$merge_tool_path" "$BASE" "$REMOTE" "$LOCAL" "$MERGED" + check_unchanged +} + +create_empty_file () { + empty_file="${TMPDIR:-/tmp}/git-difftool-p4merge-empty-file.$$" + >"$empty_file" + + printf "%s" "$empty_file" +} diff --git a/mergetools/tkdiff b/mergetools/tkdiff new file mode 100644 index 0000000000..618c438e87 --- /dev/null +++ b/mergetools/tkdiff @@ -0,0 +1,12 @@ +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 +} diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge new file mode 100644 index 0000000000..3b89f1c82d --- /dev/null +++ b/mergetools/tortoisemerge @@ -0,0 +1,34 @@ +can_diff () { + return 1 +} + +merge_cmd () { + if $base_present + then + touch "$BACKUP" + 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 + check_unchanged + 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..39d032771b --- /dev/null +++ b/mergetools/vimdiff @@ -0,0 +1,36 @@ +diff_cmd () { + "$merge_tool_path" -R -f -d \ + -c 'wincmd l' -c 'cd $GIT_PREFIX' "$LOCAL" "$REMOTE" +} + +merge_cmd () { + touch "$BACKUP" + case "$1" in + gvimdiff|vimdiff) + if $base_present + then + "$merge_tool_path" -f -d -c 'wincmd J' \ + "$MERGED" "$LOCAL" "$BASE" "$REMOTE" + 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" + ;; + esac + check_unchanged +} + +translate_merge_tool_path() { + case "$1" in + gvimdiff|gvimdiff2) + echo gvim + ;; + vimdiff|vimdiff2) + echo vim + ;; + esac +} 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/xxdiff b/mergetools/xxdiff new file mode 100644 index 0000000000..05b443394b --- /dev/null +++ b/mergetools/xxdiff @@ -0,0 +1,25 @@ +diff_cmd () { + "$merge_tool_path" \ + -R 'Accel.Search: "Ctrl+F"' \ + -R 'Accel.SearchForward: "Ctrl-G"' \ + "$LOCAL" "$REMOTE" +} + +merge_cmd () { + touch "$BACKUP" + 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 + check_unchanged +} |