Skip to content

Improve `sg migration undo` after rebase

Created by: efritz

When you branch off of main@c1 and add a new commit, that commit's parents are the leaves of the migration set defined at main@c1. If then you rebase onto main@c2 which has also received additional migrations, there is no longer an obvious way to disambiguate which migration to "undo".

Instead, we should try to disambiguate which migrations are defined on a base branch of the current git checkout by removing the candidates that are already defined outside of the current branch.