git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: diff support for the Eiffel language?

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Oct 22, 2012, 13:35 UTC
Message-ID
<50854B90.50807@viscovery.net>
In-Reply-To
<CACBZZX4wF8C_9ok+zeTfO70BgZXufvQaJ+8B5EiOAmxvVwr54g@mail.gmail.com>
Am 10/22/2012 15:06, schrieb Ævar Arnfjörð Bjarmason:
Show 9 quoted lines
> On Mon, Oct 22, 2012 at 1:58 PM, Ulrich Windl 
> <Ulrich.Windl@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 =
"!^(BEGIN|END|FONT|CAPTION|STYLE)\n^[a-zA-Z_][a-zA-Z_0-9]*.*\n^[[:space:]]*([[: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
Previous: Ævar Arnfjörð BjarmasonNext: Ulrich Windl
Message 3 of 4 in “diff support for the Eiffel language?”
  1. Ulrich WindlOct 22, 2012
  2. Ævar Arnfjörð BjarmasonOct 22, 2012
  3. Johannes SixtOct 22, 2012
  4. Antw: Re: diff support for the Eiffel language?Ulrich Windl, Nov 27, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.