Re: [PATCH] mergetools: Enhance tortoisemerge to work with
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 25, 2013, 18:28 UTC
- Message-ID
- <7v622l5d87.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <5102837C.9000608@tu-clausthal.de>
Sven Strickroth <sven.strickroth@tu-clausthal.de> writes:
> TortoiseGitMerge and filenames with spaces
??? ECANNOTPARSE.
... ah, wait. Is this a broken-off tail of your subject line?
It may be a sign that you are doing too many unrelated things in a single patch when your subject does not fit on a single line.
Perhaps this is better done as a two-patch series?
* mergetools: fix tortoisemerge support for pathnames with SP * mergetools: support tortoisegitmerge
Show 43 quoted lines
> 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"Hmph.
How was the support for "names with spaces" added in this new code? I do not spot what is different between this "else" clause and the original body of the merge_cmd (which only supported tortoisemerge).
They seem to be doing exactly the same thing.
Show 16 quoted lines
> + 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
> +}