<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/gettext.c, branch v2.18.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.18.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.18.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-05-08T06:59:34Z</updated>
<entry>
<title>Merge branch 'js/runtime-prefix'</title>
<updated>2018-05-08T06:59:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-08T06:59:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=71c848bb28a2fcef918178f286f7e43d9804588d'/>
<id>urn:sha1:71c848bb28a2fcef918178f286f7e43d9804588d</id>
<content type='text'>
* js/runtime-prefix:
  Avoid multiple PREFIX definitions
  git_setup_gettext: plug memory leak
  gettext: avoid initialization if the locale dir is not present
</content>
</entry>
<entry>
<title>Merge branch 'dj/runtime-prefix'</title>
<updated>2018-05-08T06:59:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-05-08T06:59:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=92034a9cd5e71cf686ef66029433bdaba75027b0'/>
<id>urn:sha1:92034a9cd5e71cf686ef66029433bdaba75027b0</id>
<content type='text'>
A build-time option has been added to allow Git to be told to refer
to its associated files relative to the main binary, in the same
way that has been possible on Windows for quite some time, for
Linux, BSDs and Darwin.

* dj/runtime-prefix:
  Makefile: quote $INSTLIBDIR when passing it to sed
  Makefile: remove unused @@PERLLIBDIR@@ substitution variable
  mingw/msvc: use the new-style RUNTIME_PREFIX helper
  exec_cmd: provide a new-style RUNTIME_PREFIX helper for Windows
  exec_cmd: RUNTIME_PREFIX on some POSIX systems
  Makefile: add Perl runtime prefix support
  Makefile: generate Perl header from template file
</content>
</entry>
<entry>
<title>git_setup_gettext: plug memory leak</title>
<updated>2018-04-24T02:12:32Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2018-04-21T11:14:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0210231b0803f881bf765bb2d7284c119c6ce9b6'/>
<id>urn:sha1:0210231b0803f881bf765bb2d7284c119c6ce9b6</id>
<content type='text'>
The system_path() function returns a freshly-allocated string. We need
to release it.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gettext: avoid initialization if the locale dir is not present</title>
<updated>2018-04-24T02:12:31Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2018-04-21T11:14:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cc5e1bf992470e0d514c743e75a0325c8b592f38'/>
<id>urn:sha1:cc5e1bf992470e0d514c743e75a0325c8b592f38</id>
<content type='text'>
The runtime of a simple `git.exe version` call on Windows is currently
dominated by the gettext setup, adding a whopping ~150ms to the ~210ms
total.

Given that this cost is added to each and every git.exe invocation goes
through common-main's invocation of git_setup_gettext(), and given that
scripts have to call git.exe dozens, if not hundreds, of times, this is
a substantial performance penalty.

This is particularly pointless when considering that Git for Windows
ships without localization (to keep the installer's size to a bearable
~34MB): all that time setting up gettext is for naught.

To be clear, Git for Windows *needs* to be compiled with localization,
for the following reasons:

- to allow users to copy add-on localization in case they want it, and

- to fix the nasty error message

	BUG: your vsnprintf is broken (returned -1)

  by using libgettext's override of vsnprintf() that does not share the
  behavior of msvcrt.dll's version of vsnprintf().

So let's be smart about it and skip setting up gettext if the locale
directory is not even present.

Since localization might be missing for not-yet-supported locales, this
will not break anything.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>exec_cmd: RUNTIME_PREFIX on some POSIX systems</title>
<updated>2018-04-11T09:10:28Z</updated>
<author>
<name>Dan Jacques</name>
<email>dnj@google.com</email>
</author>
<published>2018-04-10T15:05:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=226c0ddd0d63dd6c8dde497c755af2ad1f02e0c1'/>
<id>urn:sha1:226c0ddd0d63dd6c8dde497c755af2ad1f02e0c1</id>
<content type='text'>
Enable Git to resolve its own binary location using a variety of
OS-specific and generic methods, including:

- procfs via "/proc/self/exe" (Linux)
- _NSGetExecutablePath (Darwin)
- KERN_PROC_PATHNAME sysctl on BSDs.
- argv0, if absolute (all, including Windows).

This is used to enable RUNTIME_PREFIX support for non-Windows systems,
notably Linux and Darwin. When configured with RUNTIME_PREFIX, Git will
do a best-effort resolution of its executable path and automatically use
this as its "exec_path" for relative helper and data lookups, unless
explicitly overridden.

Small incidental formatting cleanup of "exec_cmd.c".

Signed-off-by: Dan Jacques &lt;dnj@google.com&gt;
Thanks-to: Robbie Iannucci &lt;iannucci@google.com&gt;
Thanks-to: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gettext: add is_utf8_locale()</title>
<updated>2016-07-01T19:44:57Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-06-25T05:22:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8c1672655dcff59aaf0f78fa256b1d2e3f1ba9b'/>
<id>urn:sha1:e8c1672655dcff59aaf0f78fa256b1d2e3f1ba9b</id>
<content type='text'>
This function returns true if git is running under an UTF-8
locale. pcre in the next patch will need this.

is_encoding_utf8() is used instead of strcmp() to catch both "utf-8"
and "utf8" suffixes.

When built with no gettext support, we peek in several env variables
to detect UTF-8. pcre library might support utf-8 even if libc is
built without locale support.. The peeking code is a copy from
compat/regex/regcomp.c

Helped-by: Ævar Arnfjörð Bjarmason &lt;avarab@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>introduce "format" date-mode</title>
<updated>2015-06-29T18:39:10Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-06-25T16:55:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa1462cc3d3b0c4c8ad6a60aaf31e0f3a424162d'/>
<id>urn:sha1:aa1462cc3d3b0c4c8ad6a60aaf31e0f3a424162d</id>
<content type='text'>
This feeds the format directly to strftime. Besides being a
little more flexible, the main advantage is that your system
strftime may know more about your locale's preferred format
(e.g., how to spell the days of the week).

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>gettext.c: move get_preferred_languages() from http.c</title>
<updated>2015-02-26T22:09:20Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-02-26T03:04:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=93f7d9108a0edf808e1e3bbcdbe6078310c22f9e'/>
<id>urn:sha1:93f7d9108a0edf808e1e3bbcdbe6078310c22f9e</id>
<content type='text'>
Calling setlocale(LC_MESSAGES, ...) directly from http.c, without
including &lt;locale.h&gt;, was causing compilation warnings.  Move the
helper function to gettext.c that already includes the header and
where locale-related issues are handled.

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>gettext.c: detect the vsnprintf bug at runtime</title>
<updated>2013-12-05T00:10:51Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2013-12-01T02:45:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9c0495d23e6999375976ca44e3812fc65b73626e'/>
<id>urn:sha1:9c0495d23e6999375976ca44e3812fc65b73626e</id>
<content type='text'>
Bug 6530 [1] in glibc causes "git show v0.99.6~1" to fail with error
"your vsnprintf is broken". The workaround avoids that, but it
corrupts system error messages in non-C locales.

The bug has been fixed since 2.17. We could know running glibc version
with gnu_get_libc_version(). But version is not a sure way to detect
the bug because downstream may back port the fix to older versions. Do
a runtime test that immitates the call flow that leads to "your
vsnprintf is broken". Only enable the workaround if the test fails.

Tested on Gentoo Linux, glibc 2.16.0 and 2.17, amd64.

[1] http://sourceware.org/bugzilla/show_bug.cgi?id=6530

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>fetch: align per-ref summary report in UTF-8 locales</title>
<updated>2012-09-14T19:45:50Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2012-09-04T10:39:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=754395d3052fc0d46948b2ff7006b3c6701785c8'/>
<id>urn:sha1:754395d3052fc0d46948b2ff7006b3c6701785c8</id>
<content type='text'>
fetch does printf("%-*s", width, "foo") where "foo" can be a utf-8
string, but width is in bytes, not columns. For ASCII it's fine as one
byte takes one column. For utf-8, this may result in misaligned ref
summary table.

Introduce gettext_width() function that returns the string length in
columns (currently only supports utf-8 locales). Make the code use
TRANSPORT_SUMMARY(x) where the length is compensated properly in
non-English locales.

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>
