<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/quote.c, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-09-22T03:49:57Z</updated>
<entry>
<title>consistently use "fallthrough" comments in switches</title>
<updated>2017-09-22T03:49:57Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-09-21T06:25:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1cf01a34eaccd6da613dba82291666db237916ab'/>
<id>urn:sha1:1cf01a34eaccd6da613dba82291666db237916ab</id>
<content type='text'>
Gcc 7 adds -Wimplicit-fallthrough, which can warn when a
switch case falls through to the next case. The general idea
is that the compiler can't tell if this was intentional or
not, so you should annotate any intentional fall-throughs as
such, leaving it to complain about any unannotated ones.

There's a GNU __attribute__ which can be used for
annotation, but of course we'd have to #ifdef it away on
non-gcc compilers. Gcc will also recognize
specially-formatted comments, which matches our current
practice. Let's extend that practice to all of the
unannotated sites (which I did look over and verify that
they were behaving as intended).

Ideally in each case we'd actually give some reasons in the
comment about why we're falling through, or what we're
falling through to. And gcc does support that with
-Wimplicit-fallthrough=2, which relaxes the comment pattern
matching to anything that contains "fallthrough" (or a
variety of spelling variants). However, this isn't the
default for -Wimplicit-fallthrough, nor for -Wextra. In the
name of simplicity, it's probably better for us to support
the default level, which requires "fallthrough" to be the
only thing in the comment (modulo some window dressing like
"else" and some punctuation; see the gcc manual for the
complete set of patterns).

This patch suppresses all warnings due to
-Wimplicit-fallthrough. We might eventually want to add that
to the DEVELOPER Makefile knob, but we should probably wait
until gcc 7 is more widely adopted (since earlier versions
will complain about the unknown warning type).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
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>
<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>
</feed>
