]> git.ipfire.org Git - thirdparty/git.git/commitdiff
CodingGuidelines: drop arithmetic expansion advice to use "$x"
authorJeff King <peff@peff.net>
Mon, 4 May 2020 16:07:09 +0000 (12:07 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 May 2020 19:36:07 +0000 (12:36 -0700)
The advice to use "$x" rather than "x" in arithmetric expansion was
working around a dash bug fixed in 0.5.4. Even Debian oldstable has
0.5.8 these days. And in the meantime, we've added almost two dozen
instances of the "x" form which you can find with:

  git grep '$(([a-z]'

and nobody seems to have complained. Let's declare this workaround
obsolete and simplify our style guide.

Helped-by: Danh Doan <congdanhqx@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/CodingGuidelines

index ed4e443a3cd99f8f86b88951e42509f49b14f638..6fc85caffae99fb632b100d370e0db8df52d1780 100644 (file)
@@ -97,10 +97,6 @@ For shell scripts specifically (not exhaustive):
 
  - We use Arithmetic Expansion $(( ... )).
 
- - Inside Arithmetic Expansion, spell shell variables with $ in front
-   of them, as some shells do not grok $((x)) while accepting $(($x))
-   just fine (e.g. dash older than 0.5.4).
-
  - We do not use Process Substitution <(list) or >(list).
 
  - Do not write control structures on a single line with semicolon.