From: Junio C Hamano Date: Mon, 07 Sep 2009 19:37:30 GMT Subject: Re: [PATCH] git-rebase-interactive: avoid breaking when GREP_OPTIONS="-H" Message-ID: <7v7hwar1fp.fsf@alter.siamese.dyndns.org> In-Reply-To: <1252328160-4359-1-git-send-email-carenas@sajinet.com.pe> Carlo Marcelo Arenas Belon writes: > if GREP_OPTIONS is set and includes -H, using `grep -c` will fail > to generate a numeric count and result in the following error : > > /usr/libexec/git-core/git-rebase--interactive: line 110: (standard > input):1+(standard input):0: missing `)' (error token is > "input):1+(standard input):0") > > instead of grep counting use `wc -l` to return the line count. Thanks. How does your patch help when the user has GREP_OPTIONS=-C3 in the environment? 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.