Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli rebase: do not allow
-r --skip-empty
to empty descendants
This follows up on @matts1 's jj-vcs#2609. We still allow the `-r` commit to become empty. I would be more comfortable if there was a test for that, but I haven't done that (yet?) and it seems pretty safe. If that's a problem, I'm happy to forbid `-r --skip-empty` entirely, since it is far less useful than `-s --skip-empty` or `-b --skip-empty`. I think it is reasonable not to empty descendants, since as far as descendants of `A` are concerned, `jj rebase -r A` should be equivalent to `jj abandon A`, and `jj abandon` does not remove emptid commits. It also doesn't seem very useful to do that to descendant commits. Moreover, if we did want -r to empty descendants of `A`, we'd have to improve the algorithm and add thorough tests. For example, if we have ``` root -> A -> B -> C ``` and `jj rebase -r A -d C` empties commit `B` (or `C`), I do not know whether the current algorithm will work correctly. It seems possible that it would, but that depends on the fact that empty merge commits are not abandoned. That seems dangerous to rely on without tests.
- Loading branch information