git-machete-intellij-plugin
git-machete-intellij-plugin copied to clipboard
Doesn't the Rebase action always fail on empty commits?
Pretty easy to reproduce... just try to rebase onto develop a commit, whose all changes are already present on develop (and thus is "empty" from the PoV of the rebase). Or even more bluntly, just try rebasing an empty commit (i.e. one create via git commit --allow-empty).
What happens in either case? We've added --keep-empty to rebases (see com.virtuslab.gitmachete.frontend.actions.base.BaseSyncToParentByRebaseAction#getIdeaRebaseParamsOf)... but it seems that IntelliJ is failing on that, a Retry is needed :/
Preferably, include a regression test in UI tests (by extending the existing UI test for rebase).
Turns out we need to use a different flag, instead of --keep-empty we should be using --empty drop (or both). Git rebase manual
https://github.com/JetBrains/intellij-community/pull/2117
Marking as on hold, as it's blocked on review/release on JetBrains' side
Actually, while we're waiting (which will be until IDEA 2022.3 is released, or even until 2023.1)... @MaciejG604 could you open a PR to this project which uses the option added in https://github.com/JetBrains/intellij-community/pull/2117? Note that since we'll still maintain the compatibility with 2022.1 & 2022.2 (which don't & won't support EMPTY_DROP), the existence of EMPTY_DROP needs to be checked via reflection; if it's absent, then it won't be added (thus maintaining compatibility with 2022.1&2)