Use low level command to detect branches behind

Using `git log` + `grep` is subject to formatting in `.gitconfig`, which can be overridden and will break this function. Relying on `rev-list` is much more stable.