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

2016-03-10 Thread Junio C Hamano
Torsten Bögershausen writes: > On 09.03.16 21:26, Junio C Hamano wrote: >> Anders Kaseorg writes: > [] >> sane_grep () { >> -GREP_OPTIONS= LC_ALL=C grep "$@" >> +GREP_OPTIONS= LC_ALL=C grep @@SANE_TEXT_GREP@@ "$@" >> } >> >> sane_egrep () { >> -

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

2016-03-09 Thread Torsten Bögershausen
On 09.03.16 21:26, Junio C Hamano wrote: > Anders Kaseorg writes: [] > sane_grep () { > - GREP_OPTIONS= LC_ALL=C grep "$@" > + GREP_OPTIONS= LC_ALL=C grep @@SANE_TEXT_GREP@@ "$@" > } > > sane_egrep () { > - GREP_OPTIONS= LC_ALL=C egrep "$@" > + GREP_OPTIONS=

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

2016-03-09 Thread Junio C Hamano
Anders Kaseorg writes: > The autoconf support you committed as 67f1790a has a small bug (the else > cause should omit -a): Thanks. To summarize the discussion, here is what I ended up with. -- >8 -- Subject: [PATCH] sane_grep: pass "-a" if grep accepts it Newer versions of

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

2016-03-08 Thread Anders Kaseorg
The autoconf support you committed as 67f1790a has a small bug (the else cause should omit -a): +if grep -a ascii configure.ac >/dev/null; then + AC_MSG_RESULT([Using 'grep -a' for sane_grep]) + SANE_TEXT_GREP=-a +else + SANE_TEXT_GREP=-a +fi +GIT_CONF_SUBST([SANE_TEXT_GREP]) Anders -- To

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

2016-03-08 Thread Jeff King
On Tue, Mar 08, 2016 at 03:36:26PM -0800, Junio C Hamano wrote: > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh > index c0cfe88..4cde685 100644 > --- a/git-rebase--interactive.sh > +++ b/git-rebase--interactive.sh > @@ -1233,7 +1233,8 @@ then > git rev-list $revisions

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

2016-03-08 Thread Jeff King
On Tue, Mar 08, 2016 at 03:20:26PM -0800, Junio C Hamano wrote: > Jeff King 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

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

2016-03-08 Thread Junio C Hamano
Subject: rebase-i: clarify "is this commit relevant" test While I was checking all the call sites of sane_grep and sane_egrep, I noticed this one is somewhat strangely written. The lines in the file sane_grep works on all begin with 40-hex object name, so there is no real risk of confusing "test

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

2016-03-08 Thread Junio C Hamano
Jeff King 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

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

2016-03-08 Thread Jeff King
On Tue, Mar 08, 2016 at 02:45:20PM +0100, Michael J Gruber wrote: > It may be worth noting whether other occurrences of "sane_grep" are safe > from binary input. > > After all, one my question the degree of sanity of our sane_grep, or > whether we need asane_grep and bisane_grep in our shell

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

2016-03-08 Thread Michael J Gruber
Torsten Bögershausen venit, vidit, dixit 08.03.2016 13:25: > On 03/08/2016 08:59 AM, Anders Kaseorg wrote: >> The included test case, which uses rebase -p with non-ASCII commit >> messages, was failing as follows: >> >>Warning: the command isn't recognized in the following line: >> -

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

2016-03-08 Thread Torsten Bögershausen
On 03/08/2016 08:59 AM, Anders Kaseorg wrote: The included test case, which uses rebase -p with non-ASCII commit messages, was failing as follows: Warning: the command isn't recognized in the following line: - Binary file (standard input) matches You can fix this with 'git rebase

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

2016-03-08 Thread Anders Kaseorg
The included test case, which uses rebase -p with non-ASCII commit messages, was failing as follows: Warning: the command isn't recognized in the following line: - Binary file (standard input) matches You can fix this with 'git rebase --edit-todo'. Or you can abort the rebase with 'git