I managed to have some success, although it's not perfect. Unfortunately the
Eiffel grammar does not allow a 100% solution. Example:

declares a local variable named `x', while

   do ... end

Declares a function named `x'. Formal generic parameters like `x :
ARRAY[ARRAY[STRING]]' make things more complicate. Anyway, here's my solution
(probably incomplete):
% git config --local -e
[diff "Eiffel"]
xfuncname =


% cat .git/info/attributes
*.e     diff=Eiffel


>>> Johannes Sixt <j.s...@viscovery.net> schrieb am 22.10.2012 um 15:35 in
Nachricht <50854b90.50...@viscovery.net>:
> Am 10/22/2012 15:06, schrieb Ævar Arnfjörð Bjarmason:
> > On Mon, Oct 22, 2012 at 1:58 PM, Ulrich Windl 
> > <ulrich.wi...@rz.uni-regensburg.de> wrote:
> >> However there's one little thing I noticed with "git diff": The
> >> conte4xt lines (staring with "@@") show the current function (in Perl
> >> and C), but they show the current "feature clause" in Eiffel (as
> >> opposed to the expected current feature). I wonder how hard it is to
> >> fix it (Observed in git 1.7.7 of openSUSE 12.1).
> > 
> > See git.git's e90d065 for an example of adding a new diff pattern.
> It's not necessary to wait until there is built-in support for a new 
> language.
> For example, for Windows resource files, I have
> *.rc    diff=winres
> in .gitattributes or .git/info/attributes and
> [diff "winres"]
>         xfuncname =
> [[:alnum:]_]+,
> *DIALOG.*)"
> in .git/config (the xfuncname is all on a single line). The first part
> beginning at ! up to \n tells to ignore the specified matches. The other
> parts separated by \n tell the things to put in the hunk header. You can
> have "ignore" parts (with exlamation mark) and "take this" parts (without)
> in any order that is convenient, as long as the last one is "take this".
> -- Hannes

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to