All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Andrei Rybak" <rybak.a.v@gmail.com>,
	git@vger.kernel.org
Subject: Re: [BUG] range expressions in GIT_SKIP_TESTS are broken in master (was [BUG] question mark in GIT_SKIP_TESTS is broken in master)
Date: Wed, 16 Jun 2021 18:19:12 +0900	[thread overview]
Message-ID: <xmqqim2ep3ov.fsf@gitster.g> (raw)
In-Reply-To: <YMm2Wlb+eJDL7+ua@coredump.intra.peff.net> (Jeff King's message of "Wed, 16 Jun 2021 04:29:14 -0400")

Jeff King <peff@peff.net> writes:

> 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.



  reply	other threads:[~2021-06-16  9:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 20:55 [BUG] question mark in GIT_SKIP_TESTS is broken in master Andrei Rybak
2021-06-15 23:28 ` [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
2021-06-16  3:28   ` Junio C Hamano
2021-06-16  4:12     ` Junio C Hamano
2021-06-16  8:29       ` Jeff King
2021-06-16  9:19         ` Junio C Hamano [this message]
2021-06-16  8:24     ` [PATCH] test-lib: fix "$remove_trash" regression and match_pattern_list() bugs Ævar Arnfjörð Bjarmason
2021-06-16  8:36       ` Jeff King
2021-06-16  9:22         ` Junio C Hamano
2021-06-16 10:23           ` Jeff King
2021-06-16 10:24             ` Jeff King
2021-06-16 11:38             ` Ævar Arnfjörð Bjarmason
2021-06-16 11:50               ` Jeff King
2021-06-17  0:29                 ` Junio C Hamano
2021-06-16  9:49         ` Ævar Arnfjörð Bjarmason
2021-06-16 11:43           ` Jeff King
2021-06-17  0:36           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqim2ep3ov.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=rybak.a.v@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.