Re: [PATCH] mergetools: Add tortoisegitmerge helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 24, 2013 at 2:15 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Sven Strickroth <sven.strickroth@xxxxxxxxxxxxxxx> writes:
>
>> Am 24.01.2013 20:51 schrieb Junio C Hamano:
>>> Sven Strickroth <sven.strickroth@xxxxxxxxxxxxxxx> writes:
>>>
>>>> - 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 and prevent confusion with the TortoiseSVN TortoiseMerge
>>>>   version.
>>>
>>> Wouldn't it make more sense in such a situation if your users can
>>> keep using the old "tortoisemerge" configured in their configuration
>>> and when the renamed one is found the mergetool automatically used
>>> it, rather than the way your patch is done?
>>
>> That was also my first idea, however, TortoiseMerge uses parameters as
>> follows: '-base:"$BASE"'. TortoiseGitMerge uses values separated by
>> space from keys: '-base "$BASE"'. So both are incompatible (the first
>> approach has problems with spaces in filenames, the TortoiseGitMerge
>> approach fixes this).
>
> OK.  Please unconfuse future readers of "git log" by saying why such
> a unification does not work in the proposed log message.

Even though the old tortoisemerge and the new tortoisegitmerge
have completely different syntax, could we still use the existence
of one when deciding which syntax to use?

pseudo-code at the top of the scriptlet:

if test -z "$tortoisegitmerge"
then
    if type tortoisegitmerge 2>&1 >/dev/null
    then
        tortoisegitmerge=true
    else
        tortoisegitmerge=false
    fi
fi

...and then later merge_cmd and diff_cmd
can delegate to {diff,merge}_cmd_legacy() and
{diff,merge}_cmd_gitmerge() functions to do the work.

It's just a thought.  translate_merge_tool_path()
is too low-level to do it, but it seems like we could
get away with it by having some extra smarts in the
scriptlet.

>>>> diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt
>>>> index 4314ad0..13cbe5b 100644
>>>> --- a/Documentation/diff-config.txt
>>>> +++ b/Documentation/diff-config.txt
>>>> @@ -151,7 +151,7 @@ diff.<driver>.cachetextconv::
>>>>  diff.tool::
>>>>     The diff tool to be used by linkgit:git-difftool[1].  This
>>>>     option overrides `merge.tool`, and has the same valid built-in
>>>> -   values as `merge.tool` minus "tortoisemerge" and plus
>>>> -   "kompare".  Any other value is treated as a custom diff tool,
>>>> +   values as `merge.tool` minus "tortoisemerge"/"tortoisegitmerge" and
>>>> +   plus "kompare".  Any other value is treated as a custom diff tool,
>>>>     and there must be a corresponding `difftool.<tool>.cmd`
>>>>     option.
>>>
>>> So in short, two tortoises and kompare are only valid as mergetool
>>> but cannot be used as difftool?  No, I am reading it wrong.
>>> merge.tool can be used for both, kompare can be used as difftool,
>>> and two tortoises can only be used as mergetool.
>>>
>>> This paragraph needs to be rewritten to unconfuse readers.  The
>>> original is barely intelligible, and it becomes unreadable as the
>>> set of tools subtracted by "minus" and added by "plus" grows.
>>
>> But I think this should not be part of this patch.
>
> I agree that it can be done (and it is better to be done) as a
> preparatory step.  The current text is barely readable, but with
> this patch there will be two "minus", and the result becomes
> unreadable at that point.
>
> It also could be done as a follow-up documentation readability fix.

Another thought would be to minimize this section as much
as possible and point users to "git difftool --tool-help".

We can then improve --tool-help (there are already preliminary
patches in-flight to do so) so that we do not have to maintain
this documentation in the future.

Likewise, if we are able to teach the scriptlet to choose
the best one (and not require a new scriptlet) then this
section could be left as-is for this patch.
-- 
David
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]