git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 6, 2024, 00:08 UTC
Message-ID
<20240406000902.3082301-1-gitster@pobox.com>
* 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(-)
-- 
2.44.0-501-g19981daefd
Next: Junio C Hamano
Message 1 of 23 in “local VAR="VAL"”
  1. 0/6 local VAR="VAL"Junio C Hamano, Apr 6, 2024
  2. 1/6 CodingGuidelines: describe "export VAR=VAL" ruleJunio C Hamano, Apr 6, 2024
  3. Eric SunshineApr 6, 2024
  4. Junio C HamanoApr 6, 2024
  5. Andreas SchwabApr 6, 2024
  6. Junio C HamanoApr 6, 2024
  7. Eric SunshineApr 6, 2024
  8. 3/6 t: local VAR="VAL" (quote positional parameters)Junio C Hamano, Apr 6, 2024
  9. Patrick SteinhardtApr 8, 2024
  10. Junio C HamanoApr 8, 2024
  11. 2/6 CodingGuidelines: quote assigned value in 'local var=$val'Junio C Hamano, Apr 6, 2024
  12. rsbecker@nexbridge.comApr 6, 2024
  13. Junio C HamanoApr 6, 2024
  14. Eric SunshineApr 6, 2024
  15. Junio C HamanoApr 6, 2024
  16. 4/6 t: local VAR="VAL" (quote command substitution)Junio C Hamano, Apr 6, 2024
  17. 5/6 t: local VAR="VAL" (quote ${magic-reference})Junio C Hamano, Apr 6, 2024
  18. 6/6 t: teach lint that RHS of 'local VAR=VAL' needs to be quotedJunio C Hamano, Apr 6, 2024
  19. Jeff KingApr 7, 2024
  20. Junio C HamanoApr 8, 2024
  21. Jeff KingApr 8, 2024
  22. 7/6 t0610: local VAR="VAL" fixJunio C Hamano, Apr 6, 2024
  23. 8/6 t1016: local VAR="VAL" fixJunio C Hamano, Apr 6, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.