<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/userdiff.c, branch v1.7.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.7.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.7.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2010-06-13T18:22:05Z</updated>
<entry>
<title>Merge branch 'bs/userdiff-php'</title>
<updated>2010-06-13T18:22:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-06-13T18:22:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9559910cac77526a95dd5dca93a2e3e6d290c5b9'/>
<id>urn:sha1:9559910cac77526a95dd5dca93a2e3e6d290c5b9</id>
<content type='text'>
* bs/userdiff-php:
  diff: Support visibility modifiers in the PHP hunk header regexp
</content>
</entry>
<entry>
<title>diff: Support visibility modifiers in the PHP hunk header regexp</title>
<updated>2010-05-27T14:12:07Z</updated>
<author>
<name>Björn Steinbrink</name>
<email>B.Steinbrink@gmx.de</email>
</author>
<published>2010-05-23T18:05:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6d2f208c3dd39493f4d45ea67c55a1b7fe06626a'/>
<id>urn:sha1:6d2f208c3dd39493f4d45ea67c55a1b7fe06626a</id>
<content type='text'>
Starting with PHP5, class methods can have a visibility modifier, which
caused the methods not to be matched by the existing regexp, so extend
the regexp to match those modifiers. And while we're at it, allow the
"static" modifier as well.

Since the "static" modifier can appear either before or after the
visibility modifier, let's just allow any number of modifiers to appear
in any order, as that simplifies the regexp and shouldn't cause any
false positives.

Signed-off-by: BjÃ¶rn Steinbrink &lt;B.Steinbrink@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff: cache textconv output</title>
<updated>2010-04-02T07:05:31Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2010-04-02T00:12:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9bae1a178f0f8b198ea611e874975214ad6f990'/>
<id>urn:sha1:d9bae1a178f0f8b198ea611e874975214ad6f990</id>
<content type='text'>
Running a textconv filter can take a long time. It's
particularly bad for a large file which needs to be spooled
to disk, but even for small files, the fork+exec overhead
can add up for something like "git log -p".

This patch uses the notes-cache mechanism to keep a fast
cache of textconv output. Caches are stored in
refs/notes/textconv/$x, where $x is the userdiff driver
defined in gitattributes.

Caching is enabled only if diff.$x.cachetextconv is true.

In my test repo, on a commit with 45 jpg and avi files
changed and a textconv to show their exif tags:

  [before]
  $ time git show &gt;/dev/null
  real    0m13.724s
  user    0m12.057s
  sys     0m1.624s

  [after, first run]
  $ git config diff.mfo.cachetextconv true
  $ time git show &gt;/dev/null
  real    0m14.252s
  user    0m12.197s
  sys     0m1.800s

  [after, subsequent runs]
  $ time git show &gt;/dev/null
  real    0m0.352s
  user    0m0.148s
  sys     0m0.200s

So for a slight (3.8%) cost on the first run, we achieve an
almost 40x speed up on subsequent runs.

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>git_attr(): fix function signature</title>
<updated>2010-01-17T04:39:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-01-17T04:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7fb0eaa289576a1dcd7751015ba791f1bce778a9'/>
<id>urn:sha1:7fb0eaa289576a1dcd7751015ba791f1bce778a9</id>
<content type='text'>
The function took (name, namelen) as its arguments, but all the public
callers wanted to pass a full string.

Demote the counted-string interface to an internal API status, and allow
public callers to just pass the string to the function.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>avoid exponential regex match for java and objc function names</title>
<updated>2009-06-18T16:52:10Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>bonzini@gnu.org</email>
</author>
<published>2009-06-17T14:26:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=959e2e64a594e2fb8de2585078e31b07a8da6fc9'/>
<id>urn:sha1:959e2e64a594e2fb8de2585078e31b07a8da6fc9</id>
<content type='text'>
In the old regex

^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\([^;]*)$
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

you can backtrack arbitrarily from [A-Za-z_0-9]* into [A-Za-z_], thus
causing an exponential number of backtracks.  Ironically it also causes
the regex not to work as intended; for example "catch" can match the
underlined part of the regex, the first repetition matching "c" and
the second matching "atch".

The replacement regex avoids this problem, because it makes sure that
at least a space/tab is eaten on each repetition.  In other words,
a suffix of a repetition can never be a prefix of the next repetition.

Signed-off-by: Paolo Bonzini &lt;bonzini@gnu.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Change the spelling of "wordregex".</title>
<updated>2009-01-22T07:52:16Z</updated>
<author>
<name>Boyd Stephen Smith Jr</name>
<email>bss@iguanasuicide.net</email>
</author>
<published>2009-01-21T04:59:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ae3b970ac3e21324a95fea75213c2569180d74c6'/>
<id>urn:sha1:ae3b970ac3e21324a95fea75213c2569180d74c6</id>
<content type='text'>
Use "wordRegex" for configuration variable names.  Use "word_regex" for C
language tokens.

Signed-off-by: Boyd Stephen Smith Jr. &lt;bss@iguanasuicide.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>color-words: make regex configurable via attributes</title>
<updated>2009-01-17T18:44:21Z</updated>
<author>
<name>Thomas Rast</name>
<email>trast@student.ethz.ch</email>
</author>
<published>2009-01-17T16:29:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=80c49c3de2d5a3aa12b0980a65f1163c8aef0c16'/>
<id>urn:sha1:80c49c3de2d5a3aa12b0980a65f1163c8aef0c16</id>
<content type='text'>
Make the --color-words splitting regular expression configurable via
the diff driver's 'wordregex' attribute.  The user can then set the
driver on a file in .gitattributes.  If a regex is given on the
command line, it overrides the driver's setting.

We also provide built-in regexes for the languages that already had
funcname patterns, and add an appropriate diff driver entry for C/++.
(The patterns are designed to run UTF-8 sequences into a single chunk
to make sure they remain readable.)

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>userdiff: require explicitly allowing textconv</title>
<updated>2008-10-26T21:09:48Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-10-26T04:45:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c7534ef4a12bb44806d522fc8e3961e390f9169b'/>
<id>urn:sha1:c7534ef4a12bb44806d522fc8e3961e390f9169b</id>
<content type='text'>
Diffs that have been produced with textconv almost certainly
cannot be applied, so we want to be careful not to generate
them in things like format-patch.

This introduces a new diff options, ALLOW_TEXTCONV, which
controls this behavior. It is off by default, but is
explicitly turned on for the "log" family of commands, as
well as the "diff" porcelain (but not diff-* plumbing).

Because both text conversion and external diffing are
controlled by these diff options, we can get rid of the
"plumbing versus porcelain" distinction when reading the
config. This was an attempt to control the same thing, but
suffered from being too coarse-grained.

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>diff: add filter for converting binary to text</title>
<updated>2008-10-18T15:02:55Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-10-05T21:43:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9cb92c390cefd3bf3f71bbda12eb04893c861361'/>
<id>urn:sha1:9cb92c390cefd3bf3f71bbda12eb04893c861361</id>
<content type='text'>
When diffing binary files, it is sometimes nice to see the
differences of a canonical text form rather than either a
binary patch or simply "binary files differ."

Until now, the only option for doing this was to define an
external diff command to perform the diff. This was a lot of
work, since the external command needed to take care of
doing the diff itself (including mode changes), and lost the
benefit of git's colorization and other options.

This patch adds a text conversion option, which converts a
file to its canonical format before performing the diff.
This is less flexible than an arbitrary external diff, but
is much less work to set up. For example:

  $ echo '*.jpg diff=exif' &gt;&gt;.gitattributes
  $ git config diff.exif.textconv exiftool
  $ git config diff.exif.binary false

allows one to see jpg diffs represented by the text output
of exiftool.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
<entry>
<title>diff: introduce diff.&lt;driver&gt;.binary</title>
<updated>2008-10-18T15:02:26Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-10-05T21:43:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=122aa6f9c000d0d286898e2eb7b3504ac6cb9ebd'/>
<id>urn:sha1:122aa6f9c000d0d286898e2eb7b3504ac6cb9ebd</id>
<content type='text'>
The "diff" gitattribute is somewhat overloaded right now. It
can say one of three things:

  1. this file is definitely binary, or definitely not
     (i.e., diff or !diff)
  2. this file should use an external diff engine (i.e.,
     diff=foo, diff.foo.command = custom-script)
  3. this file should use particular funcname patterns
     (i.e., diff=foo, diff.foo.(x?)funcname = some-regex)

Most of the time, there is no conflict between these uses,
since using one implies that the other is irrelevant (e.g.,
an external diff engine will decide for itself whether the
file is binary).

However, there is at least one conflicting situation: there
is no way to say "use the regular rules to determine whether
this file is binary, but if we do diff it textually, use
this funcname pattern." That is, currently setting diff=foo
indicates that the file is definitely text.

This patch introduces a "binary" config option for a diff
driver, so that one can explicitly set diff.foo.binary. We
default this value to "don't know". That is, setting a diff
attribute to "foo" and using "diff.foo.funcname" will have
no effect on the binaryness of a file. To get the current
behavior, one can set diff.foo.binary to true.

This patch also has one additional advantage: it cleans up
the interface to the userdiff code a bit. Before, calling
code had to know more about whether attributes were false,
true, or unset to determine binaryness. Now that binaryness
is a property of a driver, we can represent these situations
just by passing back a driver struct.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
</feed>
