Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335560 - No result in Sync View for non workspace resources
Summary: No result in Sync View for non workspace resources
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 0.11   Edit
Hardware: PC Windows Vista
: P3 major (vote)
Target Milestone: 0.11   Edit
Assignee: Dariusz Luksza CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-27 07:06 EST by Ilya Ivanov CLA
Modified: 2011-01-31 10:20 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Ivanov CLA 2011-01-27 07:06:21 EST
There's a problem in sync view with repository structure. Our project folder is not directly contained in repository root. Something like this:
repo.git/subfolder/project_folder/.project
This structure results in that nothing is displayed in Sync View. The reason is that IWorkspaceRoot.getContainerForLocation() method is used. For example:

Changed resource is: "/subfolder/project_folder/some_resource"
The result path will be: "P/project_folder/some resource" (because the nearest container is project and not the repo root).

the '/subfolder/' is dropped and DiffTree can't find changed resource.
Comment 1 Ilya Ivanov CLA 2011-01-28 05:54:37 EST
Pasting our e-mail discussion with Dariusz Luksza:

> Non-workspace files appears in sync-view but you cannot see what was changed because the compare view cannot be launched for it. This isn't a full functionality that we would like to have.

My goal was to allow non-workspace folders, because if some top folder is not in project, all sub-folders and resources (even those are part of synchronized project) don't appear in Sync View. 

> File org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java
> Line 67:                     res = root.getFolder(obj.getLocation());
> This code is somehow connected with topic of change?
>
> I suppose not, because even when it is commented the non-workspace files and folders appears in sync-view

This change fixed icon decoration for non-workspace folders. If adapter returns null, the folder appears with no icon in Sync View.

To reproduce the bug just create a repo with following structure:  repo/nonWSFolder/ProjectFolder/.project
You will see that Sync doesn't show anything.
Comment 2 Dariusz Luksza CLA 2011-01-28 13:27:26 EST
(In reply to comment #1)
> My goal was to allow non-workspace folders, because if some top folder is not
> in project, all sub-folders and resources (even those are part of synchronized
> project) don't appear in Sync View. 

But in commit message you writes about "non-workspace resources" not just "non-workspace folders" ;)

> This change fixed icon decoration for non-workspace folders. If adapter returns
> null, the folder appears with no icon in Sync View.

Yes, you have right here, my mistake.

> To reproduce the bug just create a repo with following structure: 
> repo/nonWSFolder/ProjectFolder/.project
> You will see that Sync doesn't show anything.

I'm testing it on quite similar repository layout and yes, the non-workspace folder appears in sync-view. Even when this folder contains modified file this file will be included in sync-view but it does not have any icon (I think that we can life with this, at least for a while) and you can not check what was changed in this non-workspace file because compare view cannot be launched (we cannot life without this functionality).

Yours patch fix this issue only partially. I'm looking forward to see next patch from you that will fix this issue also for non-workspace files ;)
Comment 3 Chris Aniszczyk CLA 2011-01-31 10:20:02 EST
Fixed with 0ae9bd1a2ec90847c0a511145440f672242d384f.

Thanks guys.