On Fri, Feb 19, 2016 at 09:38:17AM -0800, Junio C Hamano wrote: > Jeff King <p...@peff.net> writes: > > > Yeah, I'd worry that "-a" is not portable. OTOH, BSD grep seems to have > > it, so between that and GNU, I think most systems are covered. We could > > do: > > > > test_lazy_prereq GREP_A ' > > echo foo | grep -a foo > > ' > > > > and mark these tests with it. I'd also be happy to skip that step and > > just do it if and when somebody actually complains about a system > > without it (I wouldn't be surprised if most people on antique systems > > end up installing GNU grep anyway). > > > > Another option might be using "sed -ne '/^author/p'" or similar. But > > that may very well just be trading one portability problem for another. > > Would $PERL help, I wonder?
I suspect that any grep that lacks "-a" also lacks binary file handling that will break these tests. I found a Solaris grep that doesn't support "-a" and it treats these files as text. >From that perspective, it would be better to have a central place that deals with figuring out how to get grep to work for us. Perhaps we need test_grep to get this right. We already have test_cmp_bin() as a thin wrapper around cmp so I don't think this is completely unprecedented. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html