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

Re: [PATCH v2 1/2] t0001: avoid pipes with Git on LHS

From
Taylor Blau <me@ttaylorr.com>
Date
Feb 23, 2022, 17:53 UTC
Message-ID
<YhZ0qOwtY1vUVTiN@nand.local>
In-Reply-To
<20220223115347.3083-2-shivam828787@gmail.com>
On Wed, Feb 23, 2022 at 05:23:46PM +0530, Shubham Mishra wrote:
> Pipes ignore error codes of LHS command and thu`s we should not use
> them with Git in tests. As an alternative, use a 'tmp' file to write
> the Git output so we can test the exit code.

This patch does preserve the existing behavior. But I'm hesitant to recommend that we apply this patch, since our test suite assumes that commands like find will work, and so we aren't concerned about squashing any potential error codes when it's on the left-hand side of the pipe, since we assume that it won't fail in general.

(That's notably different from the second patch in this series, where the thing on the left-hand side of the pipe is a git invocation. In that case, we really _do_ want to avoid having it on the left-hand side of the pipe, because we don't have the same error-free expectation there, and want to know when it fails).

I think that Ævar gave a nice summary of the above in [1]

Thanks, Taylor

[1]: https://lore.kernel.org/git/220222.86pmnf6ket.gmgdl@evledraar.gmail.com/
Previous: Shubham MishraNext: Shubham Mishra
Message 15 of 31 in “microproject: avoid using pipes in test”
  1. 0/2 microproject: avoid using pipes in testShubham Mishra, Feb 22, 2022
  2. 1/2 t0001: remove pipesShubham Mishra, Feb 22, 2022
  3. Derrick StoleeFeb 22, 2022
  4. Shubham MishraFeb 22, 2022
  5. Christian CouderFeb 22, 2022
  6. Junio C HamanoFeb 23, 2022
  7. Christian CouderFeb 24, 2022
  8. 2/2 t0003: remove pipesShubham Mishra, Feb 22, 2022
  9. Derrick StoleeFeb 22, 2022
  10. Ævar Arnfjörð BjarmasonFeb 22, 2022
  11. Shubham MishraFeb 22, 2022
  12. Taylor BlauFeb 22, 2022
  13. 0/2 avoid pipes with Git on LHSShubham Mishra, Feb 23, 2022
  14. 1/2 t0001: avoid pipes with Git on LHSShubham Mishra, Feb 23, 2022
  15. Taylor BlauFeb 23, 2022
  16. Shubham MishraFeb 23, 2022
  17. Taylor BlauFeb 23, 2022
  18. Junio C HamanoFeb 23, 2022
  19. Shubham MishraFeb 24, 2022
  20. 2/2 t0003: avoid pipes with Git on LHSShubham Mishra, Feb 23, 2022
  21. Taylor BlauFeb 23, 2022
  22. Shubham MishraFeb 23, 2022
  23. Shubham MishraFeb 23, 2022
  24. Shaoxuan YuanFeb 23, 2022
  25. Taylor BlauFeb 23, 2022
  26. Shubham MishraFeb 23, 2022
  27. Christian CouderFeb 24, 2022
  28. Shubham MishraFeb 24, 2022
  29. Christian CouderFeb 24, 2022
  30. Shubham MishraFeb 24, 2022
  31. Christian CouderFeb 24, 2022

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.