Sunday, 1 September 2013

Eclipse, GIT branches, Working Sets and Target Platform why Egit sucks in this.

Eclipse, GIT branches, Working Sets and Target Platform why Egit sucks in
this.

I am looking for a way to work with different GIT branches and have the
Eclipse workspace in sync. with the directory structure of the GIT
branches. In this case the branches will differ as projects have moved
around from subdirectoris. To illustrate:
master
plugins
plugin1
plugin2
feature1
topic_organize
plugins
plugin1
plugin2
features
feature1
I think the current Egit solution is not workable. What it does it close
projects which are not in the new branch. (When I switch branches in the
cmd line, is even more horrific, Egit actually recreates the missing
projects! in this case, when I switch to branch "topic_organize", the
project feature1 in plugins will be recreated by EGit, my repo is
automatically not clean which I sincerely despise, when switching to a
branch).
What it doesn't do (and should do) is to start with a clean workspace, and
import all the projects and organize them in working sets and on top load
the appropriate target platform.
The consequence of not doing what is should is, that I have to 1) manually
import missing projects, 2) remove projects created by EGit which are in
my repo, but not imported in the workspace. 3) Create working sets if
these differ between branches. (In my case the working sets, are equal to
the sub-dirs in the repository). 4) Clean my GIT repo.
As a best-practise towards a full solution is to create a team project
set. The working steps would be.
Import your projects from GIT and add them to working sets corresponding
to the directories in the GIT repo.
Export a Team Project set to a special project. (Make sure the location of
this project never moves in GIT).
Commit this "team" project, so your GIT branch is clean.
Clean your workspace. (I mean start with a clean workspace by removing all
working sets and projects).
Switch branch on the command line (You won't be able to switch with a
clean workspace).
Select file import, import Team Project Set (.psf) file. (Assuming you did
step 1,2,3 for the other branch as well).
tada your workspace is back with working sets and all projects open.
Change your target platform if needed.
NOW MY QUESTION :P
Do I miss something? Is this there a way to clean the workspace in one go?
Now I have to remove the working sets first, then the projects by
selecting them one by one! (Perhaps I should switch the workspace as
well?).

No comments:

Post a Comment