Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rebase: add
--insert-after
and --insert-before
options for `--rev…
…isions` This allows for rebased commits to be moved before or after any given commits. The general steps of the approach taken are: 1. Compute the new parents and children of the rebased commits, based on the provided `--insert-after`/`--insert-before` options. 2. "Extract" the commits, by rebasing its descendants onto its parents (i.e. identical behavior to `jj rebase -r X -d X` before shifting the commit to its new destination) 3. Rebase the commits onto its new parents, then rebase the new children and its descendants accordingly using `MutRepo::transform_descendants`. This means there are 2 separate rebasing steps: one for the descendants of the rebased commits, and another to shift the rebased commits and its new children. This can lead to repeated rebasing of the same commits if the commit to be rebased is either an ancestor or descendant of the new children. However, I'm not sure if there's a way to do the rebasing in one step using the current APIs: I'm not sure if there's a way to customize the iteration order of commits in `transform_descendants` currently.
- Loading branch information