Skip to contentSkip to conversation

git rebase --interactive problems

DISCUSSION Dave Rodgman 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw

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