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-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, 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 626921F953 for ; Mon, 20 Dec 2021 13:50:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232237AbhLTNu6 (ORCPT ); Mon, 20 Dec 2021 08:50:58 -0500 Received: from cloud.peff.net ([104.130.231.41]:55040 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbhLTNu6 (ORCPT ); Mon, 20 Dec 2021 08:50:58 -0500 Received: (qmail 10269 invoked by uid 109); 20 Dec 2021 13:50:57 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Mon, 20 Dec 2021 13:50:57 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 2535 invoked by uid 111); 20 Dec 2021 13:50:57 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Mon, 20 Dec 2021 08:50:57 -0500 Authentication-Results: peff.net; auth=none Date: Mon, 20 Dec 2021 08:50:56 -0500 From: Jeff King To: Derrick Stolee Cc: Derrick Stolee via GitGitGadget , git@vger.kernel.org, me@ttaylorr.com, gitster@pobox.com, Derrick Stolee , Derrick Stolee Subject: Re: [PATCH 1/2] repack: respect kept objects with '--write-midx -b' Message-ID: References: <1ed91f6d255b76bdbdcccea7e1effcebbb263ced.1639758526.git.gitgitgadget@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Dec 20, 2021 at 08:40:09AM -0500, Derrick Stolee wrote: > > One could perhaps argue that the combined grep is less readable. If > > that's a concern, I'd suggest wrapping it in a function like: > > > > # usage: check_trace2_arg > > check_trace2_arg () { > > grep "\"event\":\"start\".*\"$2\".*\"$3\"" "$1" > > } > > > > All just suggestions, of course. I'd be happy enough to see the patch go > > in as-is. > > Thanks for the suggestions. I decided to adapt the 'test_subcommand' > helper into a 'test_subcommand_inexact' helper. The existing helper > requires the full argument list in exact order, but the new one only > cares about the given arguments (in that relative order). Heh, I should have looked to see if we had faced this problem before. Extending that family of helpers is better still than my suggestion. -Peff