Handle an event from VCS (Git)
Answered
Hello.
I am currently developing IntelliJ plugin. Want to know, is it possible to handle changes in VCS? I want to be notified with some kind of event, when commit or push happens and handle it.
If there is something like com.intellij.codeInsight.editorActions.TypedHandlerDelegate but for VCS changes, it would be really a charm.
Please sign in to leave a comment.
Hello Sergey,
If the intension is to extend UI actions like "on successful commit and on failed commit" then you can use
You can register your own implementation of
in the corresponding extension point e.g:
Best Regards,
Dmitry Zhuravlev
Regarding push, see https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000405300-Listen-for-Git-push-events-from-IntelliJ-plugin
As nobody responded yet, I will post my own searching results on this question.
There is CheckinHandler.checkinSuccessful() method, and it seems to be suitable for this case.
But I found this in question asked back in 2008. So if something better now exists, please, write about it.
Thank you a lot!
And maybe you can help me with getting set of changes after commit? I mean, I wonder is it possible to get something like numbers of changed lines in file? e.g. line 25 was added, line 14 was modified, line 26 was removed and etc.