<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/grep.h, branch v1.6.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.6.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.6.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2009-07-02T02:16:50Z</updated>
<entry>
<title>grep -p: support user defined regular expressions</title>
<updated>2009-07-02T02:16:50Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-07-01T22:07:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=60ecac98ed6f420c6bf823491074219087c749d4'/>
<id>urn:sha1:60ecac98ed6f420c6bf823491074219087c749d4</id>
<content type='text'>
Respect the userdiff attributes and config settings when looking for
lines with function definitions in git grep -p.

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>grep: add option -p/--show-function</title>
<updated>2009-07-02T02:16:49Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-07-01T22:06:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2944e4e6145bdfcb1a8730d7da671786d72c86ed'/>
<id>urn:sha1:2944e4e6145bdfcb1a8730d7da671786d72c86ed</id>
<content type='text'>
The new option -p instructs git grep to print the previous function
definition as a context line, similar to diff -p.  Such context lines
are marked with an equal sign instead of a dash.  This option
complements the existing context options -A, -B, -C.

Function definitions are detected using the same heuristic that diff
uses.  User defined regular expressions are not supported, yet.

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>grep: print context hunk marks between files</title>
<updated>2009-07-02T02:16:46Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-07-01T22:03:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=046802d015b3be2e055ae68f29f76741023bc32d'/>
<id>urn:sha1:046802d015b3be2e055ae68f29f76741023bc32d</id>
<content type='text'>
Print a hunk mark before matches from a new file are shown, in addition
to the current behaviour of printing them if lines have been skipped.

The result is easier to read, as (presumably unrelated) matches from
different files are separated by a hunk mark.  GNU grep does the same.

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>grep: move context hunk mark handling into show_line()</title>
<updated>2009-07-02T02:16:45Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-07-01T22:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5dd06d38795b2f6d05f851b25c814732238f8df1'/>
<id>urn:sha1:5dd06d38795b2f6d05f851b25c814732238f8df1</id>
<content type='text'>
Move last_shown into struct grep_opt, to make it available in
show_line(), and then make the function handle the printing of hunk
marks for context lines in a central place.

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>grep: use parseopt</title>
<updated>2009-05-09T07:29:56Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-05-07T19:46:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3e230fa1b2ba3aa1a207c4399a1b93e41b103dfb'/>
<id>urn:sha1:3e230fa1b2ba3aa1a207c4399a1b93e41b103dfb</id>
<content type='text'>
Convert git-grep to parseopt.

The bitfields in struct grep_opt are converted to full ints,
increasing its size.  This shouldn't be a problem as there is only a
single instance in memory.

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>grep: add support for coloring with external greps</title>
<updated>2009-03-07T19:34:59Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-03-07T12:34:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a94982ef39e1bb9a6f782b5b6ced22e97d6859b5'/>
<id>urn:sha1:a94982ef39e1bb9a6f782b5b6ced22e97d6859b5</id>
<content type='text'>
Add the config variable color.grep.external, which can be used to
switch on coloring of external greps.  To enable auto coloring with
GNU grep, one needs to set color.grep.external to --color=always to
defeat the pager started by git grep.  The value of the config
variable will be passed to the external grep only if it would
colorize internal grep's output, so automatic terminal detected
works.  The default is to not pass any option, because the external
grep command could be a program without color support.

Also set the environment variables GREP_COLOR and GREP_COLORS to
pass the configured color for matches to the external grep.  This
works with GNU grep; other variables could be added as needed.

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>grep: color patterns in output</title>
<updated>2009-03-07T19:34:59Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-03-07T12:32:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7e8f59d577e5615ceff06da0d9dde36a63608d53'/>
<id>urn:sha1:7e8f59d577e5615ceff06da0d9dde36a63608d53</id>
<content type='text'>
Coloring matches makes them easier to spot in the output.

Add two options and two parameters: color.grep (to turn coloring on
or off), color.grep.match (to set the color of matches), --color
and --no-color (to turn coloring on or off, respectively).

The output of external greps is not changed.

This patch is based on earlier ones by Nguyễn Thái Ngọc Duy and
Thiago Alves.

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>grep: remove grep_opt argument from match_expr_eval()</title>
<updated>2009-03-07T19:34:56Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-03-07T12:28:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d7eb527d731e2a71eaa4597417d879a15588d9ee'/>
<id>urn:sha1:d7eb527d731e2a71eaa4597417d879a15588d9ee</id>
<content type='text'>
The only use of the struct grep_opt argument of match_expr_eval()
is to pass the option word_regexp to match_one_pattern().  By adding
a pattern flag for it we can reduce the number of function arguments
of these two functions, as a cleanup and preparation for adding more
in the next patch.

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>grep: don't call regexec() for fixed strings</title>
<updated>2009-01-10T05:35:56Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-01-09T23:18:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c822255cfc1ac83daeeeee1647e3c775450c830c'/>
<id>urn:sha1:c822255cfc1ac83daeeeee1647e3c775450c830c</id>
<content type='text'>
Add the new flag "fixed" to struct grep_pat and set it if the pattern
is doesn't contain any regex control characters in addition to if the
flag -F/--fixed-strings was specified.

This gives a nice speed up on msysgit, where regexec() seems to be
extra slow.  Before (best of five runs):

	$ time git grep grep v1.6.1 &gt;/dev/null

	real    0m0.552s
	user    0m0.000s
	sys     0m0.000s

	$ time git grep -F grep v1.6.1 &gt;/dev/null

	real    0m0.170s
	user    0m0.000s
	sys     0m0.015s

With the patch:

	$ time git grep grep v1.6.1 &gt;/dev/null

	real    0m0.173s
	user    0m0.000s
	sys     0m0.000s

The difference is much smaller on Linux, but still measurable.

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>git grep: Add "-z/--null" option as in GNU's grep.</title>
<updated>2008-10-01T16:14:54Z</updated>
<author>
<name>Raphael Zimmerer</name>
<email>killekulla@rdrz.de</email>
</author>
<published>2008-10-01T16:11:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=83caecca2f0805d440099d19011fdedc2b3467a5'/>
<id>urn:sha1:83caecca2f0805d440099d19011fdedc2b3467a5</id>
<content type='text'>
Here's a trivial patch that adds "-z" and "--null" options to "git
grep". It was discussed on the mailing-list that git's "-z"
convention should be used instead of GNU grep's "-Z".
So things like 'git grep -l -z "$FOO" | xargs -0 sed -i "s/$FOO/$BOO/"'
do work now.

Signed-off-by: Raphael Zimmerer &lt;killekulla@rdrz.de&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
</feed>
