<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/utf8.h, branch v2.0.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2013-07-10T05:23:04Z</updated>
<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>
<entry>
<title>Merge branch 'sp/shortlog-missing-lf'</title>
<updated>2013-01-02T18:40:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-02T18:40:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=71288e15dfd6638d14b307b564d1230a4500daa1'/>
<id>urn:sha1:71288e15dfd6638d14b307b564d1230a4500daa1</id>
<content type='text'>
When a line to be wrapped has a solid run of non space characters
whose length exactly is the wrap width, "git shortlog -w" failed to
add a newline after such a line.

* sp/shortlog-missing-lf:
  strbuf_add_wrapped*(): Remove unused return value
  shortlog: fix wrapping lines of wraplen
</content>
</entry>
</feed>
