Re: [PATCH] t*: avoid using pipes
- From
Stefan Beller <sbeller@google.com>
- Date
- Mar 7, 2017, 20:52 UTC
- Message-ID
- <CAGZ79kZhfRiUQndEGB=b34WMCPv0KDjpDix0Ly85aFeyOQAwWA@mail.gmail.com>
- In-Reply-To
- <3026648b-a26c-bc67-62dc-170217d6c2ca@kdbg.org>
On Tue, Mar 7, 2017 at 12:39 PM, Johannes Sixt <j6t@kdbg.org> wrote:
> Welcome to the Git community!
> > Actually, being a *micro* project, it should stay so. Not doing all of the > changes would leave some tasks for other apprentices to get warm with our > review process.
right, so just pick one file.
Show 18 quoted lines
> Thank you, Stefan, for digging out one particularly interesting case. > >> When looking at the content, the conversion seems a bit mechanical >> (which is fine for a micro project), such as: >> ... >> - test "$(git show --pretty=format:%s | head -n 1)" = "one" >> + test "$(git show --pretty=format:%s >out && head -n 1 <out)" = "one" >> ... >> >> specifically for the "head" command I don't think it makes a >> difference in correctness whether you pipe the file into the tool >> or give the filename, i.e. "head -n 1 out" would work just as fine. > > > True, but! > > The intent of removing git invocations from the upstream of a pipe is that a > failure exit code is able to stop a && chain.
Doh! I was so fixated over discussing whether to use "<" or not, to miss looking for the actual goal.
Thanks for spotting! Stefan