Use rev-list --count rather than just rev-list