git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick Higgins <patrick.higgins@cexp.com>
To: git@vger.kernel.org
Cc: tytso@mit.edu, Patrick Higgins <patrick.higgins@cexp.com>
Subject: [PATCH v2] Detect if kdiff3 supports '--' and do not supply it if not supported
Date: Thu, 12 Jun 2008 17:03:37 -0600	[thread overview]
Message-ID: <1213311817-4673-1-git-send-email-patrick.higgins@cexp.com> (raw)

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

             reply	other threads:[~2008-06-12 23:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12 23:03 Patrick Higgins [this message]
2008-06-13  5:36 ` [PATCH v2] Detect if kdiff3 supports '--' and do not supply it if not supported Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1213311817-4673-1-git-send-email-patrick.higgins@cexp.com \
    --to=patrick.higgins@cexp.com \
    --cc=git@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).