git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] Detect if kdiff3 supports '--' and do not supply it if not supported

From
PHPatrick Higgins <patrick.higgins@cexp.com>
Date
Jun 12, 2008, 23:03 UTC
Message-ID
<1213311817-4673-1-git-send-email-patrick.higgins@cexp.com>

kdiff3 can be compiled with Qt only or with KDE support. If compiled with Qt only, it does not support '--' and mergetool fails silently.

Signed-off-by: Patrick Higgins <patrick.higgins@cexp.com>
---
 git-mergetool.sh |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index fcdec4a..85ce004 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -181,12 +181,19 @@ merge_file () {
 
     case "$merge_tool" in
 	kdiff3)
+	    "$merge_tool_path" --auto -o /dev/null -- /dev/null /dev/null
+	    if test $? -ne 0; then
+		double_dash=""
+	    else
+		double_dash="--"
+	    fi
+
 	    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)
+		    -o "$MERGED" $double_dash "$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)
+		    -o "$MERGED" $double_dash "$LOCAL" "$REMOTE" > /dev/null 2>&1)
 	    fi
 	    status=$?
 	    ;;
-- 
1.5.6.rc2
Next: Junio C Hamano
Message 1 of 2 in “Detect if kdiff3 supports '--' and do not supply it if not supported”
  1. Detect if kdiff3 supports '--' and do not supply it if not supportedPatrick Higgins, Jun 12, 2008
  2. Junio C HamanoJun 13, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.