Subject: [PATCH 1/3] mergetool-lib: specialize kdiff3 options when in diff mode

From: David Aguilar <[email-masked]>
Date: Thu, 2 Apr 2009 03:30:44 -0700

kdiff3 should only show two files when in diff mode.

Signed-off-by: David Aguilar <[email-masked]>
---
 git-mergetool-lib.sh |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/git-mergetool-lib.sh b/git-mergetool-lib.sh
index d28be68..e2d074d 100644
--- a/git-mergetool-lib.sh
+++ b/git-mergetool-lib.sh
@@ -67,9 +67,19 @@ run_mergetool () {
 			 --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)
+			if merge_mode; then
+				("$merge_tool_path" --auto \
+				 --L1 "$MERGED (Local)" \
+				 --L2 "$MERGED (Remote)" \
+				 -o "$MERGED" "$LOCAL" "$REMOTE" \
+				> /dev/null 2>&1)
+			else
+				("$merge_tool_path" --auto \
+				 --L1 "$MERGED (A)" \
+				 --L2 "$MERGED (B)" \
+				 "$LOCAL" "$REMOTE" \
+				> /dev/null 2>&1)
+			fi
 		fi
 		status=$?
 		;;
-- 
1.6.2.1.303.g63699