summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-04-06 00:08:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2024-04-06 05:48:12 (GMT)
commit7e3a9c23d670347454c6b95e3e6448c9d77fbdc4 (patch)
tree21a412a04d64ca48be41e83679dcb8f03458531c /Documentation
parent19981daefd7c147444462739375462b49412ce33 (diff)
downloadgit-7e3a9c23d670347454c6b95e3e6448c9d77fbdc4.zip
git-7e3a9c23d670347454c6b95e3e6448c9d77fbdc4.tar.gz
git-7e3a9c23d670347454c6b95e3e6448c9d77fbdc4.tar.bz2
CodingGuidelines: describe "export VAR=VAL" rule
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 <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/CodingGuidelines4
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 32e69f7..96eaeee 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -188,6 +188,10 @@ For shell scripts specifically (not exhaustive):
hopefully nobody starts using "local" before they are reimplemented
in C ;-)
+ - Some versions of shell do not understand "export variable=value",
+ so we write "variable=value" and then "export variable" on two
+ separate lines.
+
- Use octal escape sequences (e.g. "\302\242"), not hexadecimal (e.g.
"\xc2\xa2") in printf format strings, since hexadecimal escape
sequences are not portable.