I would like to modifiy the Git push dialog for my Gerrit IntelliJ Plugin.
You must push commits to a special remote branch "refs/for/" in order to get them into Gerrit. Currently, IntelliJ does not remember remote branches (see issue IDEA-98693) and an alternate push branch can also not be set up (see issue IDEA-98878). Because of this missing functionality, you need to change the remote branch field in Git push dialog for every commit you want to push to Gerrit.
I have looked into this code and have not found any possibilty to extend this dialog (Action: GitPushAction, Dialog: GitPushDialog).
What I'd like to do: When the push dialog opens, it should autoamtically prepend "refs/for/" in the branch. Also, I'd like to add some more UI like checkboxes for Gerrit options (like submitting the change right after verification (which appends %submit to the push branch)) or an input line for adding reviewers (which appends %r=username1,username2).
I don't like to add a second push action for the plugin (because it should also be shown when using "Commit and Push" in the commit dialog and it would need a lot of code duplication).
How should I try to implement it? Bytecode manipulation with javassist?