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

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).