I would like to see in Project Viewer the currently checked out git branch.
I'm not sure whether a change in git-plugin is sufficient or a change in Project viewer
is required.
My idea would be to display the branch (instead of or) additionally to the project
name in the project viewer tree. So if the project is called "foo" and the branch
is "bar" the root of the tree should show "foo (bar)".
I couldn't yet find in the source how the name is displayed let alone how I could
change this.
Anybody here who could do this change or guide me?
Submitted | ngc - 2017-11-15 16:14:28.775000 | Assigned | |
---|---|---|---|
Priority | 5 | Labels | git-plugin |
Status | open | Group | None |
Resolution | None |
2017-11-19 18:24:17.661000 ngc |
I've created a macro that helps (me) remedy the situation a bit:
|
---|---|
2017-11-19 21:50:13.005000 daleanson |
You could add essentially the same code to GitPlugin.java, like this:
|
2017-11-19 21:56:38.653000 daleanson |
However, I'm not sure the plugin should just automatically change the name of the
project without the users saying so. Probably the GitPlugin should provide an option
pane for ProjectViewer for the user to be able to choose this action.
|
2017-11-23 07:26:54.610000 ngc |
If I'm not mistaken you already added it, right?
|
2017-11-23 07:43:36.674000 ngc |
Update: There must be a fundamental difference between what you did and what my Macro
does.
|
2017-11-23 13:48:01.768000 ngc |
I've tested by deactivating the storing of the property and the exception is gone.
|
2017-11-23 14:44:59.969000 daleanson |
I just pushed a change, would you give it a try? The change makes sure the rename happens on the EDT, which appears to fix the problem. I say "appears" because I rebuilt ProjectViewer to help with debugging this, so my version of ProjectViewer may not be the same as the one from the plugin manager. I don't think that should make a difference, but let me know if this change doesn't work for you. |
2017-11-23 22:08:05.579000 ngc |
Seems to work except for the creation of a project.
|
2017-11-28 14:23:17.331000 ngc |
How will the branch be updated? Re-import of files didn't do that. |
2017-11-28 16:20:25.824000 daleanson |
I'll check, it updates when ProjectViewer sends a message on the EditBus, but it might not be checking for all the right messages, like on reimport. |
2017-11-29 10:23:10.941000 ngc |
FYI: Plugins > Git Plugin > Checkout Branch does not send a message on the EditBus, so the branch isn't updated in the view. |
2017-11-29 10:24:38.174000 ngc |
Additional Info: After checking out another branch, the setting about automatically
adding the branch name is lost.
|