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

Re: [PATCH] t5582: remove spurious 'cd "$D"' line

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 30, 2021, 19:51 UTC
Message-ID
<xmqqwno23e3l.fsf@gitster.g>
In-Reply-To
<YS0qbgQhRP6XI7aj@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 14 quoted lines
> Just throwing "set -u" at the top of test-lib.sh shows many issues:
>
>   - we don't initialize some known variables, like say, verbose_only. It
>     might be reasonable to have a big list of:
>
>       verbose_only=
>       verbose=
>
>     etc. That would probably be an improvement, though a slight
>     maintenance burden.
>
>       : ${GIT_TEST_CMP:=}
>
>     near the top of the script to pre-declare all such variables.

These two are sensible clean-up, I would think, whether we aim to achieve "set -u" cleanness. The original issue triggered this thread was about $D that can be confused by a leaked environment variable, but these "known variables" that are not assigned to in the early part of the tests are inviting similar troubles.

Thanks.
Previous: Jeff King
Message 10 of 10 in “t5582: remove spurious 'cd "$D"' line”
  1. t5582: remove spurious 'cd "$D"' lineMickey Endito, Aug 23, 2021
  2. Junio C HamanoAug 23, 2021
  3. SZEDER GáborAug 24, 2021
  4. Junio C HamanoAug 24, 2021
  5. Jeff KingAug 25, 2021
  6. Junio C HamanoAug 25, 2021
  7. SZEDER GáborAug 28, 2021
  8. Junio C HamanoAug 30, 2021
  9. Jeff KingAug 30, 2021
  10. Junio C HamanoAug 30, 2021

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.