Skip to content

local VAR="VAL"

Junio C Hamano git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6CodingGuidelines: describe "export VAR=VAL" ruleDocumentation/CodingGuidelines+6 -05 replies
2/6CodingGuidelines: quote assigned value in 'local var=$val'Documentation/CodingGuidelines+14 -04 replies
3/6t: local VAR="VAL" (quote positional parameters)t/lib-parallel-checkout.sh t/t2400-worktree-add.sh t/t4210-log-i18n.sh +1 more+5 -52 replies
4/6t: local VAR="VAL" (quote command substitution)t/t4011-diff-symlink.sh t/test-lib-functions.sh+3 -30 replies
5/6t: local VAR="VAL" (quote ${magic-reference})t/test-lib-functions.sh+4 -40 replies
6/6t: teach lint that RHS of 'local VAR=VAL' needs to be quotedt/check-non-portable-shell.pl+2 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] local VAR="VAL"

* Update coding guidelines and test-lint script so that we quote the right hand side of assignment used with "local", which is buggy on certain versions of dash.

The first patch is not about the theme of the topic, but to document a rule enforced by the test-lint script that is not written down in the coding guidelines.

The second patch gives guidance to avoid the dash bug.

Patches [3/6], [4/6], and [5/6] are to adjust the existing tests. I think many of them are currently safe because the values they assign are $IFS safe, but some may be real workarounds for the dash bug.

The last patch introduces the test-lint pattern.

Junio C Hamano (6):
CodingGuidelines: describe "export VAR=VAL" rule
CodingGuidelines: quote assigned value in 'local var=$val'
t: local VAR="VAL" (quote positional parameters)
t: local VAR="VAL" (quote command substitution)
t: local VAR="VAL" (quote ${magic-reference})
t: teach lint that RHS of 'local VAR=VAL' needs to be quoted

 Documentation/CodingGuidelines | 20 ++++++++++++++++++++
 t/check-non-portable-shell.pl  |  2 ++
 t/lib-parallel-checkout.sh     |  2 +-
 t/t2400-worktree-add.sh        |  2 +-
 t/t4011-diff-symlink.sh        |  4 ++--
 t/t4210-log-i18n.sh            |  4 ++--
 t/test-lib-functions.sh        | 12 ++++++------
 7 files changed, 34 insertions(+), 12 deletions(-)
Signature · 1 line
2.44.0-501-g19981daefd