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.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, 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 63DD01F953 for ; Fri, 10 Dec 2021 09:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239065AbhLJJOS (ORCPT ); Fri, 10 Dec 2021 04:14:18 -0500 Received: from cloud.peff.net ([104.130.231.41]:48542 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234276AbhLJJOR (ORCPT ); Fri, 10 Dec 2021 04:14:17 -0500 Received: (qmail 17996 invoked by uid 109); 10 Dec 2021 09:10:42 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 10 Dec 2021 09:10:42 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 28315 invoked by uid 111); 10 Dec 2021 09:10:44 -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; Fri, 10 Dec 2021 04:10:44 -0500 Authentication-Results: peff.net; auth=none Date: Fri, 10 Dec 2021 04:10:41 -0500 From: Jeff King To: Eric Sunshine Cc: git@vger.kernel.org, Eric Sunshine Subject: Re: [PATCH 05/19] t5516: drop unnecessary subshell and command invocation Message-ID: References: <20211209051115.52629-1-sunshine@sunshineco.com> <20211209051115.52629-6-sunshine@sunshineco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20211209051115.52629-6-sunshine@sunshineco.com> Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Dec 09, 2021 at 12:11:01AM -0500, Eric Sunshine wrote: > To create its "expect" file, this test pipes into `sort` the output of > `git for-each-ref` and a copy of that same output but with a minor > textual transformation applied. To do so, it employs a subshell and > commands `cat` and `sed` even though the same result can be accomplished > by `sed` alone (without a subshell). Clever. The ordering of output from sed is different than the original, but because it all gets fed into sort anyway, that's OK. In theory it could change the output of a stable sort of lines which match (which won't be totally identical, because you are sorting with -k3), but it seems we don't care in this instance. -Peff