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

Re: [PATCH] rebase -p: avoid grep on potentailly non-ASCII data

From
Jeff King <peff@peff.net>
Date
Mar 9, 2016, 00:10 UTC
Message-ID
<20160309001042.GA32669@sigill.intra.peff.net>
In-Reply-To
<xmqqio0wk151.fsf@gitster.mtv.corp.google.com>
On Tue, Mar 08, 2016 at 03:20:26PM -0800, Junio C Hamano wrote:
Show 11 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > I actually wonder if we should have a build-time knob to put "grep -a"
> > into sane_grep(). We do not ever plan to feed it binary data, so that
> > will do what, provided the system grep handles "-a". And on those that
> > do not know about "-a", one imagines that they do not suffer from this
> > problem in the first place (which is really limited to recent versions
> > of GNU grep).
> 
> Something along this line, you mean?  I'll leave it as a
> low-hanging-fruit to add autoconf support ;-)
Yeah, though I think I would probably squash in:
diff --git a/config.mak.uname b/config.mak.uname
index 723f632..15557c3 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -37,6 +37,7 @@ ifeq ($(uname_S),Linux)
 	HAVE_CLOCK_GETTIME = YesPlease
 	HAVE_CLOCK_MONOTONIC = YesPlease
 	HAVE_GETDELIM = YesPlease
+	SANE_TEXT_GREP = -a
 endif
 ifeq ($(uname_S),GNU/kFreeBSD)
 	HAVE_ALLOCA_H = YesPlease

It's not necessary on all Linux platforms yet, but it doesn't hurt, so
we can err on the side of including it (and I think we can assume all
Linux systems have GNU grep or equivalent).

-Peff
Previous: Jeff KingNext: Anders Kaseorg
Message 8 of 12 in “rebase -p: avoid grep on potentailly non-ASCII data”
  1. rebase -p: avoid grep on potentailly non-ASCII dataAnders Kaseorg, Mar 8, 2016
  2. Torsten BögershausenMar 8, 2016
  3. Michael J GruberMar 8, 2016
  4. Jeff KingMar 8, 2016
  5. Junio C HamanoMar 8, 2016
  6. Junio C HamanoMar 8, 2016
  7. Jeff KingMar 9, 2016
  8. Jeff KingMar 9, 2016
  9. Anders KaseorgMar 9, 2016
  10. Junio C HamanoMar 9, 2016
  11. Torsten BögershausenMar 10, 2016
  12. Junio C HamanoMar 10, 2016

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.