]> git.ipfire.org Git - thirdparty/git.git/commitdiff
CodingGuidelines: explicitly allow "local" for test scripts
authorJunio C Hamano <gitster@pobox.com>
Mon, 3 May 2021 05:23:24 +0000 (14:23 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 May 2021 05:24:11 +0000 (14:24 +0900)
01d3a526 (t0000: check whether the shell supports the "local"
keyword, 2017-10-26) raised a test balloon to see if those who build
and test Git use a platform with a shell that lacks support for the
"local" keyword.  After two years, 7f0b5908 (t0000: reword comments
for "local" test, 2019-08-08) documented that "local" keyword, even
though is outside POSIX, is allowed in our test scripts.

Let's write it in the CodingGuidelines, too.  It might be tempting
to allow it in scripted Porcelains (we have avoided getting them
contaminiated by "local" so far), but they are on their way out and
getting rewritten in C.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/CodingGuidelines

index 45465bc0c98f5d88cfe1ade092d29b5dc32c1e23..ea70676a304dfa0c96394900dc4d67ac3efe4aac 100644 (file)
@@ -175,6 +175,11 @@ For shell scripts specifically (not exhaustive):
 
    does not have such a problem.
 
+ - Even though "local" is not part of POSIX, we make heavy use of it
+   in our test suite.  We do not use it in scripted Porcelains, and
+   hopefully nobody starts using "local" before they are reimplemented
+   in C ;-)
+
 
 For C programs: