public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Sven Strickroth <sven.strickroth@tu-clausthal•de>
To: git@vger•kernel.org
Cc: David Aguilar <davvid@gmail•com>,
	Junio C Hamano <gitster@pobox•com>,
	Sebastian Schuberth <sschuberth@gmail•com>,
	Jeff King <peff@peff•net>
Subject: [PATCH] mergetools: Enhance tortoisemerge to work with
Date: Fri, 25 Jan 2013 14:07:08 +0100	[thread overview]
Message-ID: <5102837C.9000608@tu-clausthal.de> (raw)
In-Reply-To: <CAJDDKr7eNyJp1ffBYEJaZkmnVWqd0AMpnm1kdjnrrhPtuGNL_w@mail.gmail.com>

 TortoiseGitMerge and filenames with spaces

- The TortoiseGit team renamed TortoiseMerge.exe to TortoiseGitMerge.exe
  (starting with 1.8.0) in order to make clear that this one has special
  support for git, (uses spaces as cli parameter key-value separators)
  and prevent confusion with the TortoiseSVN TortoiseMerge version.
- The tortoisemerge mergetool does not work with filenames which have
  a space in it. Fixing this required changes in git and also in
  TortoiseGitMerge; see https://github.com/msysgit/msysgit/issues/57.

Signed-off-by: Sven Strickroth <email@cs-ware•de>
Reported-by: Sebastian Schuberth <sschuberth@gmail•com>
---
 mergetools/tortoisemerge | 51 ++++++++++++++++++++++++++++++++----------------
 1 file changed, 34 insertions(+), 17 deletions(-)

diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge
index ed7db49..8ee99a5 100644
--- a/mergetools/tortoisemerge
+++ b/mergetools/tortoisemerge
@@ -1,17 +1,34 @@
-can_diff () {
-	return 1
-}
-
-merge_cmd () {
-	if $base_present
-	then
-		touch "$BACKUP"
-		"$merge_tool_path" \
-			-base:"$BASE" -mine:"$LOCAL" \
-			-theirs:"$REMOTE" -merged:"$MERGED"
-		check_unchanged
-	else
-		echo "TortoiseMerge cannot be used without a base" 1>&2
-		return 1
-	fi
-}
+can_diff () {
+	return 1
+}
+
+merge_cmd () {
+	if $base_present
+	then
+		touch "$BACKUP"
+		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
+		check_unchanged
+	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
+}
-- 
Best regards,
 Sven Strickroth
 PGP key id F5A9D4C4 @ any key-server

  reply	other threads:[~2013-01-25 13:08 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-20 11:27 [PATCH] mergetools: Add tortoisegitmerge helper Sven Strickroth
2013-01-21  0:43 ` Junio C Hamano
2013-01-21  8:24   ` Sven Strickroth
2013-01-21  8:26   ` Sven Strickroth
2013-01-24 11:19     ` Sven Strickroth
2013-01-24 19:51     ` Junio C Hamano
2013-01-24 22:07       ` Sven Strickroth
2013-01-24 22:15         ` Junio C Hamano
2013-01-25  6:11           ` David Aguilar
2013-01-25  7:21             ` Junio C Hamano
2013-01-25  7:54               ` David Aguilar
2013-01-25  9:48                 ` John Keeping
2013-01-25  9:06         ` [PATCH] mergetools: Enhance tortoisemerge to work with Sven Strickroth
2013-01-25 10:09           ` David Aguilar
2013-01-25 13:07             ` Sven Strickroth [this message]
2013-01-25 18:28               ` Junio C Hamano
2013-01-26  0:58                 ` Sven Strickroth
2013-01-26  1:14                 ` Sven Strickroth
2013-01-26  1:15                 ` [PATCH 1/2] mergetools: Added support for TortoiseGitMerge Sven Strickroth
2013-01-26  1:17                 ` [PATCH 2/2] mergetools: Make tortoisemerge work with Sven Strickroth
2013-01-26  7:10                   ` David Aguilar
2013-01-27  9:14                     ` Sven Strickroth
2013-01-27 17:48                       ` Junio C Hamano
2013-02-01 19:33                         ` [PATCH] mergetools: Enable tortoisemerge to handle filenames with Sven Strickroth
2013-02-01 20:07                           ` Sebastian Schuberth
2013-02-01 20:10                             ` Sven Strickroth
2013-02-01 20:15                             ` Junio C Hamano
2013-02-01 20:17                               ` Sven Strickroth
2013-02-01 20:16                             ` [PATCH] mergetools: Enable tortoisemerge to handle filenames with spaces with TortoiseGitMerge Sven Strickroth
2013-02-02  1:59                               ` David Aguilar
2013-02-02  2:08                                 ` 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=5102837C.9000608@tu-clausthal.de \
    --to=sven.strickroth@tu-clausthal$(echo .)de \
    --cc=davvid@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=peff@peff$(echo .)net \
    --cc=sschuberth@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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