rebase: fix --onto A...B parsing and add tests