]> Kevux Git Server - rit/commitdiff
CodingGuidelines: allow ${#posix} == strlen($posix)
authorJunio C Hamano <gitster@pobox.com>
Sun, 29 Mar 2020 03:06:53 +0000 (20:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 29 Mar 2020 15:41:54 +0000 (08:41 -0700)
The construct has been in POSIX for the past 10+ years, and we have
used in t9xxx (subversion) series of the tests, so we know it is at
portable across systems that people have run those tests, which is
almost everything we'd care about.

Let's loosen the rule; luckily, the check-non-portable-shell script
does not have any rule to find its use, so the only change needed is
a removal of one paragraph from the documentation.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/CodingGuidelines

index f45db5b..af50c70 100644 (file)
@@ -91,8 +91,6 @@ For shell scripts specifically (not exhaustive):
 
    - No shell arrays.
 
-   - No strlen ${#parameter}.
-
    - No pattern replacement ${parameter/pattern/string}.
 
  - We use Arithmetic Expansion $(( ... )).