Re: [PATCH v2 1/3] test-lib: allow selecting tests by substring/regex with --run
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 15, 2020, 15:59 UTC
- Message-ID
- <xmqqeelziip2.fsf@gitster.c.googlers.com>
- In-Reply-To
- <CABPp-BE0_u=TAJKUGUTLrZbg8vk2MFYmfscT_+MgYwAS2rV8Aw@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 16 quoted lines
> On Wed, Oct 14, 2020 at 12:24 PM Junio C Hamano <gitster@pobox.com> 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.