[PATCH] mergetools: Enable tortoisemerge to handle filenames with
- From
- Sven Strickroth <sven.strickroth@tu-clausthal.de>
- Date
- Feb 1, 2013, 19:33 UTC
- Message-ID
- <510C1872.3090304@tu-clausthal.de>
- In-Reply-To
- <7vzjzuwm7s.fsf@alter.siamese.dyndns.org>
spaces with TortoiseGitMerge
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. Both do not have a fully posix compatible cli parameter parser, however, TortoiseGitMerge was modified in order to handle filenames with spaces correctly. The "-key value" form was choosen because this way no escaping for quotes within quotes is necessary; 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 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge index 8476afa..3b89f1c 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
-- Best regards, Sven Strickroth PGP key id F5A9D4C4 @ any key-server