GREP_OPTIONS variable hinders interactive git-rebase functionality

Bug #398393 reported by Jeenu V on 2009-07-12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-core (Ubuntu)

Bug Description

I get the following error when running interactive git mergebase:

/usr/lib/git-core/git-rebase--interactive: 1: arithmetic expression: expecting ')': "(standard input):1+(standard input):2"

I'm sure that's because I've GREP_OPTIONS environment variable exported, and contain the value: "-nHI --exclude=\*.svn-base". Thus grep results obtained by "/usr/lib/git-core/git-rebase--interactive" script differs from standard grep output. The solution would be that /usr/lib/git-core/git-rebase--interactive should always invoke grep as: "GREP_OPTIONS= grep"

Description: Ubuntu 9.04
Release: 9.04

  Installed: 1:
  Candidate: 1:
  Version table:
 *** 1: 0
        500 jaunty/main Packages
        100 /var/lib/dpkg/status

Tags: git Edit Tag help
Anders Kaseorg (anders-kaseorg) wrote :

Instead of setting GREP_OPTIONS in your dotfiles, I recommend setting an alias in your ~/.bashrc:
  alias grep='grep -nHI --exclude=\*.svn-base'
since aliases do not propagate into other scripts.

A patch to sanitize GREP_OPTIONS appeared a little while ago on the upstream mailing list, but so far it has not been committed:
If you still think this is a bug, I recommend following up with upstream.

Anders Kaseorg (anders-kaseorg) wrote :

This is now fixed upstream in Git;a=commitdiff;h=e1622bfcbad680225ad5c337e4778df88389227e

Git will probably make its way into Debian soon and Lucid soon after that. You can also get current Git packages for all versions of Ubuntu here:

Changed in git-core (Ubuntu):
status: New → In Progress
Jeenu V (jeenuv) wrote :

Thanks for the update.

Anders Kaseorg (anders-kaseorg) wrote :

Fixed in Lucid’s git-core 1:1.7.0-1.

Changed in git-core (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers