Defeatomizer / MCreatorVCSPlugin

An unofficial plugin for MCreator to support VCS integration.
https://mcreator.net/plugin/97468/remote-workspaces-support-20232
GNU General Public License v3.0
5 stars 0 forks source link

Local branch should be deleted when remote branch is removed #7

Closed Senmori closed 1 year ago

Senmori commented 1 year ago

Use cases

  1. Have an icon/button next to the branch selector that lets us delete/remove local branches. This should include any unsaved work on that branch. If you are on that branch when you delete, it should kick you back to the master branch.

  2. When opening the branch selector, it should automatically sync the remote branches and prune any branches that are no longer existing (i.e. remove 'refs/remotes/origin/....' from the branch selector).

  3. Replace 'sync local changes with remote workspace' with 'push local changes to remote repository'

  4. Replace 'pull changes from remote workspace' with 'pull changes from remote repository'.

Feature requests number 3 & 4 would align more with git terminology and be more intuitive for what they actually do. At the moment, branch management with this plugin is not good, especially if you have multiple branches and work is being done on more than one branch. The ability to clean our branches would be immensely helpful without having to resort to deleting the files manually in the .git folder.

Possible implementation

  1. Create a icon/button/dialog that lets users delete local branches (including any work done on that branch).
  2. A checkbox to sync remote branches

Visual example(s)

No response

Additional context

No response

LeDemmers commented 1 year ago

I second this.

Defeatomizer commented 1 year ago

Thanks for your feedback on the plugin! Speaking of points 3 and 4, there are separate terms for Git(Hub) and MCreator. Remote workspace is MCreator workspace stored within a remote repository, or a remote repository containing files related to MCreator workspace, this is why different term has been used all the time across (what is now) this plugin. As about points 1 and 2 (these should be separate feature requests though), I think I know how to implement what you want and I'll try to do that in a few days and share the results here if you'd like.

Defeatomizer commented 1 year ago

The Current branch: <...> button now has Rename current option included in its menu and also Fetch branches and Delete branch buttons next to it (the second button opens similar menu without New/Rename options). Does that sound to suit you, @Senmori?

If you are on that branch when you delete, it should kick you back to the master branch.

This can not be applied to the master branch itself, which I suppose is one of reasons e.g. IntelliJ IDEA does not offer this behavior and simply excludes the Delete option from context menu for current branch. There should always be at least one branch in each repository, so to remove current working branch, you need to make sure you have another branch to switch to.