<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/quote.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>2016-07-19T20:22:17Z</updated>
<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>
<entry>
<title>grep/icase: avoid kwsset when -F is specified</title>
<updated>2016-07-01T19:44:30Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-06-25T05:22:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=793dc676e08394ed15bffe0ed66606ff9ced1c6a'/>
<id>urn:sha1:793dc676e08394ed15bffe0ed66606ff9ced1c6a</id>
<content type='text'>
Similar to the previous commit, we can't use kws on icase search
outside ascii range. But we can't simply pass the pattern to
regcomp/pcre like the previous commit because it may contain regex
special characters, so we need to quote the regex first.

To avoid misquote traps that could lead to undefined behavior, we
always stick to basic regex engine in this case. We don't need fancy
features for grepping a literal string anyway.

basic_regex_quote_buf() assumes that if the pattern is in a multibyte
encoding, ascii chars must be unambiguously encoded as single
bytes. This is true at least for UTF-8. For others, let's wait until
people yell up. Chances are nobody uses multibyte, non utf-8 charsets
anymore.

Noticed-by: Plamen Totev &lt;plamen.totev@abv.bg&gt;
Helped-by: René Scharfe &lt;l.s.r@web.de&gt;
Helped-by: Eric Sunshine &lt;sunshine@sunshineco.com&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>quote: implement sq_quotef()</title>
<updated>2016-03-01T20:24:15Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.keller@gmail.com</email>
</author>
<published>2016-02-29T22:58:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e70986d72515b7601aea7d8d86a9d3bed53866f3'/>
<id>urn:sha1:e70986d72515b7601aea7d8d86a9d3bed53866f3</id>
<content type='text'>
Signed-off-by: Jacob Keller &lt;jacob.keller@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>quote: move comment before sq_quote_buf()</title>
<updated>2015-10-07T22:12:01Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2015-10-07T22:05:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44cd91eab2992cbf63c789321f16c087696ce324'/>
<id>urn:sha1:44cd91eab2992cbf63c789321f16c087696ce324</id>
<content type='text'>
A big comment at the beginning of quote.c is really
related to sq_quote_buf(), so let's move it in front
of this function.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>quote: fix broken sq_quote_buf() related comment</title>
<updated>2015-10-07T22:11:54Z</updated>
<author>
<name>Christian Couder</name>
<email>christian.couder@gmail.com</email>
</author>
<published>2015-10-07T22:05:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca9da0d810096e5a2f672b6b9c82a58d1a04ce13'/>
<id>urn:sha1:ca9da0d810096e5a2f672b6b9c82a58d1a04ce13</id>
<content type='text'>
Since 77d604c (Enhanced sq_quote(), 10 Oct 2005), the
comment at the beginning of quote.c is broken.
Let's fix it.

Signed-off-by: Christian Couder &lt;chriscool@tuxfamily.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ls-tree: remove path filtering logic in show_tree</title>
<updated>2014-12-01T19:32:34Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2014-11-30T09:05:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1cf9952db243c624cc2763fa74e98adbb38537b1'/>
<id>urn:sha1:1cf9952db243c624cc2763fa74e98adbb38537b1</id>
<content type='text'>
ls-tree uses read_tree_recursive() which already does path filtering
using pathspec. No need to filter one more time based on prefix
only. "ls-tree ../somewhere" does not work because of
this. write_name_quotedpfx() can now be retired because nobody else
uses it.

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>quote: remove sq_quote_print()</title>
<updated>2013-07-30T15:13:38Z</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>artagnon@gmail.com</email>
</author>
<published>2013-07-30T08:31:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=82aae5c1e550ef2244221c9badd69771115053a5'/>
<id>urn:sha1:82aae5c1e550ef2244221c9badd69771115053a5</id>
<content type='text'>
Remove sq_quote_print() since it has no callers.

Signed-off-by: Ramkumar Ramachandra &lt;artagnon@gmail.com&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>for-each-ref, quote: convert *_quote_print -&gt; *_quote_buf</title>
<updated>2013-07-30T15:06:27Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-07-30T08:31:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=10d0167fef35c7a4e4e3ef9dd448594b62089c5a'/>
<id>urn:sha1:10d0167fef35c7a4e4e3ef9dd448594b62089c5a</id>
<content type='text'>
The print_value() function in for-each-ref.c prints values to stdout
immediately using {sq|perl|python|tcl}_quote_print().  Change these
lower-level quote functions to instead leave their results in strbuf
so that we can later add post-processing to the results of them.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Ramkumar Ramachandra &lt;artagnon@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>write_name{_quoted_relative,}(): remove redundant parameters</title>
<updated>2013-06-26T18:22:06Z</updated>
<author>
<name>Jiang Xin</name>
<email>worldhello.net@gmail.com</email>
</author>
<published>2013-06-25T15:53:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e9a820cefde2170840fbcdf7c4b74369988869dc'/>
<id>urn:sha1:e9a820cefde2170840fbcdf7c4b74369988869dc</id>
<content type='text'>
After substitute path_relative() in quote.c with relative_path()
from path.c, parameters (such as len and prefix_len) are redundant
in function write_name() and write_name_quoted_relative().  The
callers have already been audited that the strings they pass are
properly NUL terminated and the length they give are the length of
the string (or -1 that asks the length to be counted by the callee).

Remove these now-redundant parameters.

Signed-off-by: Jiang Xin &lt;worldhello.net@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>quote_path_relative(): remove redundant parameter</title>
<updated>2013-06-26T18:16:48Z</updated>
<author>
<name>Jiang Xin</name>
<email>worldhello.net@gmail.com</email>
</author>
<published>2013-06-25T15:53:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=39598f9983f759b5e38b9e762c695bad6c89a1b3'/>
<id>urn:sha1:39598f9983f759b5e38b9e762c695bad6c89a1b3</id>
<content type='text'>
quote_path_relative() used to take a counted string as its parameter
(the string to be quoted).  With an earlier change, it now uses
relative_path() that does not take a counted string, and we have
been passing only the pointer to the string since then.

Remove the length parameter from quote_path_relative() to show that
this parameter was redundant.  All the changed lines show that the
caller passed either -1 (to ask the function run strlen() on the
string), or the length of the string, so the earlier conversion was
safe.

All the callers of quote_path_relative() that used to take counted string
have been audited to make sure that they are passing length of the actual
string (or -1 to ask the callee run strlen())

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