<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/CodingGuidelines, branch v2.20.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.20.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.20.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2018-10-19T04:34:05Z</updated>
<entry>
<title>Merge branch 'jc/how-to-document-api'</title>
<updated>2018-10-19T04:34:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-10-19T04:34:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0d4f473a985e5b5f15ae88fd8dda695a694b9955'/>
<id>urn:sha1:0d4f473a985e5b5f15ae88fd8dda695a694b9955</id>
<content type='text'>
Doc update.

* jc/how-to-document-api:
  CodingGuidelines: document the API in *.h files
</content>
</entry>
<entry>
<title>Documentation: add shell guidelines</title>
<updated>2018-10-06T23:51:17Z</updated>
<author>
<name>Matthew DeVore</name>
<email>matvore@google.com</email>
</author>
<published>2018-10-05T21:54:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a378fee5b0795d671722d803b93b7b32941c0067'/>
<id>urn:sha1:a378fee5b0795d671722d803b93b7b32941c0067</id>
<content type='text'>
Add the following guideline to Documentation/CodingGuidelines:

	Break overlong lines after "&amp;&amp;", "||", and "|", not before
	them; that way the command can continue to subsequent lines
	without backslash at the end.

And the following to t/README (since it is specific to writing tests):

	Pipes and $(git ...) should be avoided when they swallow exit
	codes of Git processes

Signed-off-by: Matthew DeVore &lt;matvore@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: document the API in *.h files</title>
<updated>2018-09-29T18:18:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2018-09-28T16:50:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d9f079ad1a866151fea01f7f977dfbd1ba4d97f7'/>
<id>urn:sha1:d9f079ad1a866151fea01f7f977dfbd1ba4d97f7</id>
<content type='text'>
It makes it harder to let the API description and the reality drift
apart if the doc is kept close to the implementation or the header
of the API.  We have been slowly migrating API docs out of the
Documentation/technical/api-* to *.h files, and the development
community generally considers that how inline docs in strbuf.h is
done the best current practice.

We recommend documenting in the header over documenting near the
implementation to encourage people to write the docs that are
readable without peeking at the implemention.

Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: mention "static" and "extern"</title>
<updated>2018-02-08T22:20:43Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2018-02-08T21:38:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89a9f2c862db52d99e4dd78e799f4b36dac597ac'/>
<id>urn:sha1:89a9f2c862db52d99e4dd78e799f4b36dac597ac</id>
<content type='text'>
It perhaps goes without saying that file-local stuff should
be marked static, but it does not hurt to remind people.

Less obvious is that we are settling on "do not include
extern in function declarations". It is already the default
unless the function was previously declared static (but if
you are following a static declaration with an unmarked one,
you should think about why you are declaring the thing
twice). And so it just becomes an extra noise-word in our
header files.

We used to give the opposite advice, so there are quite a
few "extern" markers in early Git code. But this at least
makes a concrete suggestion that we can follow going
forward.

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>Merge branch 'ab/c-translators-comment-style'</title>
<updated>2017-06-04T00:55:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-06-04T00:55:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c5da34c12481ff6edc3f46463cbf43efe856308e'/>
<id>urn:sha1:c5da34c12481ff6edc3f46463cbf43efe856308e</id>
<content type='text'>
Update the C style recommendation for notes for translators, as
recent versions of gettext tools can work with our style of
multi-line comments.

* ab/c-translators-comment-style:
  C style: use standard style for "TRANSLATORS" comments
</content>
</entry>
<entry>
<title>C style: use standard style for "TRANSLATORS" comments</title>
<updated>2017-05-30T23:01:42Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2017-05-11T21:20:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=66f5f6dca95eda46bf02c8d06de8cb265995fd6e'/>
<id>urn:sha1:66f5f6dca95eda46bf02c8d06de8cb265995fd6e</id>
<content type='text'>
Change all the "TRANSLATORS: [...]" comments in the C code to use the
regular Git coding style, and amend the style guide so that the
example there uses that style.

This custom style was necessary back in 2010 when the gettext support
was initially added, and was subsequently documented in commit
cbcfd4e3ea ("i18n: mention "TRANSLATORS:" marker in
Documentation/CodingGuidelines", 2014-04-18).

GNU xgettext hasn't had the parsing limitation that necessitated this
exception for almost 3 years. Since its 0.19 release on 2014-06-02
it's been able to recognize TRANSLATOR comments in the standard Git
comment syntax[1].

Usually we'd like to keep compatibility with software that's that
young, but in this case literally the only person who needs to be
using a gettext newer than 3 years old is Jiang Xin (the only person
who runs &amp; commits "make pot" results), so I think in this case we can
make an exception.

This xgettext parsing feature was added after a thread on the Git
mailing list[2] which continued on the bug-gettext[3] list, but we
never subsequently changed our style &amp; styleguide, do so.

There are already longstanding changes in git that use the standard
comment style &amp; have their TRANSLATORS comments extracted properly
without getting the literal "*"'s mixed up in the text, as would
happen before xgettext 0.19.

Commit 7ff2683253 ("builtin-am: implement -i/--interactive",
2015-08-04) added one such comment, which in commit df0617bfa7 ("l10n:
git.pot: v2.6.0 round 1 (123 new, 41 removed)", 2015-09-05) got picked
up in the po/git.pot file with the right format, showing that Jiang
already runs a modern xgettext.

The xgettext parser does not handle the sort of non-standard comment
style that I'm amending here in sequencer.c, but that isn't standard
Git comment syntax anyway. With this change to sequencer.c &amp; "make
pot" the comment in the pot file is now correct:

     #. TRANSLATORS: %s will be "revert", "cherry-pick" or
    -#. * "rebase -i".
    +#. "rebase -i".

1. http://git.savannah.gnu.org/cgit/gettext.git/commit/?id=10af7fe6bd
2. &lt;2ce9ec406501d112e032c8208417f8100bed04c6.1397712142.git.worldhello.net@gmail.com&gt;
   (https://public-inbox.org/git/2ce9ec406501d112e032c8208417f8100bed04c6.1397712142.git.worldhello.net@gmail.com/)
3. https://lists.gnu.org/archive/html/bug-gettext/2014-04/msg00016.html

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Acked-by: Jiang Xin &lt;worldhello.net@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: replace a couple of broken gmane links</title>
<updated>2017-05-08T01:29:30Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2017-05-05T10:08:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2e477d8d71709120023987f52a93721100ad0f26'/>
<id>urn:sha1:2e477d8d71709120023987f52a93721100ad0f26</id>
<content type='text'>
Replace a couple of broken links to gmane with links to other
archives. See commit 54471fdcc3 ("README: replace gmane link with
public-inbox", 2016-12-15) for prior art.

With this change there's still 4 references left in the code:

    $ git grep -E '(article|thread)\.gmane.org' -- |grep -v RelNotes|wc -l
    4

I couldn't find alternative links for those.

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: clarify multi-line brace style</title>
<updated>2017-01-17T22:32:47Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-01-17T20:05:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1797dc51766576453c64fd422e25741ead9b2687'/>
<id>urn:sha1:1797dc51766576453c64fd422e25741ead9b2687</id>
<content type='text'>
There are some "gray areas" around when to omit braces from
a conditional or loop body. Since that seems to have
resulted in some arguments, let's be a little more clear
about our preferred style.

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>CodingGuidelines: formatting HEAD in documentation</title>
<updated>2016-06-28T15:36:45Z</updated>
<author>
<name>Matthieu Moy</name>
<email>Matthieu.Moy@imag.fr</email>
</author>
<published>2016-06-28T11:40:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=57103dbf702557abefc7c8c4578145f9383d6e9d'/>
<id>urn:sha1:57103dbf702557abefc7c8c4578145f9383d6e9d</id>
<content type='text'>
The current practice is:

git/Documentation$ git grep "'HEAD'" | wc -l
24
git/Documentation$ git grep "\`HEAD\`" | wc -l
66

Let's adopt the majority as a guideline.

Signed-off-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: clearer rule about formatting literals</title>
<updated>2016-06-08T19:04:37Z</updated>
<author>
<name>Tom Russello</name>
<email>tom.russello@grenoble-inp.org</email>
</author>
<published>2016-06-07T22:35:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=41f5b21f84b4d7db8e8c6edb34682c0f840ad8c8'/>
<id>urn:sha1:41f5b21f84b4d7db8e8c6edb34682c0f840ad8c8</id>
<content type='text'>
Make the guideline text that we want for our documentation clearer.

Signed-off-by: Tom Russello &lt;tom.russello@grenoble-inp.org&gt;
Signed-off-by: Erwan Mathoniere &lt;erwan.mathoniere@grenoble-inp.org&gt;
Signed-off-by: Samuel Groot &lt;samuel.groot@grenoble-inp.org&gt;
Signed-off-by: Matthieu Moy &lt;matthieu.moy@grenoble-inp.fr&gt;
Reviewed-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
