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

Re: [PATCH v2] Test t5560: Fix test when run with dash

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 15, 2010, 18:18 UTC
Message-ID
<7vljfzz0yd.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4B5027B8.2090507@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
Show 8 quoted lines
> Tarmigan Casebolt schrieb:
>>         REQUEST_METHOD="GET" some_shell_function
>
>> I can't tell from my reading of the POSIX spec whether my usage was
>> wrong or if dash is wrong,
>
> According to POSIX, variables set as shown above for shell functions are
> not exported and retain their value after the function returns.

I actually looked for this yesterday, but didn't find a relevant definition. But "2.9.5 Function Definition Command" [*1*] seems to address the issue: "When a function is executed, it shall have the syntax-error and variable-assignment properties described for special built-in utilities...".

And "2.14 Special Built-in Utilities" section [*2*] says "2. Variable assignments specified with special built-in utilities remain in effect after the built-in completes...". Taking both together, it seems that the assignment should be in effect after the function returns.

Does my reading match yours, or do you have more definitive descriptions you can point at in POSIX.1, so that the log message can be improved to help people avoid this issue in the future?

Yesterday, I saw rebase--interactive has a few codepaths where "output" shell function was used with the single-shot export; perhaps they need to also be fixed.

[References]

*1* http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_05 *2* http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_14

Previous: Johannes SixtNext: Johannes Sixt
Message 27 of 31 in “Smart-http tests: Break test t5560-http-backend into pieces”
  1. 1/2 Smart-http tests: Break test t5560-http-backend into piecesTarmigan Casebolt, Dec 28, 2009
  2. 2/2 Smart-http tests: Test http-backend without curl or a webserverTarmigan Casebolt, Dec 28, 2009
  3. Junio C HamanoDec 30, 2009
  4. TarmiganDec 30, 2009
  5. 1/2 Smart-http tests: Break test t5560-http-backend into piecesTarmigan Casebolt, Dec 30, 2009
  6. 2/2 Smart-http tests: Test http-backend without curl or a webserverTarmigan Casebolt, Dec 30, 2009
  7. Junio C HamanoJan 1, 2010
  8. TarmiganJan 2, 2010
  9. 1/3 Smart-http tests: Improve coverage in test t5560Tarmigan Casebolt, Jan 2, 2010
  10. Shawn O. PearceJan 2, 2010
  11. 2/3 Smart-http tests: Break test t5560-http-backend into piecesTarmigan Casebolt, Jan 2, 2010
  12. Shawn O. PearceJan 2, 2010
  13. 1/3 Smart-http tests: Improve coverage in test t5560Tarmigan Casebolt, Jan 2, 2010
  14. 2/3 Smart-http tests: Break test t5560-http-backend into piecesTarmigan Casebolt, Jan 2, 2010
  15. 3/3 Smart-http tests: Test http-backend without curl or a webserverTarmigan Casebolt, Jan 2, 2010
  16. 3/3 Smart-http tests: Test http-backend without curl or a webserverTarmigan Casebolt, Jan 2, 2010
  17. Shawn O. PearceJan 2, 2010
  18. TarmiganJan 2, 2010
  19. Shawn O. PearceJan 2, 2010
  20. 3/3 Smart-http tests: Test http-backend without curl or a webserverTarmigan Casebolt, Jan 2, 2010
  21. Michael HaggertyJan 14, 2010
  22. Test t5560: Fix test when run with dashTarmigan Casebolt, Jan 14, 2010
  23. Michael HaggertyJan 14, 2010
  24. Junio C HamanoJan 14, 2010
  25. Test t5560: Fix test when run with dashTarmigan Casebolt, Jan 15, 2010
  26. Johannes SixtJan 15, 2010
  27. Junio C HamanoJan 15, 2010
  28. Johannes SixtJan 15, 2010
  29. Junio C HamanoJan 15, 2010
  30. Junio C HamanoJan 16, 2010
  31. Michael HaggertyJan 21, 2010

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.