Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF47BC433B4 for ; Fri, 30 Apr 2021 16:40:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 878BF60551 for ; Fri, 30 Apr 2021 16:40:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbhD3QlU convert rfc822-to-8bit (ORCPT ); Fri, 30 Apr 2021 12:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbhD3QlR (ORCPT ); Fri, 30 Apr 2021 12:41:17 -0400 Received: from mav.lukeshu.com (mav.lukeshu.com [IPv6:2001:19f0:5c00:8069:5400:ff:fe26:6a86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AEE5C06174A for ; Fri, 30 Apr 2021 09:40:28 -0700 (PDT) Received: from lukeshu-dw-thinkpad (unknown [IPv6:2601:281:8200:26:4e34:88ff:fe48:5521]) by mav.lukeshu.com (Postfix) with ESMTPSA id 02A8F80590; Fri, 30 Apr 2021 12:40:27 -0400 (EDT) Date: Fri, 30 Apr 2021 10:40:26 -0600 Message-ID: <87h7jnpvyd.wl-lukeshu@lukeshu.com> From: Luke Shumaker To: =?ISO-8859-1?Q?=C6var_Arnfj=F6r=F0?= Bjarmason Cc: Luke Shumaker , git@vger.kernel.org, Avery Pennarun , Charles Bailey , Danny Lin , "David A . Greene" , David Aguilar , James Denholm , Jeff King , Jonathan Nieder , Junio C Hamano , =?UTF-8?B?Tmd1eeG7hW4g?= =?ISO-8859-1?Q?Th=E1i_?= =?UTF-8?B?Tmfhu41j?= Duy , Roger L Strain , Techlive Zheng , Eric Sunshine , Luke Shumaker Subject: Re: [PATCH v3 10/30] subtree: t7900: add a test for the -h flag In-Reply-To: <87lf90xf83.fsf@evledraar.gmail.com> References: <20210426174525.3937858-1-lukeshu@lukeshu.com> <20210427211748.2607474-1-lukeshu@lukeshu.com> <20210427211748.2607474-11-lukeshu@lukeshu.com> <87lf90xf83.fsf@evledraar.gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Fri, 30 Apr 2021 04:01:50 -0600, Ævar Arnfjörð Bjarmason wrote: > > > On Tue, Apr 27 2021, Luke Shumaker wrote: > > > From: Luke Shumaker > > > > It's a dumb test, but it's surprisingly easy to break. > > > > Signed-off-by: Luke Shumaker > > --- > > contrib/subtree/t/t7900-subtree.sh | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh > > index 5c2510f1f5..9afba2f282 100755 > > --- a/contrib/subtree/t/t7900-subtree.sh > > +++ b/contrib/subtree/t/t7900-subtree.sh > > @@ -37,6 +37,13 @@ last_commit_subject () { > > git log --pretty=format:%s -1 > > } > > > > +test_expect_success 'shows short help text for -h' ' > > + test_expect_code 129 git subtree -h >out 2>err && > > + test_must_be_empty err && > > + grep -e "^ *or: git subtree pull" out && > > + grep -e --annotate out > > I wonder if "grep -e --could-be-an-option-if-not-for-e" is portable, > probably.... It's POSIX, and at least works on GNU, busybox, and macOS (based-on-FreeBSD) grep. If it turns out there's somewhere it doesn't work, I'd be happy to change it, but my baseline assumption is that it's portable. -- Happy hacking, ~ Luke Shumaker