<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/diffcore-pickaxe.c, branch v1.6.4.5</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.6.4.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.6.4.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2009-03-17T22:10:12Z</updated>
<entry>
<title>pickaxe: count regex matches only once</title>
<updated>2009-03-17T22:10:12Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-03-16T18:38:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=50fd6997c60f926efe4b3591f6c0a37568d02185'/>
<id>urn:sha1:50fd6997c60f926efe4b3591f6c0a37568d02185</id>
<content type='text'>
When --pickaxe-regex is used, forward past the end of matches instead of
advancing to the byte after their start.  This way matches count only
once, even if the regular expression matches their tail -- like in the
fixed-string fork of the code.

E.g.: /.*/ used to count the number of bytes instead of the number of
lines.  /aa/ resulted in a count of two in "aaa" instead of one.

Also document the fact that regexec() needs a NUL-terminated string as
its second argument by adding an assert().

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diffcore-pickaxe: use memmem()</title>
<updated>2009-03-03T02:28:03Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-03-02T23:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=ce163c793d2058056ccc57563c350fd6415397ca'/>
<id>urn:sha1:ce163c793d2058056ccc57563c350fd6415397ca</id>
<content type='text'>
Use memmem() instead of open-coding it.  The system libraries usually have a
much faster version than the memcmp()-loop here.  Even our own fall-back in
compat/, which is used on Windows, is slightly faster.

The following commands were run in a Linux kernel repository and timed, the
best of five results is shown:

  $ STRING='Ensure that the real time constraints are schedulable.'
  $ git log -S"$STRING" HEAD -- kernel/sched.c &gt;/dev/null

On Ubuntu 8.10 x64, before (v1.6.2-rc2):

  8.09user 0.04system 0:08.14elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+30952minor)pagefaults 0swaps

And with the patch:

  1.50user 0.04system 0:01.54elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+30645minor)pagefaults 0swaps

On Fedora 10 x64, before:

  8.34user 0.05system 0:08.39elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+29268minor)pagefaults 0swaps

And with the patch:

  1.15user 0.05system 0:01.20elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
  0inputs+0outputs (0major+32253minor)pagefaults 0swaps

On Windows Vista x64, before:

  real    0m9.204s
  user    0m0.000s
  sys     0m0.000s

And with the patch:

  real    0m8.470s
  user    0m0.000s
  sys     0m0.000s

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>War on whitespace</title>
<updated>2007-06-07T07:04:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2007-06-07T07:04:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a6080a0a44d5ead84db3dabbbc80e82df838533d'/>
<id>urn:sha1:a6080a0a44d5ead84db3dabbbc80e82df838533d</id>
<content type='text'>
This uses "git-apply --whitespace=strip" to fix whitespace errors that have
crept in to our source files over time.  There are a few files that need
to have trailing whitespaces (most notably, test vectors).  The results
still passes the test, and build result in Documentation/ area is unchanged.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>diff -S: release the image after looking for needle in it</title>
<updated>2007-05-07T22:54:32Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2007-05-07T08:24:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a0cb94006ccc6bde6fe89b2a4d8bf7ea84c8b876'/>
<id>urn:sha1:a0cb94006ccc6bde6fe89b2a4d8bf7ea84c8b876</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>diffcore-pickaxe: fix infinite loop on zero-length needle</title>
<updated>2007-01-26T05:17:19Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2007-01-26T04:48:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e1b161161d253a9e7e4cf21cd2ab5b82a4b85273'/>
<id>urn:sha1:e1b161161d253a9e7e4cf21cd2ab5b82a4b85273</id>
<content type='text'>
The "contains" algorithm runs into an infinite loop if the needle string
has zero length. The loop could be modified to handle this, but it makes
more sense to simply have an empty needle return no matches. Thus, a
command like
  git log -S
produces no output.

We place the check at the top of the function so that we get the same
results with or without --pickaxe-regex. Note that until now,
  git log -S --pickaxe-regex
would match everything, not nothing.

Arguably, an empty pickaxe string should simply produce an error
message; however, this is still a useful assertion to add to the
algorithm at this layer of the code.

Noticed by Bill Lear.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>simplify inclusion of system header files.</title>
<updated>2006-12-20T17:51:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2006-12-19T22:34:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=85023577a8f4b540aa64aa37f6f44578c0c305a3'/>
<id>urn:sha1:85023577a8f4b540aa64aa37f6f44578c0c305a3</id>
<content type='text'>
This is a mechanical clean-up of the way *.c files include
system header files.

 (1) sources under compat/, platform sha-1 implementations, and
     xdelta code are exempt from the following rules;

 (2) the first #include must be "git-compat-util.h" or one of
     our own header file that includes it first (e.g. config.h,
     builtin.h, pkt-line.h);

 (3) system headers that are included in "git-compat-util.h"
     need not be included in individual C source files.

 (4) "git-compat-util.h" does not have to include subsystem
     specific header files (e.g. expat.h).

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>On some platforms, certain headers need to be included before regex.h</title>
<updated>2006-04-05T00:14:06Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>Johannes.Schindelin@gmx.de</email>
</author>
<published>2006-04-04T23:01:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=46b8dec038be1125153e9fc816a1e1f0a9d2de77'/>
<id>urn:sha1:46b8dec038be1125153e9fc816a1e1f0a9d2de77</id>
<content type='text'>
Happily, these are already included in cache.h, which is included anyway...
so: change the order of includes.

Signed-off-by: Johannes Schindelin &lt;Johannes.Schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Support for pickaxe matching regular expressions</title>
<updated>2006-04-04T20:44:15Z</updated>
<author>
<name>Petr Baudis</name>
<email>pasky@suse.cz</email>
</author>
<published>2006-03-29T00:16:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d01d8c6782850c18d62676dae3c72ad73be1e52e'/>
<id>urn:sha1:d01d8c6782850c18d62676dae3c72ad73be1e52e</id>
<content type='text'>
git-diff-* --pickaxe-regex will change the -S pickaxe to match
POSIX extended regular expressions instead of fixed strings.

The regex.h library is a rather stupid interface and I like pcre too, but
with any luck it will be everywhere we will want to run Git on, it being
POSIX.2 and all. I'm not sure if we can expect platforms like AIX to
conform to POSIX.2 or if win32 has regex.h. We might add a flag to
Makefile if there is a portability trouble potential.

Signed-off-by: Petr Baudis &lt;pasky@suse.cz&gt;
</content>
</entry>
<entry>
<title>[PATCH] diffcore-pickaxe: switch to "counting" behaviour.</title>
<updated>2005-07-24T03:27:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-07-23T23:35:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2002eed6c9e0e08d7a30da38e459b92f7808b319'/>
<id>urn:sha1:2002eed6c9e0e08d7a30da38e459b92f7808b319</id>
<content type='text'>
Instead of finding old/new pair that one side has and the
other side does not have the specified string, find old/new pair
that contains the specified string as a substring different
number of times.  This would still not catch a case where you
introduce two static variable declarations and remove two static
function definitions from a file with -S"static", but would make
it behave a bit more intuitively.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Do not include unused header files.</title>
<updated>2005-05-29T18:42:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-05-28T09:55:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=844e6e4d58d3e52eee7fb490bfaeadaa5ea2d59c'/>
<id>urn:sha1:844e6e4d58d3e52eee7fb490bfaeadaa5ea2d59c</id>
<content type='text'>
Some source files were including "delta.h" without actually
needing it.  Remove them.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
