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

Re: Trying to use xfuncname without success.

From
JZJack Adrian Zappa <adrianh.bsc@gmail.com>
Date
Feb 8, 2017, 20:39 UTC
Message-ID
<CAKepmagpq-40JVOSHb=a51CjQtM=iCzd1D3KAH3q0gV9NuJMfA@mail.gmail.com>
In-Reply-To
<1aa20b4e-782f-a650-eab8-51218b838337@web.de>
> I'm not so sure about that.  With your example I get this diff without
setting diff.natvis.xfuncname:

So, to make sure we are on the same page, I removed the diff.natvis.xfuncname from the .gitconfig and .git/config. My output was:

C:\Users\adrianh\Documents\tmp>git diff
diff --git a/test.natvis b/test.natvis
index 93fd5b4..351301f 100644
--- a/test.natvis
+++ b/test.natvis
@@ -18,6 +18,7 @@


          <!-- test text -->
+         <Item Name="added var">added_var</Item>


       <Item Name="var2">var2</Item>

So I didn't get the default output that your specified.

I've been modifying the .gitconfig file directly, but I tried your command:

git config diff.natvis.xfuncname "^[\t ]*<Type[\t ]+Name=\"([^\"]+)\".*$"

and still had the same results.  I.e. NOTHING. :(

On Wed, Feb 8, 2017 at 1:37 PM, René Scharfe <l.s.r@web.de> wrote:
> Am 08.02.2017 um 18:11 schrieb Jack Adrian Zappa:
>> Thanks Rene, but you seem to have missed the point.  NOTHING is
>> working.  No matter what I put there, it doesn't seem to get matched.
>
> I'm not so sure about that.  With your example I get this diff without
> setting diff.natvis.xfuncname:
>
> diff --git a/a.natvis b/a.natvis
> index 7f9bdf5..bc3c090 100644
> --- a/a.natvis
> +++ b/a.natvis
> @@ -19,7 +19,7 @@ xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
>
>
>        <!-- Non-blank line -->
> -      <Item Name="added var">added_var</Item>
> +      <Item Name="added var">added_vars</Item>
>
>
>        <Item Name="var2">var2</Item>
>
> Note the XML namespace in the hunk header.  It's put there by the
> default rule because "xmlns" starts at the beginning of the line.  Your
> diff has nothing there, which means the default rule is not used, i.e.
> your user-defined rule is in effect.
>
> Come to think of it, this line break in the middle of the AutoVisualizer
> tab might have been added by your email client unintentionally, so that
> we use different test files, which then of course results in different
> diffs.  Is that the case?
>
> Anyway, if I run the following two commands:
>
> $ git config diff.natvis.xfuncname "^[\t ]*<Type[\t ]+Name=\"([^\"]+)\".*$"
> $ echo '*.natvis diff=natvis' >.gitattributes
>
> ... then I get this, both on Linux (git version 2.11.1) and on Windows
> (git version 2.11.1.windows.1):
>
> diff --git a/a.natvis b/a.natvis
> index 7f9bdf5..bc3c090 100644
> --- a/a.natvis
> +++ b/a.natvis
> @@ -19,7 +19,7 @@ test
>
>
>        <!-- Non-blank line -->
> -      <Item Name="added var">added_var</Item>
> +      <Item Name="added var">added_vars</Item>
>
>
>        <Item Name="var2">var2</Item>
>
>> Just to be sure, I tested your regex and again it didn't work.
>
> At this point I'm out of ideas, sorry. :(  The only way I was able to
> break it was due to mistyping the extension as "netvis" several times
> for some reason.
>
> René
Previous: Jack Adrian ZappaNext: Jack Adrian Zappa
Message 9 of 14 in “Trying to use xfuncname without success.”
  1. Jack Adrian ZappaFeb 7, 2017
  2. René ScharfeFeb 7, 2017
  3. Jack Adrian ZappaFeb 8, 2017
  4. René ScharfeFeb 8, 2017
  5. Samuel LijinFeb 8, 2017
  6. Jack Adrian ZappaFeb 8, 2017
  7. Samuel LijinFeb 8, 2017
  8. Jack Adrian ZappaFeb 8, 2017
  9. Jack Adrian ZappaFeb 8, 2017
  10. Jack Adrian ZappaFeb 8, 2017
  11. Jack Adrian ZappaFeb 9, 2017
  12. Jack Adrian ZappaFeb 9, 2017
  13. Jack Adrian ZappaFeb 9, 2017
  14. René ScharfeFeb 10, 2017

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.