Thread (1 message) 1 message, 1 author, 2021-06-17

Re: [PATCH] test-lib: fix "$remove_trash" regression and match_pattern_list() bugs

From: Junio C Hamano <hidden>
Date: 2021-06-17 00:36:42

Ævar Arnfjörð Bjarmason [off-list ref] writes:
quoted
Whatever the expansion mechanism, I do think it's worth having callers
quote "$GIT_SKIP_TESTS" and then performing the expansion within
match_pattern_list. Then the nasty mechanics are all in that one place.
I think it's rather clean to not quote it, i.e. to have the loop get a
list of item and then things to match, it would also make it easier to
e.g. port it to a native C program.
Sorry, I am not sure how it can work without quoting $GIT_SKIP_TESTS
and exposing the details of how we disable globbing when the caller
calls match_pattern_list.

A list of item in $GIT_SKIP_TESTS would not be able to pass t?000 in
it intact to the loop that processes each of the item on the list.

	for pattern in $GIT_SKIP_TESTS
	do
		attempt to match with $pattern
	done

will see t5000 in $pattern due to globbing.  It's not like "$@"
trick can be applied to any plain variable.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help