From: Junio C Hamano Date: Thu, 17 Jun 2021 00:36:36 GMT Subject: Re: [PATCH] test-lib: fix "$remove_trash" regression and match_pattern_list() bugs Message-ID: In-Reply-To: <87pmwmxd6f.fsf@evledraar.gmail.com> Ævar Arnfjörð Bjarmason writes: >> 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.