about summary refs log tree commit diff
path: root/third_party/git/mergetools
diff options
context:
space:
mode:
authorVincent Ambo <Vincent Ambo>2020-01-11T23·36+0000
committerVincent Ambo <Vincent Ambo>2020-01-11T23·40+0000
commit7ef0d62730840ded097b524104cc0a0904591a63 (patch)
treea670f96103667aeca4789a95d94ca0dff550c4ce /third_party/git/mergetools
parent6a2a3007077818e24a3d56fc492ada9206a10cf0 (diff)
parent1b593e1ea4d2af0f6444d9a7788d5d99abd6fde5 (diff)
merge(third_party/git): Merge squashed git subtree at v2.23.0 r/373
Merge commit '1b593e1ea4d2af0f6444d9a7788d5d99abd6fde5' as 'third_party/git'
Diffstat (limited to 'third_party/git/mergetools')
-rw-r--r--third_party/git/mergetools/araxis18
-rw-r--r--third_party/git/mergetools/bc23
-rw-r--r--third_party/git/mergetools/bc31
-rw-r--r--third_party/git/mergetools/codecompare23
-rw-r--r--third_party/git/mergetools/deltawalker25
-rw-r--r--third_party/git/mergetools/diffmerge18
-rw-r--r--third_party/git/mergetools/diffuse15
-rw-r--r--third_party/git/mergetools/ecmerge14
-rw-r--r--third_party/git/mergetools/emerge26
-rw-r--r--third_party/git/mergetools/examdiff16
-rw-r--r--third_party/git/mergetools/guiffy18
-rw-r--r--third_party/git/mergetools/gvimdiff1
-rw-r--r--third_party/git/mergetools/gvimdiff21
-rw-r--r--third_party/git/mergetools/gvimdiff31
-rw-r--r--third_party/git/mergetools/kdiff327
-rw-r--r--third_party/git/mergetools/kompare11
-rw-r--r--third_party/git/mergetools/meld36
-rw-r--r--third_party/git/mergetools/opendiff14
-rw-r--r--third_party/git/mergetools/p4merge36
-rw-r--r--third_party/git/mergetools/smerge12
-rw-r--r--third_party/git/mergetools/tkdiff16
-rw-r--r--third_party/git/mergetools/tortoisemerge32
-rw-r--r--third_party/git/mergetools/vimdiff48
-rw-r--r--third_party/git/mergetools/vimdiff21
-rw-r--r--third_party/git/mergetools/vimdiff31
-rw-r--r--third_party/git/mergetools/winmerge15
-rw-r--r--third_party/git/mergetools/xxdiff23
27 files changed, 472 insertions, 0 deletions
diff --git a/third_party/git/mergetools/araxis b/third_party/git/mergetools/araxis
new file mode 100644
index 000000000000..e2407b65b70d
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/bc b/third_party/git/mergetools/bc
new file mode 100644
index 000000000000..3a69e60faa9c
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/bc3 b/third_party/git/mergetools/bc3
new file mode 100644
index 000000000000..5d8dd4818488
--- /dev/null
+++ b/third_party/git/mergetools/bc3
@@ -0,0 +1 @@
+. "$MERGE_TOOLS_DIR/bc"
diff --git a/third_party/git/mergetools/codecompare b/third_party/git/mergetools/codecompare
new file mode 100644
index 000000000000..9f60e8da6527
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/deltawalker b/third_party/git/mergetools/deltawalker
new file mode 100644
index 000000000000..ee6f374bceb8
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/diffmerge b/third_party/git/mergetools/diffmerge
new file mode 100644
index 000000000000..9b6355b98a71
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/diffuse b/third_party/git/mergetools/diffuse
new file mode 100644
index 000000000000..5a3ae8b5695d
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/ecmerge b/third_party/git/mergetools/ecmerge
new file mode 100644
index 000000000000..6c5101c4f729
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/emerge b/third_party/git/mergetools/emerge
new file mode 100644
index 000000000000..d1ce513ff5d3
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/examdiff b/third_party/git/mergetools/examdiff
new file mode 100644
index 000000000000..e72b06fc4d8f
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/guiffy b/third_party/git/mergetools/guiffy
new file mode 100644
index 000000000000..8b23a13c4111
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/gvimdiff b/third_party/git/mergetools/gvimdiff
new file mode 100644
index 000000000000..04a5bb0ea848
--- /dev/null
+++ b/third_party/git/mergetools/gvimdiff
@@ -0,0 +1 @@
+. "$MERGE_TOOLS_DIR/vimdiff"
diff --git a/third_party/git/mergetools/gvimdiff2 b/third_party/git/mergetools/gvimdiff2
new file mode 100644
index 000000000000..04a5bb0ea848
--- /dev/null
+++ b/third_party/git/mergetools/gvimdiff2
@@ -0,0 +1 @@
+. "$MERGE_TOOLS_DIR/vimdiff"
diff --git a/third_party/git/mergetools/gvimdiff3 b/third_party/git/mergetools/gvimdiff3
new file mode 100644
index 000000000000..04a5bb0ea848
--- /dev/null
+++ b/third_party/git/mergetools/gvimdiff3
@@ -0,0 +1 @@
+. "$MERGE_TOOLS_DIR/vimdiff"
diff --git a/third_party/git/mergetools/kdiff3 b/third_party/git/mergetools/kdiff3
new file mode 100644
index 000000000000..0264ed5b20b2
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/kompare b/third_party/git/mergetools/kompare
new file mode 100644
index 000000000000..e8c0bfa67854
--- /dev/null
+++ b/third_party/git/mergetools/kompare
@@ -0,0 +1,11 @@
+can_merge () {
+	return 1
+}
+
+diff_cmd () {
+	"$merge_tool_path" "$LOCAL" "$REMOTE"
+}
+
+exit_code_trustable () {
+	true
+}
diff --git a/third_party/git/mergetools/meld b/third_party/git/mergetools/meld
new file mode 100644
index 000000000000..7a08470f8836
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/opendiff b/third_party/git/mergetools/opendiff
new file mode 100644
index 000000000000..b608dd6de30a
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/p4merge b/third_party/git/mergetools/p4merge
new file mode 100644
index 000000000000..7a5b291dd28a
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/smerge b/third_party/git/mergetools/smerge
new file mode 100644
index 000000000000..9c2e6f6fd7d0
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/tkdiff b/third_party/git/mergetools/tkdiff
new file mode 100644
index 000000000000..eee5cb57e3cc
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/tortoisemerge b/third_party/git/mergetools/tortoisemerge
new file mode 100644
index 000000000000..d7ab666a59a2
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/vimdiff b/third_party/git/mergetools/vimdiff
new file mode 100644
index 000000000000..10d86f3e1930
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/vimdiff2 b/third_party/git/mergetools/vimdiff2
new file mode 100644
index 000000000000..04a5bb0ea848
--- /dev/null
+++ b/third_party/git/mergetools/vimdiff2
@@ -0,0 +1 @@
+. "$MERGE_TOOLS_DIR/vimdiff"
diff --git a/third_party/git/mergetools/vimdiff3 b/third_party/git/mergetools/vimdiff3
new file mode 100644
index 000000000000..04a5bb0ea848
--- /dev/null
+++ b/third_party/git/mergetools/vimdiff3
@@ -0,0 +1 @@
+. "$MERGE_TOOLS_DIR/vimdiff"
diff --git a/third_party/git/mergetools/winmerge b/third_party/git/mergetools/winmerge
new file mode 100644
index 000000000000..74d03259fdf1
--- /dev/null
+++ b/third_party/git/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/third_party/git/mergetools/xxdiff b/third_party/git/mergetools/xxdiff
new file mode 100644
index 000000000000..ce5b8e9f2962
--- /dev/null
+++ b/third_party/git/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
+}