From: Junio C Hamano Date: Fri, 17 May 2013 16:48:26 GMT Subject: Re: [PATCH 2/6] test-lib: refactor $GIT_SKIP_TESTS matching Message-ID: <7vfvxl1rj9.fsf@alter.siamese.dyndns.org> In-Reply-To: <87y5beav7d.fsf@linux-k42r.v.cablecom.net> Thomas Rast writes: > Johannes Sixt writes: > >> Am 5/16/2013 22:50, schrieb Thomas Rast: >>> +match_pattern_list () { >>> + arg="$1" >>> + shift >>> + test -z "$*" && return 1 >>> + for pat in $@ >> >> You should have double-quotes around $@ here, but then you can just as >> well abbreviate to >> >> for pat >> >> and you don't need the 'test -z "$*' check anymore. > > Hmm, actually the quotes wouldn't help, because it currently reads > > - for skp in $GIT_SKIP_TESTS > - do > - case $this_test.$test_count in > - $skp) > - to_skip=t > - break > - esac > - done > > so the splitting already happens, and in fact needs to, so that one can > pass multiple patterns. Or am I missing something? I think you read it right. I do pass multiple test number patterns regularly and not quoting there is exactly for support that. > But the 'for pat' with implicit $@ sounds nice regardless, thanks. 'for pat' is equivalent to 'for pat in "$@"', not 'for pat in $@'; would it still be useful when you need them split at $IFS?