git-machete-intellij-plugin icon indicating copy to clipboard operation
git-machete-intellij-plugin copied to clipboard

Doesn't the Rebase action always fail on empty commits?

Open PawelLipski opened this issue 3 years ago • 4 comments

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).

PawelLipski avatar Jul 05 '22 15:07 PawelLipski

Turns out we need to use a different flag, instead of --keep-empty we should be using --empty drop (or both). Git rebase manual

MaciejG604 avatar Aug 17 '22 11:08 MaciejG604

https://github.com/JetBrains/intellij-community/pull/2117

MaciejG604 avatar Aug 23 '22 08:08 MaciejG604

Marking as on hold, as it's blocked on review/release on JetBrains' side

PawelLipski avatar Aug 30 '22 11:08 PawelLipski

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)

PawelLipski avatar Sep 01 '22 09:09 PawelLipski