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
Johannes Sixt <j6t@kdbg.org>
Date
Jan 15, 2010, 19:16 UTC
Message-ID
<201001152017.00121.j6t@kdbg.org>
In-Reply-To
<7vljfzz0yd.fsf@alter.siamese.dyndns.org>
On Freitag, 15. Januar 2010, Junio C Hamano wrote:
Show 22 quoted lines
> Johannes Sixt <j.sixt@viscovery.net> writes:
> > 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,

These are exactly the definitions that I meant. The statement that variables are not exported is in "2.9.1 Simple Commands" http://www.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01

"[If there is a command name], the variable assignments shall be exported for the execution environment of the command and shall not affect the current execution environment (except for special built-ins)."

> 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.

I knew these spots, and they were discussed when that code was introduced. Before I sent out the mail you were responding to, I tried various ways to show the failure in rebase--interactive, but it didn't fail...

-- Hannes
Previous: Junio C HamanoNext: Junio C Hamano
Message 28 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.