aspiers / git-explode

Explode linear sequence of git commits into topic branches
GNU General Public License v2.0
52 stars 3 forks source link

Warn about base vs head relationship #12

Open Werkov opened 4 months ago

Werkov commented 4 months ago

I inadvertently passed a base commit that was not an ancestory of head and exploded branch could not be cherry-picked cleanly on top of base (because of head..base changes).

pygit2 does not have an equivalent of git merge-base --is-ancestor, so use the closes approximation by comparing merge base to base. (Hopefully, the "base" is picked by merge_base function when there are multiple merge bases possible so that this ancestor check is corect.)