[PATCH 2/3] mergetool-lib: specialize xxdiff options when in diff mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We don't need '-merged-file', 'save as', and the merge-status exit
code when in diff mode

Signed-off-by: David Aguilar <davvid@xxxxxxxxx>
---
 git-mergetool-lib.sh |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/git-mergetool-lib.sh b/git-mergetool-lib.sh
index e2d074d..3ba332b 100644
--- a/git-mergetool-lib.sh
+++ b/git-mergetool-lib.sh
@@ -127,7 +127,9 @@ run_mergetool () {
 		fi
 		;;
 	xxdiff)
-		merge_mode && touch "$BACKUP"
+		if merge_mode; then
+			touch "$BACKUP"
+		fi
 		if $base_present; then
 			"$merge_tool_path" -X --show-merged-pane \
 			    -R 'Accel.SaveAsMerged: "Ctrl-S"' \
@@ -135,12 +137,18 @@ run_mergetool () {
 			    -R 'Accel.SearchForward: "Ctrl-G"' \
 			    --merged-file "$MERGED" "$LOCAL" "$BASE" "$REMOTE"
 		else
-			merge_mode && extra=--show-merged-pane
-			"$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"
+			if merge_mode; then
+				"$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"
+			else
+				"$merge_tool_path" \
+					-R 'Accel.Search: "Ctrl+F"' \
+					-R 'Accel.SearchForward: "Ctrl-G"' \
+					"$LOCAL" "$REMOTE"
+			fi
 		fi
 		check_unchanged
 		;;
-- 
1.6.2.1.303.g63699

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux