Re: [PATCH 05/19] t5516: drop unnecessary subshell and command invocation
- From
Jeff King <peff@peff.net>
- Date
- Dec 10, 2021, 09:10 UTC
- Message-ID
- <YbMZkdaEt6Q+MtR5@coredump.intra.peff.net>
- In-Reply-To
- <20211209051115.52629-6-sunshine@sunshineco.com>
On Thu, Dec 09, 2021 at 12:11:01AM -0500, Eric Sunshine wrote:
Show 5 quoted lines
> 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