<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/userdiff.c, branch v1.8.0.2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2012-09-17T04:54:47Z</updated>
<entry>
<title>Add userdiff patterns for Ada</title>
<updated>2012-09-17T04:54:47Z</updated>
<author>
<name>Adrian Johnson</name>
<email>ajohnson@redneon.com</email>
</author>
<published>2012-09-16T03:54:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e90d065e64702d09fbdfc7cfd1c97456c7faa74c'/>
<id>urn:sha1:e90d065e64702d09fbdfc7cfd1c97456c7faa74c</id>
<content type='text'>
Add Ada xfuncname and wordRegex patterns to the list of builtin
patterns.

Signed-off-by: Adrian Johnson &lt;ajohnson@redneon.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>drop odd return value semantics from userdiff_config</title>
<updated>2012-02-07T18:44:54Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-02-07T18:23:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6680a0874f86600cc8b4b5327384934d83d752a8'/>
<id>urn:sha1:6680a0874f86600cc8b4b5327384934d83d752a8</id>
<content type='text'>
When the userdiff_config function was introduced in be58e70
(diff: unify external diff and funcname parsing code,
2008-10-05), it used a return value convention unlike any
other config callback. Like other callbacks, it used "-1" to
signal error. But it returned "1" to indicate that it found
something, and "0" otherwise; other callbacks simply
returned "0" to indicate that no error occurred.

This distinction was necessary at the time, because the
userdiff namespace overlapped slightly with the color
configuration namespace. So "diff.color.foo" could mean "the
'foo' slot of diff coloring" or "the 'foo' component of the
"color" userdiff driver". Because the color-parsing code
would die on an unknown color slot, we needed the userdiff
code to indicate that it had matched the variable, letting
us bypass the color-parsing code entirely.

Later, in 8b8e862 (ignore unknown color configuration,
2009-12-12), the color-parsing code learned to silently
ignore unknown slots. This means we no longer need to
protect userdiff-matched variables from reaching the
color-parsing code.

We can therefore change the userdiff_config calling
convention to a more normal one. This drops some code from
each caller, which is nice. But more importantly, it reduces
the cognitive load for readers who may wonder why
userdiff_config is unlike every other config callback.

There's no need to add a new test confirming that this
works; t4020 already contains a test that sets
diff.color.external.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tr/userdiff-c-returns-pointer'</title>
<updated>2011-12-14T06:57:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-12-14T06:57:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=357ba5cf0d4c77c6b4ad8d2cc604392687a3e2a6'/>
<id>urn:sha1:357ba5cf0d4c77c6b4ad8d2cc604392687a3e2a6</id>
<content type='text'>
* tr/userdiff-c-returns-pointer:
  userdiff: allow * between cpp funcname words
</content>
</entry>
<entry>
<title>userdiff: allow * between cpp funcname words</title>
<updated>2011-12-06T21:16:37Z</updated>
<author>
<name>Thomas Rast</name>
<email>trast@student.ethz.ch</email>
</author>
<published>2011-12-06T16:35:08Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=37e7793d473019eac69c347f1a79e3273567b9bf'/>
<id>urn:sha1:37e7793d473019eac69c347f1a79e3273567b9bf</id>
<content type='text'>
The cpp pattern, used for C and C++, would not match the start of a
declaration such as

  static char *prepare_index(int argc,

because it did not allow for * anywhere between the various words that
constitute the modifiers, type and function name.  Fix it.

Signed-off-by: Thomas Rast &lt;trast@student.ethz.ch&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add built-in diff patterns for MATLAB code</title>
<updated>2011-11-16T00:11:52Z</updated>
<author>
<name>Gustaf Hendeby</name>
<email>hendeby@isy.liu.se</email>
</author>
<published>2011-11-15T20:15:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=53b10a140527253f61cfc209a4e85e132c0bc4ee'/>
<id>urn:sha1:53b10a140527253f61cfc209a4e85e132c0bc4ee</id>
<content type='text'>
MATLAB is often used in industry and academia for scientific
computations motivating it being included as a built-in pattern.

Signed-off-by: Gustaf Hendeby &lt;hendeby@isy.liu.se&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Rename git_checkattr() to git_check_attr()</title>
<updated>2011-08-04T22:53:21Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2011-08-04T04:36:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d932f4eb9fc88e93040635d291f6c195ea2e4ee3'/>
<id>urn:sha1:d932f4eb9fc88e93040635d291f6c195ea2e4ee3</id>
<content type='text'>
Suggested by: Junio Hamano &lt;gitster@pobox.com&gt;

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/combine-diff-binary-etc'</title>
<updated>2011-06-30T00:03:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-06-30T00:03:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=dbae1a13363c45d3f77061f61ca73a0c3ed045cf'/>
<id>urn:sha1:dbae1a13363c45d3f77061f61ca73a0c3ed045cf</id>
<content type='text'>
* jk/combine-diff-binary-etc:
  combine-diff: respect textconv attributes
  refactor get_textconv to not require diff_filespec
  combine-diff: handle binary files as binary
  combine-diff: calculate mode_differs earlier
  combine-diff: split header printing into its own function
</content>
</entry>
<entry>
<title>refactor get_textconv to not require diff_filespec</title>
<updated>2011-05-23T22:46:02Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-05-23T20:30:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=3813e69031d2df2702f50b9649fa2e40ea11e558'/>
<id>urn:sha1:3813e69031d2df2702f50b9649fa2e40ea11e558</id>
<content type='text'>
This function actually does two things:

  1. Load the userdiff driver for the filespec.

  2. Decide whether the driver has a textconv component, and
     initialize the textconv cache if applicable.

Only part (1) requires the filespec object, and some callers
may not have a filespec at all. So let's split them it into
two functions, and put part (2) with the userdiff code,
which is a better fit.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff/perl: tighten BEGIN/END block pattern to reject here-doc delimiters</title>
<updated>2011-05-23T18:39:13Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2011-05-22T17:29:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f143d9c695cd4c3e86069c536fa0dff04fc93e93'/>
<id>urn:sha1:f143d9c695cd4c3e86069c536fa0dff04fc93e93</id>
<content type='text'>
A naive method of treating BEGIN/END blocks with a brace on the second
line as diff/grep funcname context involves also matching unrelated
lines that consist of all-caps letters:

	sub foo {
		print &lt;&lt;'EOF'
	text goes here
	...
	EOF
		... rest of foo ...
	}

That's not so great, because it means that "git diff" and "git grep
--show-function" would write "=EOF" or "@@ EOF" as context instead of
a more useful reminder like "@@ sub foo {".

To avoid this, tighten the pattern to only match the special block
names that perl accepts (namely BEGIN, END, INIT, CHECK, UNITCHECK,
AUTOLOAD, and DESTROY).  The list is taken from perl's toke.c.

Suggested-by: Jakub Narebski &lt;jnareb@gmail.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>userdiff/perl: catch sub with brace on second line</title>
<updated>2011-05-22T05:29:32Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2011-05-21T19:38:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=ea2ca4497bdb716977a3e2526780635cb6bac513'/>
<id>urn:sha1:ea2ca4497bdb716977a3e2526780635cb6bac513</id>
<content type='text'>
Accept

	sub foo
	{
	}

as an alternative to a more common style that introduces perl
functions with a brace on the first line (and likewise for BEGIN/END
blocks).  The new regex is a little hairy to avoid matching

	# forward declaration
	sub foo;

while continuing to match "sub foo($;@) {" and

	sub foo { # This routine is interesting;
		# in fact, the lines below explain how...

While at it, pay attention to Perl 5.14's "package foo {" syntax as an
alternative to the traditional "package foo;".

Requested-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
