git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Johannes SixtNext: Jeff King
Message 4 of 7 in “t*: avoid using pipes”
  1. t*: avoid using pipesPrathamesh Chavan, Mar 7, 2017
  2. Stefan BellerMar 7, 2017
  3. Johannes SixtMar 7, 2017
  4. Stefan BellerMar 7, 2017
  5. Jeff KingMar 8, 2017
  6. Prathamesh ChavanMar 8, 2017
  7. Prathamesh ChavanMar 9, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.