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

Re: Report of use of "local" per t0000-basic.sh

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 24, 2019, 04:24 UTC
Message-ID
<xmqqwobp2961.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20191123041616.GD6430@camp.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> I think it's fine that we restrict the use of local to within a
> function.  In fact, dash (Debian and Ubuntu's default /bin/sh) exits
> unsuccessfully if you use local outside of a function.
All of the above sounds quite sensible.
> Is there some place in particular that you've found we're using it
> outside of a function?  I don't know about others, but I'm certainly
> interested in fixing these.  It looks like we do use it in a function in
> t0000 itself, though.

Yup, we definitely should fix it if there is a use of "local" at the top-level outside a function that does not make sense. The one in the t0000 that tests if "local" behaves the way we expect it to looks OK to me.

Previous: brian m. carlsonNext: Randall S. Becker
Message 3 of 4 in “Report of use of "local" per t0000-basic.sh”
  1. Randall S. BeckerNov 22, 2019
  2. brian m. carlsonNov 23, 2019
  3. Junio C HamanoNov 24, 2019
  4. Randall S. BeckerNov 25, 2019

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.