<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/utf8.h, branch v2.3.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-12-17T19:04:39Z</updated>
<entry>
<title>utf8: add is_hfs_dotgit() helper</title>
<updated>2014-12-17T19:04:39Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-12-15T22:56:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6162a1d323d24fd8cbbb1a6145a91fb849b2568f'/>
<id>urn:sha1:6162a1d323d24fd8cbbb1a6145a91fb849b2568f</id>
<content type='text'>
We do not allow paths with a ".git" component to be added to
the index, as that would mean repository contents could
overwrite our repository files. However, asking "is this
path the same as .git" is not as simple as strcmp() on some
filesystems.

HFS+'s case-folding does more than just fold uppercase into
lowercase (which we already handle with strcasecmp). It may
also skip past certain "ignored" Unicode code points, so
that (for example) ".gi\u200ct" is mapped ot ".git".

The full list of folds can be found in the tables at:

  https://www.opensource.apple.com/source/xnu/xnu-1504.15.3/bsd/hfs/hfscommon/Unicode/UCStringCompareData.h

Implementing a full "is this path the same as that path"
comparison would require us importing the whole set of
tables.  However, what we want to do is much simpler: we
only care about checking ".git". We know that 'G' is the
only thing that folds to 'g', and so on, so we really only
need to deal with the set of ignored code points, which is
much smaller.

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>add missing "format" function attributes</title>
<updated>2013-07-10T05:23:04Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-07-10T00:18:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4621085b7eb2f4cffe16d508988ff9b4a874b4ef'/>
<id>urn:sha1:4621085b7eb2f4cffe16d508988ff9b4a874b4ef</id>
<content type='text'>
For most of our functions that take printf-like formats, we
use gcc's __attribute__((format)) to get compiler warnings
when the functions are misused. Let's give a few more
functions the same protection.

In most cases, the annotations do not uncover any actual
bugs; the only code change needed is that we passed a size_t
to transfer_debug, which expected an int. Since we expect
the passed-in value to be a relatively small buffer size
(and cast a similar value to int directly below), we can
just cast away the problem.

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>pretty: support %&gt;&gt; that steal trailing spaces</title>
<updated>2013-04-18T23:28:29Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-04-18T23:08:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1640632b4f3f69775f04e9e40dfd2fd912e0f458'/>
<id>urn:sha1:1640632b4f3f69775f04e9e40dfd2fd912e0f458</id>
<content type='text'>
This is pretty useful in `%&lt;(100)%s%Cred%&gt;(20)% an' where %s does not
use up all 100 columns and %an needs more than 20 columns. By
replacing %&gt;(20) with %&gt;&gt;(20), %an can steal spaces from %s.

%&gt;&gt; understands escape sequences, so %Cred does not stop it from
stealing spaces in %&lt;(100).

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>pretty: support truncating in %&gt;, %&lt; and %&gt;&lt;</title>
<updated>2013-04-18T23:28:29Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-04-18T23:08:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a7f01c6b4ddf9f2f6bdcb23fc7afb56695807cba'/>
<id>urn:sha1:a7f01c6b4ddf9f2f6bdcb23fc7afb56695807cba</id>
<content type='text'>
%&gt;(N,trunc) truncates the right part after N columns and replace the
last two letters with "..". ltrunc does the same on the left. mtrunc
cuts the middle out.

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>utf8.c: add reencode_string_len() that can handle NULs in string</title>
<updated>2013-04-18T23:28:28Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-04-18T23:08:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b782bbab94e3618aea352907caa77321b487b918'/>
<id>urn:sha1:b782bbab94e3618aea352907caa77321b487b918</id>
<content type='text'>
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>utf8.c: add utf8_strnwidth() with the ability to skip ansi sequences</title>
<updated>2013-04-18T23:28:28Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-04-18T23:08:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2bc1e7ecba1fcd73112d5e6703bdc28fb4da530a'/>
<id>urn:sha1:2bc1e7ecba1fcd73112d5e6703bdc28fb4da530a</id>
<content type='text'>
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>Merge branch 'ks/rfc2047-one-char-at-a-time'</title>
<updated>2013-03-25T21:00:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-03-25T21:00:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=573f1a9cf163365637a36a6d95c670883a918352'/>
<id>urn:sha1:573f1a9cf163365637a36a6d95c670883a918352</id>
<content type='text'>
When "format-patch" quoted a non-ascii strings on the header files,
it incorrectly applied rfc2047 and chopped a single character in
the middle of it.

* ks/rfc2047-one-char-at-a-time:
  format-patch: RFC 2047 says multi-octet character may not be split
</content>
</entry>
<entry>
<title>format-patch: RFC 2047 says multi-octet character may not be split</title>
<updated>2013-03-09T19:11:19Z</updated>
<author>
<name>Kirill Smelkov</name>
<email>kirr@mns.spb.ru</email>
</author>
<published>2013-03-07T10:55:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6cd3c0532772749bcf6c4688f34c8ecc65ecb655'/>
<id>urn:sha1:6cd3c0532772749bcf6c4688f34c8ecc65ecb655</id>
<content type='text'>
Even though an earlier attempt (bafc478..41dd00bad) cleaned
up RFC 2047 encoding, pretty.c::add_rfc2047() still decides
where to split the output line by going through the input
one byte at a time, and potentially splits a character in
the middle.  A subject line may end up showing like this:

     ".... fö?? bar".   (instead of  ".... föö bar".)

if split incorrectly.

RFC 2047, section 5 (3) explicitly forbids such beaviour

    Each 'encoded-word' MUST represent an integral number of
    characters.  A multi-octet character may not be split across
    adjacent 'encoded- word's.

that means that e.g. for

    Subject: .... föö bar

encoding

    Subject: =?UTF-8?q?....=20f=C3=B6=C3=B6?=
     =?UTF-8?q?=20bar?=

is correct, and

    Subject: =?UTF-8?q?....=20f=C3=B6=C3?=      &lt;-- NOTE ö is broken here
     =?UTF-8?q?=B6=20bar?=

is not, because "ö" character UTF-8 encoding C3 B6 is split here across
adjacent encoded words.

To fix the problem, make the loop grab one _character_ at a time and
determine its output length to see where to break the output line.  Note
that this version only knows about UTF-8, but the logic to grab one
character is abstracted out in mbs_chrlen() function to make it possible
to extend it to other encodings with the help of iconv in the future.

Signed-off-by: Kirill Smelkov &lt;kirr@mns.spb.ru&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jx/utf8-printf-width'</title>
<updated>2013-02-14T18:29:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-14T18:29:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3cc3cf970c5ce477bde78df73614d1efba2b52eb'/>
<id>urn:sha1:3cc3cf970c5ce477bde78df73614d1efba2b52eb</id>
<content type='text'>
Use a new helper that prints a message and counts its display width
to align the help messages parse-options produces.

* jx/utf8-printf-width:
  Add utf8_fprintf helper that returns correct number of columns
</content>
</entry>
<entry>
<title>Add utf8_fprintf helper that returns correct number of columns</title>
<updated>2013-02-11T19:29:45Z</updated>
<author>
<name>Jiang Xin</name>
<email>worldhello.net@gmail.com</email>
</author>
<published>2013-02-09T06:31:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c082196575e13dd5960031f213b20e2df989ca18'/>
<id>urn:sha1:c082196575e13dd5960031f213b20e2df989ca18</id>
<content type='text'>
Since command usages can be translated, they may include utf-8
encoded strings, and the output in console may not align well any
more. This is because strlen() is different from strwidth() on utf-8
strings.

A wrapper utf8_fprintf() can help to return the correct number of
columns required.

Signed-off-by: Jiang Xin &lt;worldhello.net@gmail.com&gt;
Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Reviewed-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
