<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/grep.h, branch v2.12.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.12.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.12.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-12-22T19:47:33Z</updated>
<entry>
<title>grep: add submodules as a grep source type</title>
<updated>2016-12-22T19:47:33Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2016-12-16T19:03:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4538eef564c81c96f2874ccadc54d3c69cc0e19c'/>
<id>urn:sha1:4538eef564c81c96f2874ccadc54d3c69cc0e19c</id>
<content type='text'>
Add `GREP_SOURCE_SUBMODULE` as a grep_source type and cases for this new
type in the various switch statements in grep.c.

When initializing a grep_source with type `GREP_SOURCE_SUBMODULE` the
identifier can either be NULL (to indicate that the working tree will be
used) or a SHA1 (the REV of the submodule to be grep'd).  If the
identifier is a SHA1 then we want to fall through to the
`GREP_SOURCE_SHA1` case to handle the copying of the SHA1.

Signed-off-by: Brandon Williams &lt;bmwill@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/grep-commandline-vs-configuration'</title>
<updated>2016-08-04T21:39:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-08-04T21:39:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b422d99658d1fde0a288c48225a9ae5789c7a270'/>
<id>urn:sha1:b422d99658d1fde0a288c48225a9ae5789c7a270</id>
<content type='text'>
"git -c grep.patternType=extended log --basic-regexp" misbehaved
because the internal API to access the grep machinery was not
designed well.

* jc/grep-commandline-vs-configuration:
  grep: further simplify setting the pattern type
</content>
</entry>
<entry>
<title>grep: further simplify setting the pattern type</title>
<updated>2016-07-25T16:16:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-22T18:43:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8465541e8ce8eaf16e66ab847086779768c18f2d'/>
<id>urn:sha1:8465541e8ce8eaf16e66ab847086779768c18f2d</id>
<content type='text'>
When c5c31d33 (grep: move pattern-type bits support to top-level
grep.[ch], 2012-10-03) introduced grep_commit_pattern_type() helper
function, the intention was to allow the users of grep API to having
to fiddle only with .pattern_type_option (which can be set to "fixed",
"basic", "extended", and "pcre"), and then immediately before compiling
the pattern strings for use, call grep_commit_pattern_type() to have
it prepare various bits in the grep_opt structure (like .fixed,
.regflags, etc.).

However, grep_set_pattern_type_option() helper function the grep API
internally uses were left as an external function by mistake.  This
function shouldn't have been made callable by the users of the API.

Later when the grep API was used in revision traversal machinery,
the caller then mistakenly started calling the function around
34a4ae55 (log --grep: use the same helper to set -E/-F options as
"git grep", 2012-10-03), instead of setting the .pattern_type_option
field and letting the grep_commit_pattern_type() to take care of the
details.

This caused an unnecessary bug that made a configured
grep.patternType take precedence over the command line options
(e.g. --basic-regexp, --fixed-strings) in "git log" family of
commands.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>grep/pcre: prepare locale-dependent tables for icase matching</title>
<updated>2016-07-01T19:44:57Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-06-25T05:22:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9d9babb84d45234132f3cb1f4527ce1106e3d2ec'/>
<id>urn:sha1:9d9babb84d45234132f3cb1f4527ce1106e3d2ec</id>
<content type='text'>
The default tables are usually built with C locale and only suitable
for LANG=C or similar.  This should make case insensitive search work
correctly for all single-byte charsets.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>grep: add color.grep.matchcontext and color.grep.matchselected</title>
<updated>2014-10-28T17:33:50Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2014-10-27T18:23:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=79a77109d3d0d364910ff7fa8c605c554dc4c3e0'/>
<id>urn:sha1:79a77109d3d0d364910ff7fa8c605c554dc4c3e0</id>
<content type='text'>
The config option color.grep.match can be used to specify the highlighting
color for matching strings.  Add the options matchContext and matchSelected
to allow different colors to be specified for matching strings in the
context vs. in selected lines.  This is similar to the ms and mc specifiers
in GNU grep's environment variable GREP_COLORS.

Tests are from Zoltan Klinger's earlier attempt to solve the same
issue in a different way.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>grep: allow to use textconv filters</title>
<updated>2013-05-10T17:27:31Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-05-10T15:10:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=335ec3bf411ae6606b58885deb281192c86651c6'/>
<id>urn:sha1:335ec3bf411ae6606b58885deb281192c86651c6</id>
<content type='text'>
Recently and not so recently, we made sure that log/grep type operations
use textconv filters when a userfacing diff would do the same:

ef90ab6 (pickaxe: use textconv for -S counting, 2012-10-28)
b1c2f57 (diff_grep: use textconv buffers for add/deleted files, 2012-10-28)
0508fe5 (combine-diff: respect textconv attributes, 2011-05-23)

"git grep" currently does not use textconv filters at all, that is
neither for displaying the match and context nor for the actual grepping,
even when requested by --textconv.

Introduce an option "--textconv" which makes git grep use any configured
textconv filters for grepping and output purposes. It is off by default.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fix clang -Wtautological-compare with unsigned enum</title>
<updated>2013-02-25T15:35:55Z</updated>
<author>
<name>Antoine Pelisse</name>
<email>apelisse@gmail.com</email>
</author>
<published>2013-02-03T14:37:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ce3ffb840a1dfa7fcbafa9309fab37478605d08'/>
<id>urn:sha1:3ce3ffb840a1dfa7fcbafa9309fab37478605d08</id>
<content type='text'>
Create a GREP_HEADER_FIELD_MIN so we can check that the field value is
sane and silence the clang warning.

Clang warning happens because the enum is unsigned (this is
implementation-defined, and there is no negative fields) and the check
is then tautological.

Signed-off-by: Antoine Pelisse &lt;apelisse@gmail.com&gt;
Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nd/grep-true-path'</title>
<updated>2012-10-29T08:13:16Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2012-10-29T08:13:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e034d1bb927c17a3406a2bdbb8ccf710677a139d'/>
<id>urn:sha1:e034d1bb927c17a3406a2bdbb8ccf710677a139d</id>
<content type='text'>
"git grep -e pattern &lt;tree&gt;" asked the attribute system to read
"&lt;tree&gt;:.gitattributes" file in the working tree, which was
nonsense.

* nd/grep-true-path:
  grep: stop looking at random places for .gitattributes
</content>
</entry>
<entry>
<title>grep: stop looking at random places for .gitattributes</title>
<updated>2012-10-12T15:24:44Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-10-12T10:49:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=55c61688ea1e41f4a8c26f957bf1bc43cd39ed97'/>
<id>urn:sha1:55c61688ea1e41f4a8c26f957bf1bc43cd39ed97</id>
<content type='text'>
grep searches for .gitattributes using "name" field in struct
grep_source but that field is not real on-disk path name. For example,
"grep pattern rev" fills the field with "rev:path", and Git looks for
.gitattributes in the (non-existent but exploitable) path "rev:path"
instead of "path".

This patch passes real paths down to grep_source_load_driver() when:

 - grep on work tree
 - grep on the index
 - grep a commit (or a tag if it points to a commit)

so that these cases look up .gitattributes at proper paths.
.gitattributes lookup is disabled in all other cases.

Initial-work-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>grep: move pattern-type bits support to top-level grep.[ch]</title>
<updated>2012-10-10T06:21:29Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-10-03T21:47:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5c31d3381d11903c01d51aff4437fe9f76d0268'/>
<id>urn:sha1:c5c31d3381d11903c01d51aff4437fe9f76d0268</id>
<content type='text'>
Switching between -E/-G/-P/-F correctly needs a lot more than just
flipping opt-&gt;regflags bit these days, and we have a nice helper
function buried in builtin/grep.c for the sole use of "git grep".

Extract it so that "log --grep" family can also use it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
