From 8bf671946da23b39b7b6b18fe99cfa011ec21a11 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 26 Jan 2013 02:15:57 +0100 Subject: mergetools: support TortoiseGitMerge TortoiseMerge.exe was ben renamed to TortoiseGitMerge.exe (starting with 1.8.0) in order to make it clear that it has special support for git, and prevent confusion with the TortoiseSVN TortoiseMerge version. Signed-off-by: Sven Strickroth Signed-off-by: Junio C Hamano --- mergetools/tortoisemerge | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'mergetools') diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge index ed7db495ed..8476afa66e 100644 --- a/mergetools/tortoisemerge +++ b/mergetools/tortoisemerge @@ -11,7 +11,16 @@ merge_cmd () { -theirs:"$REMOTE" -merged:"$MERGED" check_unchanged else - echo "TortoiseMerge cannot be used without a base" 1>&2 + 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 +} -- cgit v1.2.3 From 81ed7b9581f7eafb334824264abb492d85a5ffb8 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Fri, 1 Feb 2013 21:16:30 +0100 Subject: mergetools: teach tortoisemerge to handle filenames with SP correctly TortoiseGitMerge, unlike TortoiseMerge, can be told to handle paths with spaces in them by using -option "$FILE" (not -option:"$FILE", which does not work for such paths) syntax. This change was necessary because of MSYS path mangling [1], the ":" after the "base" etc. arguments to TortoiseMerge caused the whole argument instead of just the file name to be quoted in case of file names with spaces. So TortoiseMerge was passed "-base:new file.txt" instead of -base:"new file.txt" (including the quotes). To work around this, TortoiseGitMerge does not require the ":" after the arguments anymore which fixes handling file names with spaces [2] (as written above). [1] http://www.mingw.org/wiki/Posix_path_conversion [2] https://github.com/msysgit/msysgit/issues/57 Signed-off-by: Sven Strickroth Reported-by: Sebastian Schuberth Signed-off-by: Junio C Hamano --- mergetools/tortoisemerge | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'mergetools') diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge index 8476afa66e..3b89f1c82d 100644 --- a/mergetools/tortoisemerge +++ b/mergetools/tortoisemerge @@ -6,9 +6,17 @@ merge_cmd () { if $base_present then touch "$BACKUP" - "$merge_tool_path" \ - -base:"$BASE" -mine:"$LOCAL" \ - -theirs:"$REMOTE" -merged:"$MERGED" + 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 -- cgit v1.2.3