How to listen a git push event in a plugin Follow
I'm working for a shcool charitable project ,now I need to execute some code after a git push event,
but I find that GitPushProcessCustomizationFactory.java has been deleted. So what to do ? Please.
Please sign in to leave a comment.
Yes, there's no such API available anymore.
Could you clarify the use case? There might be another suitable workaround.
I am developing a plugin for intellij and i want to get a listener or an event after the user press the push button in github. Is a class to use for this purpose ? I found this class but it doesnt exists anymore https://upsource.jetbrains.com/idea-ce/file/idea-ce-c70960c5b17fe3fa9b15e982377d45f12d09983a/plugins/git4idea/src/git4idea/push/GitPushProcessCustomizationFactory.java?nav=2537:2615:focused&line=60&preview=false . I want something similar
PrePushHandler can perform some checks right before push (ex: validate commit messages).
Thanks very much..So after the user press the push button from the dialog then handle method execute and then the push taking place is that right? Do you have a snipet of code to understand how i can implement this ?
>Do you have a snipet of code to understand how i can implement this ?
Only the https://github.com/JetBrains/intellij-community/blob/2bb5f9a8563cc87aea464cdf45a74ad040060fff/plugins/devkit/intellij.devkit.git/src/KotlinPluginPrePushHandler.kt
Thanks very much.Unfortunately
PrePushHandlerdoesn't work in my case because I want an event after a successful push. Is possible to listen to successful messages of git? So in prePushHandler get the push details object and then after the successful message run my logic.
There's general notification listener, but it'll be unreliable for this purpose.
No, no explicit api to listen for the end of the push.
Thanks .. I tried to implement the notificaiton listener but it doesn work am i doing something wrong ?
I created a class Test and i implement the Notication interface and inside the notify method i add a message.
And then in the plugin xml i declare the listener
I see the notification from intellij in the right cornet but i cant see the message that i print
works for me.
You might want to check "Project vs Application" for listener/notification and whether test initialize IJ platform properly (and EP class is actually loaded).