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

Re: [PATCH] Use 'grep -a' to fix some errors with non-GNU grep(1).

From
Jeff King <peff@peff.net>
Date
Mar 29, 2008, 00:49 UTC
Message-ID
<20080329004908.GA9878@coredump.intra.peff.net>
In-Reply-To
<20080328224011.GB5486@dengar.tuneafish.de>
On Fri, Mar 28, 2008 at 11:40:11PM +0100, Bernd Ahlers wrote:
> This fixes test errors on OpenBSD.

Nak. "grep -a" isn't portable. If you have binary goo to check, I think the safest thing is to either generate it using printf (if it's short and easy) or include the expected output in a test file (this is what I did for t4020; see 53a5b443).

You could also potentially use git-grep for this, but I haven't looked into how it handles "-a" (and in general, I think we try to avoid using git tools as test infrastructure to avoid false positives; e.g., we prefer using a system tool to compare expected output rather than git-diff).

-Peff
Previous: Bernd Ahlers
Message 2 of 2 in “Use 'grep -a' to fix some errors with non-GNU grep(1).”
  1. Use 'grep -a' to fix some errors with non-GNU grep(1).Bernd Ahlers, Mar 28, 2008
  2. Jeff KingMar 29, 2008

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.