diff mbox series

CodingGuidelines: explicitly allow "local" for test scripts

Message ID xmqqfsz4a23x.fsf@gitster.g (mailing list archive)
State Superseded
Headers show
Series CodingGuidelines: explicitly allow "local" for test scripts | expand

Commit Message

Junio C Hamano May 3, 2021, 4:10 a.m. UTC
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 without 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 | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Eric Sunshine May 3, 2021, 4:21 a.m. UTC | #1
On Mon, May 3, 2021 at 12:11 AM Junio C Hamano <gitster@pobox.com> wrote:
> 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 without a shell that lacks support for
> the "local" keyword. [...]

Double negative whammy. Should be either:

    use a platform with a shell that lacks support

or:

    use a platform without a shell supporting "local"

Or I'm confused and misunderstanding what was written.
Junio C Hamano May 3, 2021, 5:21 a.m. UTC | #2
Eric Sunshine <sunshine@sunshineco.com> writes:

> Double negative whammy. Should be either:
>
>     use a platform with a shell that lacks support
>
> or:
>
>     use a platform without a shell supporting "local"
>
> Or I'm confused and misunderstanding what was written.

No, I just wasn't paying much attention to what I was writing X-<.
Thanks for spotting.
diff mbox series

Patch

diff --git c/Documentation/CodingGuidelines w/Documentation/CodingGuidelines
index 45465bc0c9..ea70676a30 100644
--- c/Documentation/CodingGuidelines
+++ w/Documentation/CodingGuidelines
@@ -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: