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