]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/rebase.c
builtin rebase: support `git rebase --onto A...B`
authorPratik Karki <predatoramigo@gmail.com>
Tue, 4 Sep 2018 21:27:09 +0000 (14:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Sep 2018 18:55:42 +0000 (11:55 -0700)
commit075bc8527c7e162e1131ac42443637dbe3bef16a
tree4e5906d4c7f04724ec4142d18a184759f526d67d
parentf28d40d3a999f99662a7df1363fc7bec9f18a52d
builtin rebase: support `git rebase --onto A...B`

This commit implements support for an --onto argument that is actually a
"symmetric range" i.e. `<rev1>...<rev2>`.

The equivalent shell script version of the code offers two different
error messages for the cases where there is no merge base vs more than
one merge base.

Though it would be nice to retain this distinction, dropping it makes it
possible to simply use the `get_oid_mb()` function. Besides, it happens
rarely in real-world scenarios.

Therefore, in the interest of keeping the code less complex, let's just
use that function, and live with an error message that does not
distinguish between those two error conditions.

Signed-off-by: Pratik Karki <predatoramigo@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c