<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/CodingGuidelines, branch v2.46.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.46.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.46.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-09-13T22:26:51Z</updated>
<entry>
<title>Merge branch 'jc/coding-style-c-operator-with-spaces' into maint-2.46</title>
<updated>2024-09-13T22:26:51Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-09-13T22:26:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bb57f055aeede67cb2ff68a6cf96dbd9dc8a6321'/>
<id>urn:sha1:bb57f055aeede67cb2ff68a6cf96dbd9dc8a6321</id>
<content type='text'>
Write down whitespacing rules around C opeators.

* jc/coding-style-c-operator-with-spaces:
  CodingGuidelines: spaces around C operators
</content>
</entry>
<entry>
<title>Merge branch 'jc/document-use-of-local' into maint-2.46</title>
<updated>2024-08-26T18:10:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-08-26T18:10:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b452be06ffc425b0e7616e09b13f692d2a1aef3a'/>
<id>urn:sha1:b452be06ffc425b0e7616e09b13f692d2a1aef3a</id>
<content type='text'>
Doc update.

* jc/document-use-of-local:
  doc: note that AT&amp;T ksh does not work with our test suite
</content>
</entry>
<entry>
<title>CodingGuidelines: spaces around C operators</title>
<updated>2024-08-20T21:10:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-08-20T20:36:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44db6f75cce574a0e410df5be61d40f28ec16f0a'/>
<id>urn:sha1:44db6f75cce574a0e410df5be61d40f28ec16f0a</id>
<content type='text'>
As we have operated with "write like how your surrounding code is
written" for too long, after a huge code drop from another project,
we'll end up being inconsistent before such an imported code is
cleaned up.  We have many uses of cast operator with a space before
its operand, mostly in the reftable code.

Spell the convention out before it spreads to other places.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: document a shell that "fails" "VAR=VAL shell_func"</title>
<updated>2024-07-23T15:28:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-07-23T00:04:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=728a1962cdaf7df6a1f261dcf3167842cd2db170'/>
<id>urn:sha1:728a1962cdaf7df6a1f261dcf3167842cd2db170</id>
<content type='text'>
Over the years, we accumulated the community wisdom to avoid the
common "one-short export" construct for shell functions, but seem to
have lost on which exact platform it is known to fail.  Now during
an investigation on a breakage for a recent topic, we found one
example of failing shell.  Let's document that.

This does *not* mean that we can freely start using the construct
once Ubuntu 20.04 is retired.  But it does mean that we cannot use
the construct until Ubuntu 20.04 is fully retired from the machines
that matter.  Moreover, posix explicitly says that the behaviour for
the construct is unspecified.

Helped-by: Kyle Lippincott &lt;spectral@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: note that AT&amp;T ksh does not work with our test suite</title>
<updated>2024-07-15T17:14:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-07-15T15:05:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=67be8c4de5255efd95c48c9ddd6cd8537fbf03d1'/>
<id>urn:sha1:67be8c4de5255efd95c48c9ddd6cd8537fbf03d1</id>
<content type='text'>
The scripted Porcelain commands do not allow use of "local" because
it is not universally supported, but we use it liberally in our test
scripts, which means some POSIX compliant shells (like "ksh93") can
not be used to run our tests.

Document the status quo, to help the next person who gets perplexed
seeing our tests fail.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/local-extern-shell-rules'</title>
<updated>2024-04-16T21:50:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-04-16T21:50:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=92e8388bd35cdddf312011a98e046706bb420fce'/>
<id>urn:sha1:92e8388bd35cdddf312011a98e046706bb420fce</id>
<content type='text'>
Document and apply workaround for a buggy version of dash that
mishandles "local var=val" construct.

* jc/local-extern-shell-rules:
  t1016: local VAR="VAL" fix
  t0610: local VAR="VAL" fix
  t: teach lint that RHS of 'local VAR=VAL' needs to be quoted
  t: local VAR="VAL" (quote ${magic-reference})
  t: local VAR="VAL" (quote command substitution)
  t: local VAR="VAL" (quote positional parameters)
  CodingGuidelines: quote assigned value in 'local var=$val'
  CodingGuidelines: describe "export VAR=VAL" rule
</content>
</entry>
<entry>
<title>CodingGuidelines: quote assigned value in 'local var=$val'</title>
<updated>2024-04-06T05:50:05Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-04-06T00:08:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=be34b51049d1628d1ba4f17e3c087fd01f15f988'/>
<id>urn:sha1:be34b51049d1628d1ba4f17e3c087fd01f15f988</id>
<content type='text'>
Dash bug https://bugs.launchpad.net/ubuntu/+source/dash/+bug/139097
lets the shell erroneously perform field splitting on the expansion
of a command substitution during declaration of a local or an extern
variable.

The explanation was stolen from ebee5580 (parallel-checkout: avoid
dash local bug in tests, 2021-06-06).

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>CodingGuidelines: describe "export VAR=VAL" rule</title>
<updated>2024-04-06T05:48:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-04-06T00:08:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7e3a9c23d670347454c6b95e3e6448c9d77fbdc4'/>
<id>urn:sha1:7e3a9c23d670347454c6b95e3e6448c9d77fbdc4</id>
<content type='text'>
https://lore.kernel.org/git/201307081121.22769.tboegi@web.de/
resulted in 9968ffff (test-lint: detect 'export FOO=bar',
2013-07-08) to add a rule to t/check-non-portable-shell.pl script to
reject

	export VAR=VAL

and suggest us to instead write it as two statements, i.e.,

	VAR=VAL
	export VAR

This however was not spelled out in the CodingGuidelines document.

We may want to re-evaluate the rule since it is from ages ago, but
for now, let's make the written rule and what the automation
enforces consistent.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: rework CodingGuidelines with new formatting rules</title>
<updated>2024-03-29T17:57:40Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2024-03-29T11:19:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c42ea60495897884f2daff011026661c1819eb65'/>
<id>urn:sha1:c42ea60495897884f2daff011026661c1819eb65</id>
<content type='text'>
Literal and placeholder formatting is more heavily enforced, with some
asciidoc magic. Basically, the markup is preserved everywhere.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/doc-compat-util'</title>
<updated>2024-03-05T17:44:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-03-05T17:44:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=53929db7c4962c967ee56e586264c278b29c313c'/>
<id>urn:sha1:53929db7c4962c967ee56e586264c278b29c313c</id>
<content type='text'>
Clarify wording in the CodingGuidelines that requires &lt;git-compat-util.h&gt;
to be the first header file.

* jc/doc-compat-util:
  doc: clarify the wording on &lt;git-compat-util.h&gt; requirement
</content>
</entry>
</feed>
