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

Re: [BUG] range expressions in GIT_SKIP_TESTS are broken in master (was [BUG] question mark in GIT_SKIP_TESTS is broken in master)

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 16, 2021, 09:19 UTC
Message-ID
<xmqqim2ep3ov.fsf@gitster.g>
In-Reply-To
<YMm2Wlb+eJDL7+ua@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 19 quoted lines
> It's surprisingly hard to do field-splitting without pathname globbing
> in pure shell. I couldn't find a way without using "set -f". That's in
> POSIX, but it feels funny tweaking a global that can effect how other
> code runs. We can at least constraint it to a subshell close to the
> point of use:
> ...
> -	for pattern_
> +	(set -f
> +	for pattern_ in $*
>  	do
>  		case "$arg" in
>  		$pattern_)
> -			return 0
> +			exit 0
>  		esac
>  	done
> -	return 1
> +	exit 1)
>  }

Nice. "set -f" is what I wanted to find myself but couldn't, when I wrote the message you are responding to.

> -if match_pattern_list "$this_test" $GIT_SKIP_TESTS
> +if match_pattern_list "$this_test" "$GIT_SKIP_TESTS"

OK. 'for pattern_ in $*' that flattens $* allows us to quote it here, passing it as a single argument without globbing.

Previous: Jeff KingNext: Ævar Arnfjörð Bjarmason
Message 6 of 17 in “[BUG] question mark in GIT_SKIP_TESTS is broken in master”
  1. Andrei RybakJun 15, 2021
  2. [BUG] range expressions in GIT_SKIP_TESTS are broken in master (was [BUG] question mark in GIT_SKIP_TESTS is broken in master)Andrei Rybak, Jun 15, 2021
  3. Junio C HamanoJun 16, 2021
  4. Junio C HamanoJun 16, 2021
  5. Jeff KingJun 16, 2021
  6. Junio C HamanoJun 16, 2021
  7. test-lib: fix "$remove_trash" regression and match_pattern_list() bugsÆvar Arnfjörð Bjarmason, Jun 16, 2021
  8. Jeff KingJun 16, 2021
  9. Junio C HamanoJun 16, 2021
  10. Jeff KingJun 16, 2021
  11. Jeff KingJun 16, 2021
  12. Ævar Arnfjörð BjarmasonJun 16, 2021
  13. Jeff KingJun 16, 2021
  14. Junio C HamanoJun 17, 2021
  15. Ævar Arnfjörð BjarmasonJun 16, 2021
  16. Jeff KingJun 16, 2021
  17. Junio C HamanoJun 17, 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.