<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/utf8.c, branch v2.1.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.1.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.1.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-06-06T18:29:38Z</updated>
<entry>
<title>Merge branch 'tb/unicode-6.3-zero-width'</title>
<updated>2014-06-06T18:29:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-06-06T18:29:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=334d40e951fa3b3961135b3183633706d976c4bd'/>
<id>urn:sha1:334d40e951fa3b3961135b3183633706d976c4bd</id>
<content type='text'>
Update the logic to compute the display width needed for utf8
strings and allow us to more easily maintain the tables used in
that logic.

We may want to let the users choose if codepoints with ambiguous
widths are treated as a double or single width in a follow-up patch.

* tb/unicode-6.3-zero-width:
  utf8: make it easier to auto-update git_wcwidth()
  utf8.c: use a table for double_width
</content>
</entry>
<entry>
<title>utf8: make it easier to auto-update git_wcwidth()</title>
<updated>2014-05-12T17:38:01Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2014-05-09T21:51:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9c94389c3ee02df891100b894c1790a524268d91'/>
<id>urn:sha1:9c94389c3ee02df891100b894c1790a524268d91</id>
<content type='text'>
The function git_wcwidth() returns for a given unicode code point the
width on the display:

 -1 for control characters,
  0 for combining or other non-visible code points
  1 for e.g. ASCII
  2 for double-width code points.

This table had been originally been extracted for one Unicode
version, probably 3.2.

We now use two tables these days, one for zero-width and another for
double-width.  Make it easier to update these tables to a later
version of Unicode by factoring out the table from utf8.c into
unicode_width.h and add the script update_unicode.sh to update the
table based on the latest Unicode specification files.

Thanks to Peter Krefting &lt;peter@softwolves.pp.se&gt; and Kevin Bracey
&lt;kevin@bracey.fi&gt; for helping with their Unicode knowledge.

Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>utf8.c: use a table for double_width</title>
<updated>2014-05-12T17:20:46Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2014-05-09T21:51:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=08460345b5a221c0076a48c6be875d64b78b6015'/>
<id>urn:sha1:08460345b5a221c0076a48c6be875d64b78b6015</id>
<content type='text'>
Refactor git_wcwidth() and replace the if-else-if chain.
Use the table double_width which is scanned by the bisearch() function,
which is already used to find combining code points.

Signed-off-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 'tb/unicode-6.3-zero-width'</title>
<updated>2014-04-16T20:38:57Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-16T20:38:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9fd911a8101bf4d3bff4e2e61a138505eb39eace'/>
<id>urn:sha1:9fd911a8101bf4d3bff4e2e61a138505eb39eace</id>
<content type='text'>
Teach our display-column-counting logic about decomposed umlauts
and friends.

* tb/unicode-6.3-zero-width:
  utf8.c: partially update to version 6.3
</content>
</entry>
<entry>
<title>utf8.c: partially update to version 6.3</title>
<updated>2014-04-09T17:14:05Z</updated>
<author>
<name>Torsten Bögershausen</name>
<email>tboegi@web.de</email>
</author>
<published>2014-04-07T19:39:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d813ab970db8b57b70bdd1b7e5feddec1c3fd84e'/>
<id>urn:sha1:d813ab970db8b57b70bdd1b7e5feddec1c3fd84e</id>
<content type='text'>
Unicode 6.3 defines more code points as combining or accents.  For
example, the character "ö" could be expressed as an "o" followed by
U+0308 COMBINING DIARESIS (aka umlaut, double-dot-above).  We should
consider that such a sequence of two codepoints occupies one display
column for the alignment purposes, and for that, git_wcwidth()
should return 0 for them.  Affected codepoints are:

    U+0358..U+035C
    U+0487
    U+05A2, U+05BA, U+05C5, U+05C7
    U+0604, U+0616..U+061A, U+0659..U+065F

Earlier unicode standards had defined these as "reserved".

Only the range 0..U+07FF has been checked to see which codepoints
need to be marked as 0-width while preparing for this commit; more
updates may be needed.

Signed-off-by: Torsten Bögershausen &lt;tboegi@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>utf8: use correct type for values in interval table</title>
<updated>2014-02-18T23:51:40Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2014-02-16T16:06:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a68a67dea399f15305b059aa36c007cfdde2890e'/>
<id>urn:sha1:a68a67dea399f15305b059aa36c007cfdde2890e</id>
<content type='text'>
We treat these as unsigned everywhere and compare against unsigned
values, so declare them using the typedef we already have for this.

While we're here, fix the indentation as well.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>utf8: fix iconv error detection</title>
<updated>2014-02-18T23:51:33Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2014-02-16T16:06:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df5213b70d29e65aaff17d2577e42787e5a272bb'/>
<id>urn:sha1:df5213b70d29e65aaff17d2577e42787e5a272bb</id>
<content type='text'>
iconv(3) returns "(size_t) -1" on error.  Make sure that we cast the
"-1" properly when checking for this.

Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pretty: Fix bug in truncation support for %&gt;, %&lt; and %&gt;&lt;</title>
<updated>2013-04-28T19:09:37Z</updated>
<author>
<name>Ramsay Jones</name>
<email>ramsay@ramsay1.demon.co.uk</email>
</author>
<published>2013-04-27T19:43:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=980419b99306b326d44d740a95f3401e169ad943'/>
<id>urn:sha1:980419b99306b326d44d740a95f3401e169ad943</id>
<content type='text'>
Some systems experience failures in t4205-*.sh (tests 18-20, 27)
which all relate to the use of truncation with the %&lt; padding
placeholder. This capability was added in the commit a7f01c6b
("pretty: support truncating in %&gt;, %&lt; and %&gt;&lt;", 19-04-2013).

The truncation support was implemented with the assistance of a
new strbuf function (strbuf_utf8_replace). This function contains
the following code:

       strbuf_attach(sb_src, strbuf_detach(&amp;sb_dst, NULL),
                     sb_dst.len, sb_dst.alloc);

Unfortunately, this code is subject to unspecified behaviour. In
particular, the order of evaluation of the argument expressions
(along with the associated side effects) is not specified by the
C standard. Note that the second argument expression is a call to
strbuf_detach() which, as a side effect, sets the 'len' and 'alloc'
fields of the sb_dst argument to zero. Depending on the order of
evaluation of the argument expressions to the strbuf_attach call,
this can lead to assigning an empty string to 'sb_src'.

In order to remove the undesired behaviour, we replace the above
line of code with:

       strbuf_swap(sb_src, &amp;sb_dst);
       strbuf_release(&amp;sb_dst);

which achieves the desired effect without provoking unspecified
behaviour.

Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Acked-by: Duy Nguyen &lt;pclouds@gmail.com&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>
</feed>
