Running logic after CloseTaskDialog's "commit"

I develop the gitflow4idea plugin.


A user pointed out an issue with my integration with the close task dialog:


The gitflow "finish feature" logic should run only after the "commit changes" had ended, but turns out they run concurrently.

I tracked down the bug to this line in CloseTaskDialog:

Seems like the commit function of all the TaskDialog integrations is executed sequentially, so what happens is that the git commit and the gitflow finish actions are executed almost instantaneously, which means that the actual commit doesn't finish by the time the gitflow finish action starts.

I'm not entirely sure how to solve this, since the dialog integration doesn't provide a way to synchronously rely on other integrations. 

Maybe there's a way to specifically query git4idea and register logic to run if the plugin isn't "busy"?



There is `CheckinHandler#checkinSuccessful()` method, it is called after commit is executed successfully. Please try if works for you.


Looks like It doesn't work?

This is my test handler:


public class GitflowCheckinHandlerFactory extends CheckinHandlerFactory {
public CheckinHandler createHandler(@NotNull CheckinProjectPanel checkinProjectPanel, @NotNull CommitContext commitContext) {
return new CheckinHandler() {
public void checkinSuccessful() {


And in my plugin.xml:


<extensions defaultExtensionNs="com.intellij">
<checkinHandlerFactory implementation="gitflow.GitflowCheckinHandlerFactory" order="last" />


However the checkinSuccessful nor the actual instantiation gets called at all on task close with "commit changes".


Any tips?

Permanently deleted user

I see that `VcsCloseTaskPanel#commit()` does not perform commit with `CheckinHandler`-s - it just calls corresponding `CheckinEnvironment#commit()` implementations. So unfortunately you can't use `checkinSuccessful` here.

Possible workaround could be for instance to add `ChangeListListener` (`ChangeListManager#addChangeListListener()`) and track until necessary changes are removed after "close task" is invoked.


Please sign in to leave a comment.