From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 7192B1F4B4 for ; Thu, 15 Oct 2020 16:10:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389207AbgJOQK0 (ORCPT ); Thu, 15 Oct 2020 12:10:26 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:56397 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388461AbgJOQK0 (ORCPT ); Thu, 15 Oct 2020 12:10:26 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 5DB4AF5F72; Thu, 15 Oct 2020 12:10:24 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=INHAuBjtVIFYDgIj7B7Gh1Es1as=; b=R0zDpS /bO3/PqvB+nFLCL2AQiAryA1r7kv9LiBmpeb37Bn/dELS8FGeVQH74PXkPLjMb2H 3c/tn95VGkElkUaI3SmlMtdCqMved+aoUwDFAzQv5m91++/xLhxpxEhXzUMzBn/M JttQeHqYoYfomLj22cMNYTO9RlTSsFmjsQgQI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=pbUVcG+JSZZ4zi05OS0ih1oebMpMh/+G T8kDewVGDDp1lK7Q39v0AkLNIo7lXWeQ+UBRybvJ26aI5aukwr/e/HX1RIetCmaf bAcQJc4QzCrl8SoG9ff5fyG02ZP0kUicFb8h1WTOEZGgjEAqxgg9c/O9rjCts9Ps Tx+LatBM8jU= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 56002F5F71; Thu, 15 Oct 2020 12:10:24 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.74.119.39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id A1575F5F70; Thu, 15 Oct 2020 12:10:21 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: Elijah Newren Cc: Jeff King , Elijah Newren via GitGitGadget , Git Mailing List , Phillip Wood , Taylor Blau Subject: Re: [PATCH v2 1/3] test-lib: allow selecting tests by substring/regex with --run References: <41e2528e83ba7087c9d21f0b15efed416f1512f8.1602616786.git.gitgitgadget@gmail.com> <20201014170413.GB21687@coredump.intra.peff.net> Date: Thu, 15 Oct 2020 09:10:20 -0700 In-Reply-To: (Elijah Newren's message of "Wed, 14 Oct 2020 12:12:22 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: ED1292A8-0F00-11EB-90E7-E43E2BB96649-77302942!pb-smtp20.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Elijah Newren writes: > On Wed, Oct 14, 2020 at 10:57 AM Junio C Hamano wrote: >> >> > are you suggesting dropping the regex handling and limit it to >> > substring matching? In either case, does using expr save us anything >> > (isn't expr a shell command)? >> >> I had something along this line in mind, not to do a regex but a glob. >> >> case "$title" in $selector) found=1 ;; esac > > Interesting. Since it needs to handle substring searching (e.g. > ./test-script.sh --run=setup,rename), I think this would need to be > tweaked to be > case "$title" in *${selector}*) include=$positive ;; esac Yup, of course we need to un-anchor with surrounding asterisks. Thanks.