git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Trying to use xfuncname without success.
@ 2017-02-07 19:21 Jack Adrian Zappa
  2017-02-07 23:18 ` René Scharfe
  0 siblings, 1 reply; 14+ messages in thread
From: Jack Adrian Zappa @ 2017-02-07 19:21 UTC (permalink / raw)
  To: git-mailing-list

I'm trying to specify a hunk header using xfuncname, and it just
doesn't want to work.

The full question is on SO here:

http://stackoverflow.com/questions/42078376/why-isnt-my-xfuncname-working-in-my-gitconfig-file

But the basic gist is that no matter what regex I specify, git will
not recognise the hunk header.  Am I doing something wrong or is this
a bug?

For those who don't want to jump to the SO site, I've copied the text below:

-----8<--------8<--------8<--------8<--------8<--------8<--------8<--------8<---

I'm trying to setup a hunk header for .natvis files. For some reason,
it doesn't seem to be working. I'm following their instructions from
here, which doesn't say much in terms of restrictions of the regex,
such as, is the matched item considered the hunk header or do I need a
group? I have tried both with no success. This is what I have:

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

I've also added to my .gitattributes file (even though I'm not
positive that it is necessary):

*.natvis diff=natvis

I've tried \t instead of \\\t as well as replacing the entire regex
with just <Type.* with no luck. I'm using git version 2.7.0.windows.1
on Windows 8.1. EDIT: I upgraded to git version 2.11.1.windows.1 on
Windows 8.1 and even tried git version 2.8.3 on cygwin64 on Windows
8.1 with the same results.

As a test file, I have the following test.natvis file:

<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer
xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">

  <Type Name="test">
    <Expand>
      <Item Name="var">var</Item>













      <!-- Non-blank line -->
      <Item Name="added var">added_var</Item>


      <Item Name="var2">var2</Item>
    </Expand>
  </Type>
</AutoVisualizer>

with the <Item Name="added var">added_var</Item> being the new line added.

I'm really not sure why this is so difficult.

EDIT:

Here is a sample output of what I am getting:

$ git diff --word-diff
diff --git a/test.natvis b/test.natvis
index 73c06bc..bc0f549 100644
--- a/test.natvis
+++ b/test.natvis
@@ -18,6 +18,7 @@


      <!-- Non-blank line -->
      {+<Item Name="added var">added_var</Item>+}


      <Item Name="var2">var2</Item>
warning: LF will be replaced by CRLF in test.natvis.
The file will have its original line endings in your working directory.

Even using xfuncname = "^.*$" I would have expected that <!--
Non-blank line --> would have shown up as my hunk header, but I get
nothing. :(

EDIT:

I've tried the solution proposed by torek, but to no avail. It's like
it doesn't know what to do with the xfuncname entry. :(

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-07 19:21 Trying to use xfuncname without success Jack Adrian Zappa
@ 2017-02-07 23:18 ` René Scharfe
  2017-02-08 17:11   ` Jack Adrian Zappa
  0 siblings, 1 reply; 14+ messages in thread
From: René Scharfe @ 2017-02-07 23:18 UTC (permalink / raw)
  To: Jack Adrian Zappa; +Cc: git-mailing-list

Am 07.02.2017 um 20:21 schrieb Jack Adrian Zappa:
> I'm trying to setup a hunk header for .natvis files. For some reason,
> it doesn't seem to be working. I'm following their instructions from
> here, which doesn't say much in terms of restrictions of the regex,
> such as, is the matched item considered the hunk header or do I need a
> group? I have tried both with no success. This is what I have:
>
> [diff "natvis"]
>     xfuncname = "^[\\\t ]*<Type[\\\t ]+Name=\"([^\"])\".*$"

The extra "\\" allow backslashes to be used for indentation as well as 
between Type and Name, which is probably not what you want.  And your 
expression only matches single-char Name attributes.  Try:

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

René

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-07 23:18 ` René Scharfe
@ 2017-02-08 17:11   ` Jack Adrian Zappa
  2017-02-08 18:37     ` René Scharfe
  0 siblings, 1 reply; 14+ messages in thread
From: Jack Adrian Zappa @ 2017-02-08 17:11 UTC (permalink / raw)
  To: René Scharfe; +Cc: git-mailing-list

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.

Just to be sure, I tested your regex and again it didn't work.

Someone on the SO site stated they could get it to work on FreeBSD and
I'm on Windows, so this might be a platform thing.  Can anyone else on
Windows please confirm?

Thanks,


A

On Tue, Feb 7, 2017 at 6:18 PM, René Scharfe <l.s.r@web.de> wrote:
> Am 07.02.2017 um 20:21 schrieb Jack Adrian Zappa:
>>
>> I'm trying to setup a hunk header for .natvis files. For some reason,
>> it doesn't seem to be working. I'm following their instructions from
>> here, which doesn't say much in terms of restrictions of the regex,
>> such as, is the matched item considered the hunk header or do I need a
>> group? I have tried both with no success. This is what I have:
>>
>> [diff "natvis"]
>>     xfuncname = "^[\\\t ]*<Type[\\\t ]+Name=\"([^\"])\".*$"
>
>
> The extra "\\" allow backslashes to be used for indentation as well as
> between Type and Name, which is probably not what you want.  And your
> expression only matches single-char Name attributes.  Try:
>
>         xfuncname = "^[\t ]*<Type[\t ]+Name=\"([^\"]+)\".*$"
>
> René

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-08 17:11   ` Jack Adrian Zappa
@ 2017-02-08 18:37     ` René Scharfe
  2017-02-08 20:24       ` Samuel Lijin
  2017-02-08 20:39       ` Jack Adrian Zappa
  0 siblings, 2 replies; 14+ messages in thread
From: René Scharfe @ 2017-02-08 18:37 UTC (permalink / raw)
  To: Jack Adrian Zappa; +Cc: git-mailing-list

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é

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-08 18:37     ` René Scharfe
@ 2017-02-08 20:24       ` Samuel Lijin
  2017-02-08 20:42         ` Jack Adrian Zappa
  2017-02-08 20:39       ` Jack Adrian Zappa
  1 sibling, 1 reply; 14+ messages in thread
From: Samuel Lijin @ 2017-02-08 20:24 UTC (permalink / raw)
  To: René Scharfe; +Cc: Jack Adrian Zappa, git-mailing-list

On Windows 7, it works for me in both CMD and Git Bash:

$ git --version
git version 2.11.0.windows.3

$ git diff HEAD^ --word-diff
diff --git a/test.natvis b/test.natvis
index 93396ad..1233b8c 100644
--- a/test.natvis
+++ b/test.natvis
@@ -18,6 +18,7 @@ test


      <!-- Non-blank line -->
      {+<Item Name="added var">added_var</Item>+}


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

On Wed, Feb 8, 2017 at 12: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é

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-08 18:37     ` René Scharfe
  2017-02-08 20:24       ` Samuel Lijin
@ 2017-02-08 20:39       ` Jack Adrian Zappa
  1 sibling, 0 replies; 14+ messages in thread
From: Jack Adrian Zappa @ 2017-02-08 20:39 UTC (permalink / raw)
  To: René Scharfe; +Cc: git-mailing-list

> 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é

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-08 20:24       ` Samuel Lijin
@ 2017-02-08 20:42         ` Jack Adrian Zappa
  2017-02-08 20:46           ` Samuel Lijin
  0 siblings, 1 reply; 14+ messages in thread
From: Jack Adrian Zappa @ 2017-02-08 20:42 UTC (permalink / raw)
  To: Samuel Lijin; +Cc: René Scharfe, git-mailing-list

Thanks Samuel,

So, the question is, what is causing this problem on my system?

Anyone have an idea to help diagnose this problem?

On Wed, Feb 8, 2017 at 3:24 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
> On Windows 7, it works for me in both CMD and Git Bash:
>
> $ git --version
> git version 2.11.0.windows.3
>
> $ git diff HEAD^ --word-diff
> diff --git a/test.natvis b/test.natvis
> index 93396ad..1233b8c 100644
> --- a/test.natvis
> +++ b/test.natvis
> @@ -18,6 +18,7 @@ test
>
>
>       <!-- Non-blank line -->
>       {+<Item Name="added var">added_var</Item>+}
>
>
>       <Item Name="var2">var2</Item>
>
> On Wed, Feb 8, 2017 at 12: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é

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-08 20:42         ` Jack Adrian Zappa
@ 2017-02-08 20:46           ` Samuel Lijin
  2017-02-08 21:03             ` Jack Adrian Zappa
       [not found]             ` <CAKepmai3fBZMS2dXaJyvnP36LooLh8yjn1T6vGG=Pi1B1LMaCQ@mail.gmail.com>
  0 siblings, 2 replies; 14+ messages in thread
From: Samuel Lijin @ 2017-02-08 20:46 UTC (permalink / raw)
  To: Jack Adrian Zappa; +Cc: René Scharfe, git-mailing-list

I just put this togther: https://github.com/sxlijin/xfuncname-test

Try cloning and then for any of config1 thru 3,

$ cp configX .git/config
$ git diff HEAD^ -- test.natvis

On Wed, Feb 8, 2017 at 2:42 PM, Jack Adrian Zappa <adrianh.bsc@gmail.com> wrote:
> Thanks Samuel,
>
> So, the question is, what is causing this problem on my system?
>
> Anyone have an idea to help diagnose this problem?
>
> On Wed, Feb 8, 2017 at 3:24 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>> On Windows 7, it works for me in both CMD and Git Bash:
>>
>> $ git --version
>> git version 2.11.0.windows.3
>>
>> $ git diff HEAD^ --word-diff
>> diff --git a/test.natvis b/test.natvis
>> index 93396ad..1233b8c 100644
>> --- a/test.natvis
>> +++ b/test.natvis
>> @@ -18,6 +18,7 @@ test
>>
>>
>>       <!-- Non-blank line -->
>>       {+<Item Name="added var">added_var</Item>+}
>>
>>
>>       <Item Name="var2">var2</Item>
>>
>> On Wed, Feb 8, 2017 at 12: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é

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-08 20:46           ` Samuel Lijin
@ 2017-02-08 21:03             ` Jack Adrian Zappa
       [not found]             ` <CAKepmai3fBZMS2dXaJyvnP36LooLh8yjn1T6vGG=Pi1B1LMaCQ@mail.gmail.com>
  1 sibling, 0 replies; 14+ messages in thread
From: Jack Adrian Zappa @ 2017-02-08 21:03 UTC (permalink / raw)
  To: Samuel Lijin; +Cc: René Scharfe, git-mailing-list

Thanks Samuel,

That example showed that there must be something wrong in my .git
directory, because with it, I'm getting the correct output.  Moving
the same lines to my .git/config didn't work.

On Wed, Feb 8, 2017 at 3:46 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
> I just put this togther: https://github.com/sxlijin/xfuncname-test
>
> Try cloning and then for any of config1 thru 3,
>
> $ cp configX .git/config
> $ git diff HEAD^ -- test.natvis
>
> On Wed, Feb 8, 2017 at 2:42 PM, Jack Adrian Zappa <adrianh.bsc@gmail.com> wrote:
>> Thanks Samuel,
>>
>> So, the question is, what is causing this problem on my system?
>>
>> Anyone have an idea to help diagnose this problem?
>>
>> On Wed, Feb 8, 2017 at 3:24 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>>> On Windows 7, it works for me in both CMD and Git Bash:
>>>
>>> $ git --version
>>> git version 2.11.0.windows.3
>>>
>>> $ git diff HEAD^ --word-diff
>>> diff --git a/test.natvis b/test.natvis
>>> index 93396ad..1233b8c 100644
>>> --- a/test.natvis
>>> +++ b/test.natvis
>>> @@ -18,6 +18,7 @@ test
>>>
>>>
>>>       <!-- Non-blank line -->
>>>       {+<Item Name="added var">added_var</Item>+}
>>>
>>>
>>>       <Item Name="var2">var2</Item>
>>>
>>> On Wed, Feb 8, 2017 at 12: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é

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
       [not found]               ` <CAJZjrdUcxe_K91CQXz_TgGHgXMsKaddwG5+JEWJ53pv5_GO1zw@mail.gmail.com>
@ 2017-02-08 21:12                 ` Jack Adrian Zappa
  2017-02-09  0:00                   ` Jack Adrian Zappa
  0 siblings, 1 reply; 14+ messages in thread
From: Jack Adrian Zappa @ 2017-02-08 21:12 UTC (permalink / raw)
  To: Samuel Lijin; +Cc: git-mailing-list

That was it.  I have a .gitattributes file in my home directory.
Ahhh, but it's not in my %userprofile% directory, but in my ~
directory.

A bit confusing having 2 home directories.  I made a link to my
.gitconfig, but forgot to make a link to my .gitattributes.

Thanks.


A

On Wed, Feb 8, 2017 at 4:05 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
> Double check .gitattributes?
>
> On Feb 8, 2017 2:58 PM, "Jack Adrian Zappa" <adrianh.bsc@gmail.com> wrote:
>>
>> Thanks Samuel,
>>
>> That example showed that there must be something wrong in my .git
>> directory, because with it, I'm getting the correct output.  Moving
>> the same lines to my .git/config didn't work.
>>
>> On Wed, Feb 8, 2017 at 3:46 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>> > I just put this togther: https://github.com/sxlijin/xfuncname-test
>> >
>> > Try cloning and then for any of config1 thru 3,
>> >
>> > $ cp configX .git/config
>> > $ git diff HEAD^ -- test.natvis
>> >
>> > On Wed, Feb 8, 2017 at 2:42 PM, Jack Adrian Zappa
>> > <adrianh.bsc@gmail.com> wrote:
>> >> Thanks Samuel,
>> >>
>> >> So, the question is, what is causing this problem on my system?
>> >>
>> >> Anyone have an idea to help diagnose this problem?
>> >>
>> >> On Wed, Feb 8, 2017 at 3:24 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>> >>> On Windows 7, it works for me in both CMD and Git Bash:
>> >>>
>> >>> $ git --version
>> >>> git version 2.11.0.windows.3
>> >>>
>> >>> $ git diff HEAD^ --word-diff
>> >>> diff --git a/test.natvis b/test.natvis
>> >>> index 93396ad..1233b8c 100644
>> >>> --- a/test.natvis
>> >>> +++ b/test.natvis
>> >>> @@ -18,6 +18,7 @@ test
>> >>>
>> >>>
>> >>>       <!-- Non-blank line -->
>> >>>       {+<Item Name="added var">added_var</Item>+}
>> >>>
>> >>>
>> >>>       <Item Name="var2">var2</Item>
>> >>>
>> >>> On Wed, Feb 8, 2017 at 12: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é

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-08 21:12                 ` Jack Adrian Zappa
@ 2017-02-09  0:00                   ` Jack Adrian Zappa
  2017-02-09  0:01                     ` Jack Adrian Zappa
  0 siblings, 1 reply; 14+ messages in thread
From: Jack Adrian Zappa @ 2017-02-09  0:00 UTC (permalink / raw)
  Cc: git-mailing-list

Well, it mostly works, but I'm getting some weirdness where it has
grabbed a line at 126 and is using that for the hunk header.  Strange
thing is, I move the file to another repository, commit it, make a
change to the fileand do a diff, and it gets the correct hunk header.

I'm at a loss. :(

On Wed, Feb 8, 2017 at 4:12 PM, Jack Adrian Zappa <adrianh.bsc@gmail.com> wrote:
> That was it.  I have a .gitattributes file in my home directory.
> Ahhh, but it's not in my %userprofile% directory, but in my ~
> directory.
>
> A bit confusing having 2 home directories.  I made a link to my
> .gitconfig, but forgot to make a link to my .gitattributes.
>
> Thanks.
>
>
> A
>
> On Wed, Feb 8, 2017 at 4:05 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>> Double check .gitattributes?
>>
>> On Feb 8, 2017 2:58 PM, "Jack Adrian Zappa" <adrianh.bsc@gmail.com> wrote:
>>>
>>> Thanks Samuel,
>>>
>>> That example showed that there must be something wrong in my .git
>>> directory, because with it, I'm getting the correct output.  Moving
>>> the same lines to my .git/config didn't work.
>>>
>>> On Wed, Feb 8, 2017 at 3:46 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>>> > I just put this togther: https://github.com/sxlijin/xfuncname-test
>>> >
>>> > Try cloning and then for any of config1 thru 3,
>>> >
>>> > $ cp configX .git/config
>>> > $ git diff HEAD^ -- test.natvis
>>> >
>>> > On Wed, Feb 8, 2017 at 2:42 PM, Jack Adrian Zappa
>>> > <adrianh.bsc@gmail.com> wrote:
>>> >> Thanks Samuel,
>>> >>
>>> >> So, the question is, what is causing this problem on my system?
>>> >>
>>> >> Anyone have an idea to help diagnose this problem?
>>> >>
>>> >> On Wed, Feb 8, 2017 at 3:24 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>>> >>> On Windows 7, it works for me in both CMD and Git Bash:
>>> >>>
>>> >>> $ git --version
>>> >>> git version 2.11.0.windows.3
>>> >>>
>>> >>> $ git diff HEAD^ --word-diff
>>> >>> diff --git a/test.natvis b/test.natvis
>>> >>> index 93396ad..1233b8c 100644
>>> >>> --- a/test.natvis
>>> >>> +++ b/test.natvis
>>> >>> @@ -18,6 +18,7 @@ test
>>> >>>
>>> >>>
>>> >>>       <!-- Non-blank line -->
>>> >>>       {+<Item Name="added var">added_var</Item>+}
>>> >>>
>>> >>>
>>> >>>       <Item Name="var2">var2</Item>
>>> >>>
>>> >>> On Wed, Feb 8, 2017 at 12: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é

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-09  0:00                   ` Jack Adrian Zappa
@ 2017-02-09  0:01                     ` Jack Adrian Zappa
  2017-02-09  0:10                       ` Jack Adrian Zappa
  0 siblings, 1 reply; 14+ messages in thread
From: Jack Adrian Zappa @ 2017-02-09  0:01 UTC (permalink / raw)
  To: Jack Adrian Zappa; +Cc: git-mailing-list

Tried to copy the .git/config file over to the non-working repository
and it didn't seem to do anything.  Could the git database be
partially corrupted?

On Wed, Feb 8, 2017 at 7:00 PM, Jack Adrian Zappa <adrianh.bsc@gmail.com> wrote:
> Well, it mostly works, but I'm getting some weirdness where it has
> grabbed a line at 126 and is using that for the hunk header.  Strange
> thing is, I move the file to another repository, commit it, make a
> change to the fileand do a diff, and it gets the correct hunk header.
>
> I'm at a loss. :(
>
> On Wed, Feb 8, 2017 at 4:12 PM, Jack Adrian Zappa <adrianh.bsc@gmail.com> wrote:
>> That was it.  I have a .gitattributes file in my home directory.
>> Ahhh, but it's not in my %userprofile% directory, but in my ~
>> directory.
>>
>> A bit confusing having 2 home directories.  I made a link to my
>> .gitconfig, but forgot to make a link to my .gitattributes.
>>
>> Thanks.
>>
>>
>> A
>>
>> On Wed, Feb 8, 2017 at 4:05 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>>> Double check .gitattributes?
>>>
>>> On Feb 8, 2017 2:58 PM, "Jack Adrian Zappa" <adrianh.bsc@gmail.com> wrote:
>>>>
>>>> Thanks Samuel,
>>>>
>>>> That example showed that there must be something wrong in my .git
>>>> directory, because with it, I'm getting the correct output.  Moving
>>>> the same lines to my .git/config didn't work.
>>>>
>>>> On Wed, Feb 8, 2017 at 3:46 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>>>> > I just put this togther: https://github.com/sxlijin/xfuncname-test
>>>> >
>>>> > Try cloning and then for any of config1 thru 3,
>>>> >
>>>> > $ cp configX .git/config
>>>> > $ git diff HEAD^ -- test.natvis
>>>> >
>>>> > On Wed, Feb 8, 2017 at 2:42 PM, Jack Adrian Zappa
>>>> > <adrianh.bsc@gmail.com> wrote:
>>>> >> Thanks Samuel,
>>>> >>
>>>> >> So, the question is, what is causing this problem on my system?
>>>> >>
>>>> >> Anyone have an idea to help diagnose this problem?
>>>> >>
>>>> >> On Wed, Feb 8, 2017 at 3:24 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>>>> >>> On Windows 7, it works for me in both CMD and Git Bash:
>>>> >>>
>>>> >>> $ git --version
>>>> >>> git version 2.11.0.windows.3
>>>> >>>
>>>> >>> $ git diff HEAD^ --word-diff
>>>> >>> diff --git a/test.natvis b/test.natvis
>>>> >>> index 93396ad..1233b8c 100644
>>>> >>> --- a/test.natvis
>>>> >>> +++ b/test.natvis
>>>> >>> @@ -18,6 +18,7 @@ test
>>>> >>>
>>>> >>>
>>>> >>>       <!-- Non-blank line -->
>>>> >>>       {+<Item Name="added var">added_var</Item>+}
>>>> >>>
>>>> >>>
>>>> >>>       <Item Name="var2">var2</Item>
>>>> >>>
>>>> >>> On Wed, Feb 8, 2017 at 12: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é

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-09  0:01                     ` Jack Adrian Zappa
@ 2017-02-09  0:10                       ` Jack Adrian Zappa
  2017-02-10 17:24                         ` René Scharfe
  0 siblings, 1 reply; 14+ messages in thread
From: Jack Adrian Zappa @ 2017-02-09  0:10 UTC (permalink / raw)
  Cc: git-mailing-list

>  where it has grabbed a line at 126 and is using that for the hunk header.

When I say that, I mean that it is using that line for *every* hunk
header, for every change, regardless if it has passed a hunk head that
it should have matched.





On Wed, Feb 8, 2017 at 7:01 PM, Jack Adrian Zappa <adrianh.bsc@gmail.com> wrote:
> Tried to copy the .git/config file over to the non-working repository
> and it didn't seem to do anything.  Could the git database be
> partially corrupted?
>
> On Wed, Feb 8, 2017 at 7:00 PM, Jack Adrian Zappa <adrianh.bsc@gmail.com> wrote:
>> Well, it mostly works, but I'm getting some weirdness where it has
>> grabbed a line at 126 and is using that for the hunk header.  Strange
>> thing is, I move the file to another repository, commit it, make a
>> change to the fileand do a diff, and it gets the correct hunk header.
>>
>> I'm at a loss. :(
>>
>> On Wed, Feb 8, 2017 at 4:12 PM, Jack Adrian Zappa <adrianh.bsc@gmail.com> wrote:
>>> That was it.  I have a .gitattributes file in my home directory.
>>> Ahhh, but it's not in my %userprofile% directory, but in my ~
>>> directory.
>>>
>>> A bit confusing having 2 home directories.  I made a link to my
>>> .gitconfig, but forgot to make a link to my .gitattributes.
>>>
>>> Thanks.
>>>
>>>
>>> A
>>>
>>> On Wed, Feb 8, 2017 at 4:05 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>>>> Double check .gitattributes?
>>>>
>>>> On Feb 8, 2017 2:58 PM, "Jack Adrian Zappa" <adrianh.bsc@gmail.com> wrote:
>>>>>
>>>>> Thanks Samuel,
>>>>>
>>>>> That example showed that there must be something wrong in my .git
>>>>> directory, because with it, I'm getting the correct output.  Moving
>>>>> the same lines to my .git/config didn't work.
>>>>>
>>>>> On Wed, Feb 8, 2017 at 3:46 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>>>>> > I just put this togther: https://github.com/sxlijin/xfuncname-test
>>>>> >
>>>>> > Try cloning and then for any of config1 thru 3,
>>>>> >
>>>>> > $ cp configX .git/config
>>>>> > $ git diff HEAD^ -- test.natvis
>>>>> >
>>>>> > On Wed, Feb 8, 2017 at 2:42 PM, Jack Adrian Zappa
>>>>> > <adrianh.bsc@gmail.com> wrote:
>>>>> >> Thanks Samuel,
>>>>> >>
>>>>> >> So, the question is, what is causing this problem on my system?
>>>>> >>
>>>>> >> Anyone have an idea to help diagnose this problem?
>>>>> >>
>>>>> >> On Wed, Feb 8, 2017 at 3:24 PM, Samuel Lijin <sxlijin@gmail.com> wrote:
>>>>> >>> On Windows 7, it works for me in both CMD and Git Bash:
>>>>> >>>
>>>>> >>> $ git --version
>>>>> >>> git version 2.11.0.windows.3
>>>>> >>>
>>>>> >>> $ git diff HEAD^ --word-diff
>>>>> >>> diff --git a/test.natvis b/test.natvis
>>>>> >>> index 93396ad..1233b8c 100644
>>>>> >>> --- a/test.natvis
>>>>> >>> +++ b/test.natvis
>>>>> >>> @@ -18,6 +18,7 @@ test
>>>>> >>>
>>>>> >>>
>>>>> >>>       <!-- Non-blank line -->
>>>>> >>>       {+<Item Name="added var">added_var</Item>+}
>>>>> >>>
>>>>> >>>
>>>>> >>>       <Item Name="var2">var2</Item>
>>>>> >>>
>>>>> >>> On Wed, Feb 8, 2017 at 12: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é

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Trying to use xfuncname without success.
  2017-02-09  0:10                       ` Jack Adrian Zappa
@ 2017-02-10 17:24                         ` René Scharfe
  0 siblings, 0 replies; 14+ messages in thread
From: René Scharfe @ 2017-02-10 17:24 UTC (permalink / raw)
  To: Jack Adrian Zappa; +Cc: git-mailing-list

Am 09.02.2017 um 01:10 schrieb Jack Adrian Zappa:
>>  where it has grabbed a line at 126 and is using that for the hunk header.
>
> When I say that, I mean that it is using that line for *every* hunk
> header, for every change, regardless if it has passed a hunk head that
> it should have matched.

Strange.  That should only happen if no other function lines are 
recognized before the changes.  You can check if that's the case using 
git grep and your xfuncline regex, e.g. like this:


   $ git grep -En "^[\t ]*<Type[\t ]+Name=\"([^\"]+)\".*$" *.natvis

And you can check *that* result with regular grep -E or egrep if it 
looks funny.

René

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2017-02-10 17:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 19:21 Trying to use xfuncname without success Jack Adrian Zappa
2017-02-07 23:18 ` René Scharfe
2017-02-08 17:11   ` Jack Adrian Zappa
2017-02-08 18:37     ` René Scharfe
2017-02-08 20:24       ` Samuel Lijin
2017-02-08 20:42         ` Jack Adrian Zappa
2017-02-08 20:46           ` Samuel Lijin
2017-02-08 21:03             ` Jack Adrian Zappa
     [not found]             ` <CAKepmai3fBZMS2dXaJyvnP36LooLh8yjn1T6vGG=Pi1B1LMaCQ@mail.gmail.com>
     [not found]               ` <CAJZjrdUcxe_K91CQXz_TgGHgXMsKaddwG5+JEWJ53pv5_GO1zw@mail.gmail.com>
2017-02-08 21:12                 ` Jack Adrian Zappa
2017-02-09  0:00                   ` Jack Adrian Zappa
2017-02-09  0:01                     ` Jack Adrian Zappa
2017-02-09  0:10                       ` Jack Adrian Zappa
2017-02-10 17:24                         ` René Scharfe
2017-02-08 20:39       ` Jack Adrian Zappa

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).