Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] git-rebase-interactive: avoid breaking when GREP_OPTIONS="-H"

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:47:22

Carlo Marcelo Arenas Belon [off-list ref] writes:
On Mon, Sep 07, 2009 at 12:37:30PM -0700, Junio C Hamano wrote:
quoted
How does your patch help when the user has GREP_OPTIONS=-C3 in the
environment?
It wouldn't help but at least wouldn't break aborting with an script
error since you will always get a number.
That's actually worse, don't you think?

It is trying to count how many actions are done and how many are
remaining, and if you miscount it in that shell function, you will get
incorrect result.  The function happens to be merely for reporting, but
the point is that it is better to fail loudly than doing wrong thing.
quoted
I think a saner workaround for this user environment bug (or GNU grep
misfeature) is to unset GREP_OPTIONS at the beginning of the script, or
even in git-sh-setup.
agree, and since grep is used almost everywhere filtering in git-sh-setup
like CDPATH is makes sense, with the only user of grep that wouldn't
benefit from that being git-mergetool--lib.sh AFAIK.
Not at all.  "git grep" itself will be broken.  See my other patch for a
possible alternative approach.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help