# git rebase --interactive problems

3 messages from 2009-09-07 to 2009-09-07. Participants: Dave Rodgman, Jeff Epler, Carlo Marcelo Arenas Belon.
Thread: https://gitlist.dev/t/20865

## Dave Rodgman, 2009-09-07 12:31

Subject: git rebase --interactive problems
Message-ID: <1252326716.7497.1333578429@webmail.messagingengine.com>
URL: https://gitlist.dev/e/1252326716.7497.1333578429%40webmail.messagingengine.com

```
When I try to do even the simplest rebase --interactive, I get a cryptic
error message:

$ git rebase -i HEAD~2
<do nothing in the editor that appears, just save>

I then get:

/usr/lib/git-core/git-rebase--interactive: 1: arithmetic expression:
expecting primary: "-c ^[^#]
2+-c ^[^#]
0"

and all I can do is git rebase --abort

Am I doing something wrong, or is this a bug? I am using git 1.6.4.2

thanks

Dave

```

## Jeff Epler, 2009-09-07 13:03

Subject: Re: git rebase --interactive problems
Message-ID: <20090907130338.GA11644@unpythonic.net>
URL: https://gitlist.dev/e/20090907130338.GA11644%40unpythonic.net
In-Reply-To: <1252326716.7497.1333578429@webmail.messagingengine.com>

```
It looks like something is going wrong with the 'grep -c' in
    mark_action_done () {
            sed -e 1q < "$TODO" >> "$DONE"
            sed -e 1d < "$TODO" >> "$TODO".new
            mv -f "$TODO".new "$TODO"
            count=$(grep -c '^[^#]' < "$DONE")
            total=$(($count+$(grep -c '^[^#]' < "$TODO")))
            if test "$last_count" != "$count"
            then
                    last_count=$count
                    printf "Rebasing (%d/%d)\r" $count $total
                    test -z "$VERBOSE" || echo
            fi
    }
are you using an unusual platform or have an unusual /bin/grep or
/bin/sh?

Jeff

```

## Carlo Marcelo Arenas Belon, 2009-09-07 13:04

Subject: Re: git rebase --interactive problems
Message-ID: <20090907130409.GA10879@sajinet.com.pe>
URL: https://gitlist.dev/e/20090907130409.GA10879%40sajinet.com.pe
In-Reply-To: <1252326716.7497.1333578429@webmail.messagingengine.com>

```
On Mon, Sep 07, 2009 at 01:31:56PM +0100, Dave Rodgman wrote:
> 
> Am I doing something wrong, or is this a bug? I am using git 1.6.4.2

can you do before running the rebase (assuming a bourne shell) :

  unset GREP_OPTIONS

this looks like the bug I just send a patch to the list to fix and
which seems to be also reported in Ubuntu as :

  https://bugs.launchpad.net/ubuntu/+source/git-core/+bug/398393

Carlo

```
