threads / discuss / 20865

git rebase --interactive problems

Subject: git rebase --interactive problems

## tl;dr

3 messages between Sep 7, 2009 and Sep 7, 2009.

replies: 2people: 3as markdown or json

Dave Rodgman· Sep 7, 2009, 12:31 UTC · lore

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· Sep 7, 2009, 13:03 UTC · re: Dave Rodgman · lore

Re: git rebase --interactive problems

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· Sep 7, 2009, 13:04 UTC · re: Dave Rodgman · lore

Re: git rebase --interactive problems

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

← back to recent threads