Progress on non-workspace files in Workspace presentation model

For last three weeks I was working on including non-workspace files in Workspace presentation model in Synchronize View. This idea can sounds weird since the Workspace presentation model was designed to show only changed files that are in Eclipse workspace … but there are some use cases in which such behavior seams to be reasonable (eg. EGit and JGit projects doesn’t import repository root into workspace only projects are imported and files like master pom.xml, README, LICENCE and so on are left outside workspace).

If you don’t import all data into Eclipse workspace you won’t see any incoming nor outgoing changes. Even more, after merge/rebase actions changes in non-workspace files will magically appear in those resources and can even brake something (eg. massed up in master pom.xml file).

So, what is current status ? First of all I want to point that I’m describing here current situation in my working copy, described here changes currently are not available in public. After hours of debugging, code analysis and rewriting my code I’ve manage to show some indication in synchornize view that there are some non-workspace chagnes. The next step will be to show what particular file was changed and then enable all operations like overwrite, mark as merged, etc.

Here is a screenshot showing current status:

Non-workspace files in Workspace presenation model
As you can see there is home folder in sync results. It even have expand indicator (but after expanding it there is nothing inside). I suppose that on windows this folder will correspond to drive letter, but I’m not sure here.  Now I only need to tell Team Framework that there are some files inside home node …

This seams to be quite easy task, since parent folder is already included in view … but this isn’t that easy. First of all Workspace model is based on IResource‘s with are manageable by Eclipse platform. Of course I can create such resource using IWorkspaceRoot.getFolder() and IWorkspaceRoot.getFile(). Unfortunately non-workspace resources created by those two methods will return theirs first segment (on unix system it will be usually /home) as theirs project. Of course such project doesn’t exist in workspace therefore this node is empty.

Honestly speaking I currently don’t have any good ides how to move things forward … as usually I’ll dive into debugging and code analysis …

Any hints and ideas from the community are kindly welcome!

Show non-workspace resources in Git Change Set

Synchronize view in EGit doesn’t show non-workspace files from its very beginning. This issue seams to be very complicated and also it seams to require lots of hacking on team framework and eclipse API.

Few days ago Ilya Ivanov from Intland pushed into our gerrit a patch that should fix this issue. I was very surprised that this change is so small and simple. It only works partially because the compare editor cannot be launched for non-workspace files. In my opinion this patch cannot be merge into master branch without this core functionality, so today I spent about 3 or 4 hours hacking on that topic … and here are results:

As you can see, there is master pom file (with isn’t imported into eclipse workspace) in synchronize view and on the left hand side there is a compare  editor for it, showing what was changed ;>

Currently both patches are waiting for review in gerrit, but I think that they will be merged into master soon 😉