Subject: Re: [PATCH v2 1/3] test-lib: allow selecting tests by substring/regex with --run

From: Junio C Hamano <[email-masked]>
Date: Thu, 15 Oct 2020 08:59:21 -0700

Elijah Newren <[email-masked]> writes:

> On Wed, Oct 14, 2020 at 12:24 PM Junio C Hamano <[email-masked]> wrote:
>>
>> > > If you define the pattern is not regexp but is glob, you can use
>> > > case/esac to do this without any forking.
>> >
>> > Yes, that would probably be OK for most purposes, though I admit my real
>> > love for regex support is the ability to use "." instead of space to
>> > avoid quoting arguments. ;)
>>
>> I use "?" for the same purpose for globs. For things that are casual,
>> I find that
>> it tends to make the end-user (read: my) experience simpler to use globs than
>> to use regexp, largely for your ".*" vs "*" reasons.
>
> Oh, I thought you were arguing for globs over regexes here just due to
> performance reasons.

Heh, but no, not me.

You and Peff were the ones who were talking about performance by
counting forks.  I more often than others come from usability's
point of view.  When we are not dealing with uncontrollable and
unbounded possiblity of end-user generated contents, I find it
easier to forego the power and flexibility of regexp and instead
settle on simpler globs---matching against the test titles is a
good example use case, I would imagine.

But if we are exposing regexp to those who run and debug test
scripts already, I am perfectly fine with using regexp with 'expr'.

Thanks.