<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/Documentation/CodingGuidelines, branch v1.8.0.2</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.8.0.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2012-08-15T18:00:39Z</updated>
<entry>
<title>Documentation/CodingGuidelines: spell out more shell guidelines</title>
<updated>2012-08-15T18:00:39Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2012-08-15T17:06:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=03b05c7db5473329f433c5a3b87965d6fa0f691f'/>
<id>urn:sha1:03b05c7db5473329f433c5a3b87965d6fa0f691f</id>
<content type='text'>
In earlier days, "imitate the style in the neibouring code" was
sufficient to keep the coherent style, but over time some parts of
the codebase have drifted enough to make it ineffective.

Spell some of the guidelines out.

Signed-off-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: do not use 'which' in shell scripts</title>
<updated>2012-02-27T23:10:23Z</updated>
<author>
<name>Tim Henigan</name>
<email>tim.henigan@gmail.com</email>
</author>
<published>2012-02-24T23:12:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=860f70f9f4206379361fd5af84c8fde31984b418'/>
<id>urn:sha1:860f70f9f4206379361fd5af84c8fde31984b418</id>
<content type='text'>
During the code review of a recent patch, it was noted that shell scripts
must not use 'which $cmd' to check the availability of the command $cmd.
The output of the command is not machine parseable and its exit code is
not reliable across platforms.

It is better to use 'type' to accomplish this task.

Signed-off-by: Tim Henigan &lt;tim.henigan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: Add a note about spaces after redirection</title>
<updated>2012-02-27T20:41:13Z</updated>
<author>
<name>Tim Henigan</name>
<email>tim.henigan@gmail.com</email>
</author>
<published>2012-02-24T23:12:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=48f359bfafa7db4c399fa13f17ccfea7c35f333b'/>
<id>urn:sha1:48f359bfafa7db4c399fa13f17ccfea7c35f333b</id>
<content type='text'>
During code review of some patches, it was noted that redirection operators
should have space before, but no space after them.

Signed-off-by: Tim Henigan &lt;tim.henigan@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>i18n: add infrastructure for translating Git with gettext</title>
<updated>2011-12-06T04:46:55Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2011-11-17T23:14:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5e9637c629702e3d41ad01d95956d1835d7338e0'/>
<id>urn:sha1:5e9637c629702e3d41ad01d95956d1835d7338e0</id>
<content type='text'>
Change the skeleton implementation of i18n in Git to one that can show
localized strings to users for our C, Shell and Perl programs using
either GNU libintl or the Solaris gettext implementation.

This new internationalization support is enabled by default. If
gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, Git falls back on its current behavior of
showing interface messages in English. When using the autoconf script
we'll auto-detect if the gettext libraries are installed and act
appropriately.

This change is somewhat large because as well as adding a C, Shell and
Perl i18n interface we're adding a lot of tests for them, and for
those tests to work we need a skeleton PO file to actually test
translations. A minimal Icelandic translation is included for this
purpose. Icelandic includes multi-byte characters which makes it easy
to test various edge cases, and it's a language I happen to
understand.

The rest of the commit message goes into detail about various
sub-parts of this commit.

= Installation

Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git itself.

= Perl

Perl code that's to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by default.

Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.

Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.

I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.

See &lt;AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com&gt; for
a further elaboration on this topic.

= Shell

Shell code that's to be localized should use the git-sh-i18n
library. It's basically just a wrapper for the system's gettext.sh.

If gettext.sh isn't available we'll fall back on gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.

If neither are present we'll use a dumb printf(1) fall-through
wrapper.

= About libcharset.h and langinfo.h

We use libcharset to query the character set of the current locale if
it's available. I.e. we'll use it instead of nl_langinfo if
HAVE_LIBCHARSET_H is set.

The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.

GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.

=Credits

This patch is based on work by Jeff Epler &lt;jepler@unpythonic.net&gt; who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Erik Faye-Lund, Peter Krefting, Junio C Hamano, Thomas Rast and
others.

[jc: squashed a small Makefile fix from Ramsay]

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Ramsay Jones &lt;ramsay@ramsay1.demon.co.uk&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: downcase placeholders in usage messages</title>
<updated>2011-02-15T19:53:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2011-02-15T19:02:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b1afe49dfbe9e91631bd011a47034fbf3ffd682e'/>
<id>urn:sha1:b1afe49dfbe9e91631bd011a47034fbf3ffd682e</id>
<content type='text'>
We accumulated some inconsistencies without an explicit guidance to spell
this out over time.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix typos in the documentation</title>
<updated>2011-01-04T19:23:42Z</updated>
<author>
<name>Ralf Wildenhues</name>
<email>Ralf.Wildenhues@gmx.de</email>
</author>
<published>2011-01-03T19:03:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=469bfc962df22a87f0f0c60699d91fa9e647492a'/>
<id>urn:sha1:469bfc962df22a87f0f0c60699d91fa9e647492a</id>
<content type='text'>
Signed-off-by: Ralf Wildenhues &lt;Ralf.Wildenhues@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sn/diff-doc'</title>
<updated>2010-12-04T00:10:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-12-04T00:10:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=45a7b55d6fe69581d12b83f63337eaa1015b6717'/>
<id>urn:sha1:45a7b55d6fe69581d12b83f63337eaa1015b6717</id>
<content type='text'>
* sn/diff-doc:
  docs: clarify git diff modes of operation
  diff,difftool: Don't use the {0,2} notation in usage strings
  CodingGuidelines: Add a section on writing documentation
</content>
</entry>
<entry>
<title>CodingGuidelines: mention whitespace preferences for shell scripts</title>
<updated>2010-12-03T23:22:59Z</updated>
<author>
<name>Giuseppe Bilotta</name>
<email>giuseppe.bilotta@gmail.com</email>
</author>
<published>2010-12-03T16:47:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f36a4fa8ef611c37c890ed21a388a5ece801a3de'/>
<id>urn:sha1:f36a4fa8ef611c37c890ed21a388a5ece801a3de</id>
<content type='text'>
Signed-off-by: Giuseppe Bilotta &lt;giuseppe.bilotta@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: Add a section on writing documentation</title>
<updated>2010-11-05T17:03:17Z</updated>
<author>
<name>Štěpán Němec</name>
<email>stepnem@gmail.com</email>
</author>
<published>2010-11-04T17:12:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=c455bd8950e0e5593949b746ad96d1449bbbf9d5'/>
<id>urn:sha1:c455bd8950e0e5593949b746ad96d1449bbbf9d5</id>
<content type='text'>
Provide a few examples on argument and option notation in usage strings
and command synopses.

Signed-off-by: Štěpán Němec &lt;stepnem@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: reword parameter expansion section</title>
<updated>2010-10-13T18:15:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-10-13T18:15:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=bc979945305b87caf1e5975d30d42bafd88ad846'/>
<id>urn:sha1:bc979945305b87caf1e5975d30d42bafd88ad846</id>
<content type='text'>
Group entries related to parameter substitutions together and avoid
using the word "regexp" to refer to the ${parameter/pattern/string}
substitution (banned), as the pattern there is a shell glob and not
a regular expression.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
