DESCRIPTION

Monitor Eclipse editors changing workspace external text files

Editing files which are outside workspace (not inside any project or
inside closed projects) should trigger refresh of the index state. A
buffer listener is added to the ITextFileBufferManager which updates the
IndexDiffCacheEntry if the file is recognized as "external".

Change-Id: I7f6d324d0238b49016a7189568ce2c492a39d0eb
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Jayvion Booth
date: 2015-11-15 07:54:12.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2015-11-15 07:54:18.000000000

Patch Set 2:

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

-------------------------------------
author: Brenden Conley
date: 2015-11-15 08:18:21.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/7804/ : SUCCESS

-------------------------------------
author: Alayna Houston
date: 2015-11-15 12:08:58.000000000

Patch Set 2:

(3 comments)

Indeed it was late yesterday.

I'm sorry, but I now think this is still not the right place. This is an additional listener to update the right IndexDiffCacheEntry. I actually think it belongs there, like the listener or resource change events. Yes, that's over in core, but note that none of the new imports are UI-related. So I think this can be moved safely over to org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry. Core would need a new plugin dependency on org.eclipse.core.filebuffers.

Line:516, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Nit: this is actually a completely unrelated change that might have been done in a separate commit.

Line:620, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Why this? Isn't it the RepositoryChangeScanner's responsibility to know about this? Updating the index diff cache should not have anything to do with this, should it?

Line:624, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> I do think this merits a comment: if we do get a file here, we know it's in an open project, and the IndexDiffCache will thus update via the IResourceChangeEvent, and therefore this listener doesn't have to do anything.

In fact, this kind of interplay with the resource change event listener over in IndexDiffCacheEntry is an indication to me that this should be moved there.

-------------------------------------
author: Alayna Houston
date: 2015-11-15 12:32:11.000000000

Patch Set 2:

(1 comment)

Line:634, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Looks like this also needs extra logic to deal with the file being a .gitignore file... (compare with the resourcechange listener in IndexDiffCacheEntry).

Try the following: create a top-level .gitignore in the repo. May be empty. Open project. Create a file "ignored.txt". Staging view will show the unstaged change (both, the .gitignore and ignored.txt). Now close the project. Open editor for .gitignore from git repositories view, add the line ignored.txt, and save. Now the staging view should remove the unstaged change for "ignored.txt", but it doesn't. Open the project again: only now the staging view will remove the "ignored.txt".

-------------------------------------
author: Jayvion Booth
date: 2015-11-15 12:36:54.000000000

Patch Set 2:

(3 comments)

Good points. I will move the code to egit core and add .gitignore support.

Line:620, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Done

Line:624, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Done

Line:634, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Done

-------------------------------------
author: Gerrit Johnathan Pham
date: 2015-11-15 15:35:07.000000000

Change has been successfully merged into the git repository by Jayvion Booth

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