{"thread":{"id":"31895","subject":"diff support for the Eiffel language?","startedAt":"2012-10-22T11:58:00Z","lastAt":"2012-11-27T11:16:18Z","messageCount":4,"participants":["Ulrich Windl","Ævar Arnfjörð Bjarmason","Johannes Sixt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"201685","messageId":"508550E8020000A10000CF36@gwsmtp1.uni-regensburg.de","threadId":"31895","inReplyTo":null,"subject":"diff support for the Eiffel language?","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2012-10-22T11:58:00Z","receivedAt":"2012-10-22T11:58:00Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":"Hi!\n\nAfter a longer pause, I did some programming in Eiffel again, and while doing so, why not use Git? It works!\n\nHowever there's one little thing I noticed with \"git diff\":\nThe 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).\n\nFor the non-Eiffelists:\n\nEiffel has a class structure like this:\nclass FOO\n\nfeature {BAR} -- This is a \"feature clause\", grouping related features (attributes/routines)\n\n   baz (x,y : INTEGER) : STRING is\n      -- blabla...\n      do\n         ...\n      end -- baz\n\nend -- class FOO\n\n---\nNow if I change something inside \"baz\", it would be nice if the @@-contect line would show \"baz\" (or more) instead of \"feature {BAR}...\".\n\nRegards,\nUlrich\nP.S. Apologies if the feature requested had been added already.\n"},{"id":"201687","messageId":"CACBZZX4wF8C_9ok+zeTfO70BgZXufvQaJ+8B5EiOAmxvVwr54g@mail.gmail.com","threadId":"31895","inReplyTo":"508550E8020000A10000CF36@gwsmtp1.uni-regensburg.de","subject":"Re: diff support for the Eiffel language?","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2012-10-22T13:06:26Z","receivedAt":"2012-10-22T13:06:26Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Oct 22, 2012 at 1:58 PM, Ulrich Windl\n<Ulrich.Windl@rz.uni-regensburg.de> wrote:\n> However there's one little thing I noticed with \"git diff\":\n> 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).\n\nSee git.git's e90d065 for an example of adding a new diff pattern.\n\nYou could easily come up with a patch and send it to the list, however\nit would probably be good to CC some Eiffel language list in case\nthere's some syntax oddities you've missed.\n"},{"id":"201689","messageId":"50854B90.50807@viscovery.net","threadId":"31895","inReplyTo":"CACBZZX4wF8C_9ok+zeTfO70BgZXufvQaJ+8B5EiOAmxvVwr54g@mail.gmail.com","subject":"Re: diff support for the Eiffel language?","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-10-22T13:35:12Z","receivedAt":"2012-10-22T13:35:12Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 10/22/2012 15:06, schrieb Ævar Arnfjörð Bjarmason:\n> On Mon, Oct 22, 2012 at 1:58 PM, Ulrich Windl \n> <Ulrich.Windl@rz.uni-regensburg.de> wrote:\n>> However there's one little thing I noticed with \"git diff\": The\n>> conte4xt lines (staring with \"@@\") show the current function (in Perl\n>> and C), but they show the current \"feature clause\" in Eiffel (as\n>> opposed to the expected current feature). I wonder how hard it is to\n>> fix it (Observed in git 1.7.7 of openSUSE 12.1).\n> \n> See git.git's e90d065 for an example of adding a new diff pattern.\n\nIt's not necessary to wait until there is built-in support for a new language.\n\nFor example, for Windows resource files, I have\n\n*.rc    diff=winres\n\nin .gitattributes or .git/info/attributes and\n\n[diff \"winres\"]\n        xfuncname =\n\"!^(BEGIN|END|FONT|CAPTION|STYLE)\\n^[a-zA-Z_][a-zA-Z_0-9]*.*\\n^[[:space:]]*([[:alnum:]_]+,\n*DIALOG.*)\"\n\nin .git/config (the xfuncname is all on a single line). The first part\nbeginning at ! up to \\n tells to ignore the specified matches. The other\nparts separated by \\n tell the things to put in the hunk header. You can\nhave \"ignore\" parts (with exlamation mark) and \"take this\" parts (without)\nin any order that is convenient, as long as the last one is \"take this\".\n\n-- Hannes\n"},{"id":"203986","messageId":"50B4AF12020000A10000DA1F@gwsmtp1.uni-regensburg.de","threadId":"31895","inReplyTo":"50854B90.50807@viscovery.net","subject":"Antw: Re: diff support for the Eiffel language?","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2012-11-27T11:16:18Z","receivedAt":"2012-11-27T11:16:18Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":"Hi!\n\nI managed to have some success, although it's not perfect. Unfortunately the\nEiffel grammar does not allow a 100% solution. Example:\n\n---\nlocal\n  x : BOOLEAN\n---\ndeclares a local variable named `x', while\n\n---\n  x : BOOLEAN\n   do ... end\n---\n\nDeclares a function named `x'. Formal generic parameters like `x :\nARRAY[ARRAY[STRING]]' make things more complicate. Anyway, here's my solution\n(probably incomplete):\n---\n% git config --local -e\n[diff \"Eiffel\"]\nxfuncname =\n\"!^[[:space:]]*(check|class|[Cc]reate|else|elseif|end|ensure|do|!|feature|from|indexing|inherit|is|local|loop|note|require|then|until)[[:space:]]*\\n\\\n^[[:space:]]*(class[[:space:]]*[[:alpha:]_][[:alnum:]_]*)\\n\\\n^[[:space:]]*([[:alpha:]_][[:alnum:]_]*[[:space:]]*\\\\([^(\\\")]+:[^(\\\")]+\\\\)[[:space:]]*:[[:space:]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*[^[:space:]\\\"]?[^\\\"=]*)[[:space:]]*$\\n\\\n\n^[[:space:]]*([[:alpha:]_][[:alnum:]_]*[[:space:]]*\\\\([^(\\\")]+:[^(\\\")]+\\\\))[[:space:]]*$\\n\\\n\n^[[:space:]]*([[:alpha:]_][[:alnum:]_]*[[:space:]]*:[[:space:]*[[:alpha:]_][[:alnum:]_]*[[:space:]]*[^[:space:]\\\"]?[^\\\"=]*)[[:space:]]*$\\n\\\n^[[:space:]]*([[:alpha:]_][[:alnum:]_]*)[[:space:]]*$\"\n% cat .git/info/attributes\n*.e\tdiff=Eiffel\n---\n\nRegards,\nUlrich\n\n>>> Johannes Sixt <j.sixt@viscovery.net> schrieb am 22.10.2012 um 15:35 in\nNachricht <50854B90.50807@viscovery.net>:\n> Am 10/22/2012 15:06, schrieb Ævar Arnfjörð Bjarmason:\n> > On Mon, Oct 22, 2012 at 1:58 PM, Ulrich Windl \n> > <Ulrich.Windl@rz.uni-regensburg.de> wrote:\n> >> However there's one little thing I noticed with \"git diff\": The\n> >> conte4xt lines (staring with \"@@\") show the current function (in Perl\n> >> and C), but they show the current \"feature clause\" in Eiffel (as\n> >> opposed to the expected current feature). I wonder how hard it is to\n> >> fix it (Observed in git 1.7.7 of openSUSE 12.1).\n> > \n> > See git.git's e90d065 for an example of adding a new diff pattern.\n> \n> It's not necessary to wait until there is built-in support for a new \n> language.\n> \n> For example, for Windows resource files, I have\n> \n> *.rc    diff=winres\n> \n> in .gitattributes or .git/info/attributes and\n> \n> [diff \"winres\"]\n>         xfuncname =\n>\n\"!^(BEGIN|END|FONT|CAPTION|STYLE)\\n^[a-zA-Z_][a-zA-Z_0-9]*.*\\n^[[:space:]]*(\n> [[:alnum:]_]+,\n> *DIALOG.*)\"\n> \n> in .git/config (the xfuncname is all on a single line). The first part\n> beginning at ! up to \\n tells to ignore the specified matches. The other\n> parts separated by \\n tell the things to put in the hunk header. You can\n> have \"ignore\" parts (with exlamation mark) and \"take this\" parts (without)\n> in any order that is convenient, as long as the last one is \"take this\".\n> \n> -- Hannes\n> \n\n \n \n"}]}