Re: [PATCH] mergetools: Add tortoisegitmerge helper
- From
David Aguilar <davvid@gmail.com>
- Date
- Jan 25, 2013, 07:54 UTC
- Message-ID
- <CAJDDKr4oerSq16rYt2iKNtQNK79L+jOiKROhEW_yiBPKjkVhuQ@mail.gmail.com>
- In-Reply-To
- <7vvcal683y.fsf@alter.siamese.dyndns.org>
On Thu, Jan 24, 2013 at 11:21 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 35 quoted lines
> David Aguilar <davvid@gmail.com> writes:
>>>>> 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 had a similar discussion here:
>
> http://thread.gmane.org/gmane.comp.version-control.git/201913/focus=201976
>
> and Documentation/git-{diff,merge}tool.txt have stayed quiet since
> then.
>
> But Documentation/merge-config.txt tries to list everything that _could_
> be enabled, and I do not necessarily think having one single
> location that lists everything is such a bad idea.
>
> Is there a way for me to programatically tell what merge.tool and
> diff.tool could be enabled for a particular source checkout of Git
> regardless of what platform am I on (that is, even though I won't
> touch Windows, I want to see 'tortoise' appear in the output of such
> a procedure)? We could generate a small text file from the Makefile
> in Documentation and include it when building the manual pages if
> such a procedure is available.That's a good idea. Here's one way... (typed into gmail, so probably broken)
LF=' ' mergetools= difftools= scriptlets="$(git --exec-path)"/mergetools
for script in "$scriptlets"/*
do
tool="$(basename "$script")"
if test "$tool" = "defaults"
then
continue
fi
. "$scriptlets"/defaults
can_diff && difftools="$difftools$tool$LF"
can_merge && mergetools="$mergetools$tool$LF"
doneI can follow up with a Documentation patch along these lines. I'm would imagine it would be hooked up similarly to how the command lists are constructed.
This should allow the tortoisemerge improvements to happen independently.
-- David