Skip to content

Wrong warnings when finishing split with an empty side #9247

@Vampire

Description

@Vampire

Description

Disclaimer:
If #9245 gets done, this should become obsolete.
But if that issue gets rejected or needs some time to be done,
this could be fixed instead or in the meantime.

If you select no changes in a split, you get an empty original commit
and a new child commit with all changes.
But the warning after the command says

Warning: No changes have been selected, so the new revision will be empty

which is wrong.

Likewise, if you select all changes, you get an empty new commit and original commit stays untouched besides the needless commit date change.
But the warning says

Warning: All changes have been selected, so the original revision will become empty

And finally, if you split an empty revision (which should not even be possible according to docs),
you get the two warnings

Warning: Empty diff - won't run diff editor.
Warning: All changes have been selected, so the original revision will become empty

The second one is not wrong, but it is a bit useless.
And it also is only correct now because "All" and "No" changes are the same in this case.

Steps to Reproduce the Problem

  1. jj split
  2. select all or no changes

Expected Behavior

correct message

Actual Behavior

wrong message

Specifications

  • Platform: all
  • Version: 0.40.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions