DESCRIPTION

Gracefully ignore linked resources

A project may contain resources that are not located within the
project's directory in the local file system. These resources are
referred to as linked resources.
This patch adds a few checks to gracefully ignore them in a few
functional cases: iterator, handlers, actions, etc.

Bug: 333338
CQ: 6965
Change-Id: I5005ed46cdfab47fc6913dbd46fc1291b2ac79ab
Signed-off-by: Hamza Perez xxx@xxx.xxx
Signed-off-by: Malia Sampson xxx@xxx.xxx
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2012-12-23 01:42:28.000000000

Uploaded patch set 16.

-------------------------------------
author: Brenden Conley
date: 2012-12-23 01:42:34.000000000

Patch Set 16:

Build Started https://hudson.eclipse.org/sandbox/job/egit.gerrit/3885/ 

-------------------------------------
author: Douglas Trujillo
date: 2012-12-23 01:47:51.000000000

Patch Set 16: Looks good to me, but someone else must approve; IP review completed

(1 inline comment)

fixed style nits

Line:42, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/LinkedResourcesTest.java -> reformatted to make this file follow standard formatting settings

-------------------------------------
author: Brenden Conley
date: 2012-12-23 01:55:54.000000000

Patch Set 16: I would prefer that you didn't submit this

Build Unstable 

https://hudson.eclipse.org/sandbox/job/egit.gerrit/3885/ : UNSTABLE

-------------------------------------
author: Danika Greer
date: 2012-12-23 13:32:10.000000000

Patch Set 16: Do not submit

(11 inline comments)

See inline comments.

Line:43, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/NoAssumeUnchangedActionHandler.java -> This is also a regression that makes the action no longer work for multiple repositories.

Line:42, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java -> This makes the action no longer work on multiple repositories. I'd prefer not to regress here.

Line:48, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWorkspaceActionHandler.java -> This is also a regression, it no longer works for multiple repositories. Note that there is extra code below which handles multiple repositories.

Line:104, org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java -> This variant is not used anywhere. I'd prefer to only introduce it when it's actually needed from somewhere.

Line:42, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/UntrackActionHandler.java -> Same here.

Line:77, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RemoveFromIndexActionHandler.java -> This also regresses in that it no longer works for multiple repositories.

Line:130, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitResourceDeltaTestHelper.java -> Please use assertThat, gives a much better message in case of failure:

    assertThat(changedResources, Matchers.hasItem(root.findMember(file)));

Line:131, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitResourceDeltaTestHelper.java -> Please use assertEquals here, gives a better assertion failure message.

Line:134, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitResourceDeltaTestHelper.java -> This doesn't seem to be used anywhere, please remove it. With the changes from above comments, the assertion errors are doing the job of helping with "debugging".

Line:80, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java -> Why is this changed? Before, this action worked on multiple repositories. With this change, it no longer does.

Line:502, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java -> This seems to be from a previous revision of this patch, it has no callers -> please remove.

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 18:39:33.000000000

Patch Set 16: (1 inline comment)



Line:502, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java -> Actually I forgot to remove this in my last patch set. I'm fine removing it, will do it in the next patch set.

-------------------------------------
author: Kade Schaefer
date: 2012-12-26 15:50:17.000000000

Patch Set 16: (4 inline comments)



Line:80, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java -> I finally removed the throwing of a CoreException in the corresponding DiscardChangeOperation.

Line:80, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java -> Actually DiscardChangesOperation will throw an exception if a resource is without a repo, which could happen for a linked resource. So either we change the operation to not throw an exception, or we disable this handler when a linked resource is selected.

Line:80, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/DiscardChangesActionHandler.java -> Actually in case of a linked resource pointing to a file not in any repo, the underlying operation will probably NPE... Need more time to prevent this, right now it's Xmas eve...

Line:502, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java -> Done

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:43, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/NoAssumeUnchangedActionHandler.java -> Done

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:42, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java -> Done

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:42, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/IgnoreActionHandler.java -> Actually I had to make the underlying operation able to handle linked resources that point to a file that does not map to a git repo.

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:48, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWorkspaceActionHandler.java -> Done, but had to amend the code to ignore linked resources that do not map to a repo.

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:103, org.eclipse.egit.core/src/org/eclipse/egit/core/project/RepositoryFinder.java -> It's used in the previous method... Did you mean to merge both methods?

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:42, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/UntrackActionHandler.java -> Done

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:77, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RemoveFromIndexActionHandler.java -> Done

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:130, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitResourceDeltaTestHelper.java -> Done

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:131, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitResourceDeltaTestHelper.java -> Done

-------------------------------------
author: Kade Schaefer
date: 2012-12-24 17:49:02.000000000

MISMATCHED INLINE COMMENT
Line:134, org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitResourceDeltaTestHelper.java -> Done

-------------------------------------
