Subject: Re: Enhancing --show-function and --function-context in default configurations

From: Junio C Hamano <[email-masked]>
Date: Mon, 02 Aug 2021 10:06:53 -0700

Jeff King <[email-masked]> writes:

> On Mon, Aug 02, 2021 at 10:45:25AM +0200, Ævar Arnfjörð Bjarmason wrote:
>
>> I would like to see us have a setting to turn these on by default, but
>> think it would be better to make that a diff.* config setting to put
>> into ~/.gitconfig, i.e. we'd extend git itself to know about a list of
>> extensions for the given userdiff drivers, and use them when rendering
>> diffs.
>
> A long time ago we discussed doing this. The relevant thread is:
>
>   https://lore.kernel.org/git/[email-masked]/
>
> which references a few others:
>
>   https://lore.kernel.org/git/[email-masked]/
>
>   https://lore.kernel.org/git/[email-masked]/
> ...

Thanks for pointers.

One good suggestion given there was to use diff=c and diff=perl in
our own .gitattributes to use the patterns ourselves, which we seem
to have been doing just fine ;-)

As long as the default built-in ones are

 (1) at least 90% of the time improvement over, or at least is not
     broken compared to, the unconfigured case, and

 (2) at the lowest priority that users can easily countermand for
     the rest 10% cases

I do not think it is too bad to resurrect the old patches from these
threads.

Thanks.