<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/grep.c, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-03-30T21:59:50Z</updated>
<entry>
<title>convert unchecked snprintf into xsnprintf</title>
<updated>2017-03-30T21:59:50Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-03-28T19:46:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a168e5c86d2c6cbb57429473357bdf1acdec63c'/>
<id>urn:sha1:1a168e5c86d2c6cbb57429473357bdf1acdec63c</id>
<content type='text'>
These calls to snprintf should always succeed, because their
input is small and fixed. Let's use xsnprintf to make sure
this is the case (and to make auditing for actual truncation
easier).

These could be candidates for turning into heap buffers, but
they fall into a few broad categories that make it not worth
doing:

  - formatting single numbers is simple enough that we can
    see the result should fit

  - the size of a sha1 is likewise well-known, and I didn't
    want to cause unnecessary conflicts with the ongoing
    process to convert these constants to GIT_MAX_HEXSZ

  - the interface for curl_errorstr is dictated by curl

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>grep: set default output method</title>
<updated>2017-03-17T19:18:41Z</updated>
<author>
<name>Brandon Williams</name>
<email>bmwill@google.com</email>
</author>
<published>2017-03-17T18:41:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=379642bcd8d89db52feba88a651e4e56d6ac5767'/>
<id>urn:sha1:379642bcd8d89db52feba88a651e4e56d6ac5767</id>
<content type='text'>
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>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 'js/regexec-buf'</title>
<updated>2016-09-26T23:09:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-09-26T23:09:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6a67695268562f67babdb7d5195c8a43cc4015fa'/>
<id>urn:sha1:6a67695268562f67babdb7d5195c8a43cc4015fa</id>
<content type='text'>
Some codepaths in "git diff" used regexec(3) on a buffer that was
mmap(2)ed, which may not have a terminating NUL, leading to a read
beyond the end of the mapped region.  This was fixed by introducing
a regexec_buf() helper that takes a &lt;ptr,len&gt; pair with REG_STARTEND
extension.

* js/regexec-buf:
  regex: use regexec_buf()
  regex: add regexec_buf() that can work on a non NUL-terminated string
  regex: -G&lt;pattern&gt; feeds a non NUL-terminated string to regexec() and fails
</content>
</entry>
<entry>
<title>regex: use regexec_buf()</title>
<updated>2016-09-21T20:56:15Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-09-21T18:24:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b7d36ffca02c23f545d6e098d78180e6e72dfd8d'/>
<id>urn:sha1:b7d36ffca02c23f545d6e098d78180e6e72dfd8d</id>
<content type='text'>
The new regexec_buf() function operates on buffers with an explicitly
specified length, rather than NUL-terminated strings.

We need to use this function whenever the buffer we want to pass to
regexec(3) may have been mmap(2)ed (and is hence not NUL-terminated).

Note: the original motivation for this patch was to fix a bug where
`git diff -G &lt;regex&gt;` would crash. This patch converts more callers,
though, some of which allocated to construct NUL-terminated strings,
or worse, modified buffers to temporarily insert NULs while calling
regexec(3).  By converting them to use regexec_buf(), the code has
become much cleaner.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/am-3-merge-recursive-direct'</title>
<updated>2016-08-10T19:33:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-08-10T19:33:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a5f1a3f256a53014e5b832e1281d952ec5f9ef7'/>
<id>urn:sha1:1a5f1a3f256a53014e5b832e1281d952ec5f9ef7</id>
<content type='text'>
"git am -3" calls "git merge-recursive" when it needs to fall back
to a three-way merge; this call has been turned into an internal
subroutine call instead of spawning a separate subprocess.

* js/am-3-merge-recursive-direct:
  merge-recursive: flush output buffer even when erroring out
  merge_trees(): ensure that the callers release output buffer
  merge-recursive: offer an option to retain the output in 'obuf'
  merge-recursive: write the commit title in one go
  merge-recursive: flush output buffer before printing error messages
  am -3: use merge_recursive() directly again
  merge-recursive: switch to returning errors instead of dying
  merge-recursive: handle return values indicating errors
  merge-recursive: allow write_tree_from_memory() to error out
  merge-recursive: avoid returning a wholesale struct
  merge_recursive: abort properly upon errors
  prepare the builtins for a libified merge_recursive()
  merge-recursive: clarify code in was_tracked()
  die(_("BUG")): avoid translating bug messages
  die("bug"): report bugs consistently
  t5520: verify that `pull --rebase` shows the helpful advice when failing
</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>die("bug"): report bugs consistently</title>
<updated>2016-07-26T18:13:44Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-07-26T16:05:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef1177d18e35c030c37aa533002a11d98361e6b9'/>
<id>urn:sha1:ef1177d18e35c030c37aa533002a11d98361e6b9</id>
<content type='text'>
The vast majority of error messages in Git's source code which report a
bug use the convention to prefix the message with "BUG:".

As part of cleaning up merge-recursive to stop die()ing except in case of
detected bugs, let's just make the remainder of the bug reports consistent
with the de facto rule.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</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>Merge branch 'nd/icase'</title>
<updated>2016-07-19T20:22:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-07-19T20:22:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a883c31af66195556a775f75851f46573c98e43d'/>
<id>urn:sha1:a883c31af66195556a775f75851f46573c98e43d</id>
<content type='text'>
"git grep -i" has been taught to fold case in non-ascii locales
correctly.

* nd/icase:
  grep.c: reuse "icase" variable
  diffcore-pickaxe: support case insensitive match on non-ascii
  diffcore-pickaxe: Add regcomp_or_die()
  grep/pcre: support utf-8
  gettext: add is_utf8_locale()
  grep/pcre: prepare locale-dependent tables for icase matching
  grep: rewrite an if/else condition to avoid duplicate expression
  grep/icase: avoid kwsset when -F is specified
  grep/icase: avoid kwsset on literal non-ascii strings
  test-regex: expose full regcomp() to the command line
  test-regex: isolate the bug test code
  grep: break down an "if" stmt in preparation for next changes
</content>
</entry>
</feed>
