Thread (47 messages) 47 messages, 4 authors, 2021-12-11

Re: [PATCH 05/19] t5516: drop unnecessary subshell and command invocation

From: Jeff King <hidden>
Date: 2021-12-10 09:10:44

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help