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 Staging view. 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-14 23:35:55.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2015-11-14 23:36:01.000000000

Patch Set 1:

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

-------------------------------------
author: Jayvion Booth
date: 2015-11-14 23:36:54.000000000

Patch Set 1:

Thomas, this is what you were looking before I guess :-)

-------------------------------------
author: Alayna Houston
date: 2015-11-14 23:48:24.000000000

Patch Set 1:

> Thomas, this is what you were looking before I guess :-)

More or less. Interesting approach. Works if the staging view is open. Doesn't work if the staging view is not open, file in closed project is edited (via git repositories view), and then saved. Then open staging view: unstaged change is still not shown. (No surprise.)

I think putting this in the staging view is not quite right. The fundamental problem is not that the staging view misses updates, that's just the symptom. The real problem is that the index diff doesn't get updated. So either this listener needs to be added more globally (activator?), or we find a more direct way to make editors on save also update the index if needed, even for files not in open projects.

-------------------------------------
author: Alayna Houston
date: 2015-11-14 23:59:09.000000000

Patch Set 1:

(2 comments)

One more thing: if we have such a listener, do we then still need the (just added) logic in LocalNonWorkspaceTypedElement to update the index diff?

Line:505, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> After a move, is this the old or the new location? Probably doesn't matter much, because we are notified of moves only for IFiles from open projects (if I understand this right), and for those, the index updates on IResourceChangeEvents anyway.

Line:549, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> This event is sent only for IFile. So for editing files from closed projects, this won't be called.

-------------------------------------
author: Brenden Conley
date: 2015-11-14 23:59:45.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Jayvion Booth
date: 2015-11-15 07:51:07.000000000

Patch Set 1:

> (2 comments)
 > 
 > One more thing: if we have such a listener, do we then still need
 > the (just added) logic in LocalNonWorkspaceTypedElement to update
 > the index diff?

Yes, the buffer manager isn't involved in this case for whatever reason.
I will move the code from StagingView to Activator. It was late yesterday :-)
Thanks for reviewing.

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

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

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