Johannes Schindelin <[email protected]> writes:
> Hi Junio,
>
> On Wed, 23 Nov 2016, Junio C Hamano wrote:
>
>> Junio C Hamano <[email protected]> writes:
>>
>> > Can't you route the control upon seeing "git difftool" to your
>> > experimental "C" difftool and check the configuration there? Then
>> > you can decide to run_command() a non-builtin one depending what the
>> > configuration says---that way, you would incur cost of spawning Perl
>> > only when you need it, no?
>>
>> FWIW, the approach taken by 73c2779f42 ("builtin-am: implement
>> skeletal builtin am", 2015-08-04) is what I had in mind when I wrote
>> the above.
>
> Maybe that worked back then. But I doubt it, because checking out that
> revision, I get this "warning":
>
> Makefile:1732: warning: overriding recipe for target 'git-am'
> Makefile:1696: warning: ignoring old recipe for target 'git-am'
>
> Seems like a matter of luck whether the `make` executable you happen to
> use guesses what we want: to munge git-am.sh into git-am, as opposed to
> hard-linking git to git-am.
You do not need to keep two copies of "git-cmd", though. commands[]
table can have an entry "difftool" that points at cmd_difftool(),
which switches between run_command("difftool-scripted") or makes a
function call to a static difftool_builtin() that you wrote in 1/2.