Re: [PATCH] mergetools: Enhance tortoisemerge to work with
- From
David Aguilar <davvid@gmail.com>
- Date
- Jan 25, 2013, 10:09 UTC
- Message-ID
- <CAJDDKr7eNyJp1ffBYEJaZkmnVWqd0AMpnm1kdjnrrhPtuGNL_w@mail.gmail.com>
- In-Reply-To
- <51024B02.9020400@tu-clausthal.de>
On Fri, Jan 25, 2013 at 1:06 AM, Sven Strickroth <sven.strickroth@tu-clausthal.de> wrote:
Show 28 quoted lines
> 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 | 24 ++++++++++++++++++++----
> 1 file changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/mergetools/tortoisemerge b/mergetools/tortoisemerge
> index ed7db49..9890737 100644
> --- a/mergetools/tortoisemerge
> +++ b/mergetools/tortoisemerge
> @@ -6,12 +6,28 @@ merge_cmd () {
> if $base_present
> then
> touch "$BACKUP"
> - "$merge_tool_path" \
> - -base:"$BASE" -mine:"$LOCAL" \
> - -theirs:"$REMOTE" -merged:"$MERGED"
> + if test "$merge_tool_path" == "tortoisegitmerge"I like the approach this is taking. Thank you. I have one small note:
I think this should use "=" instead of "==" here.
It might also make sense to wrap a basename call around it so that users can set their own mergetool.tortoisemerge.path
basename="$(basename "$merge_tool_path" .exe)" if test "$basename" = "tortoisegitmerge" ...
Show 29 quoted lines
> + 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 "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
> +}
> --
> Best regards,
> Sven Strickroth
> PGP key id F5A9D4C4 @ any key-server-- David