DESCRIPTION

Trigger repository refresh independently of workspace refresh setting

Initially we always refreshed when the repository changed, but users
were not happy, so we tied it to the workspace refresh option. This ment
Eclipse performed unnecessary work by scanning resources twice. Both
an infrequent periodical scan and a triggered scan.

Now we only scan for index changes since a ref change by itself does
not hint that a resource has changed. In addition the default is to
only scan for repository changes and refresh resources when Eclipse
has an active workbench window, which means that you can perform Git
operations outside of Eclipse with no (or at least less) interaction
between Eclipse and C Git. This used to be a big problem for Windows
users performing rebase operations, because Eclipse locked files for
brief periods preventing C Git from updating them.

Change-Id: Id3fef6b884509e1a1a0bbf62fd1ae40ee0f1211e
Signed-off-by: Juliet Cantu xxx@xxx.xxx


COMMENTS

author: Juliet Cantu
date: 2010-08-29 13:11:14.000000000

Uploaded patch set 6.

-------------------------------------
author: Marlie Beasley
date: 2010-09-07 15:57:52.000000000

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

(2 inline comments)

Looks good.

Some small issues remaining:

1. 2 inline comments
2. typo in preferences page: ... when index change [changes]

Can you fix the small issues and rebase the change?
Then we can merge it in.

Line:220, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> why is listener needed? RepositoryChangeScanner Job reschedules itself when the workbench window is not active.
ResourceRefreshJob is scheduled by indexChanged Event.

Line:315, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> repositoriesChanged will always contain one repo. Pass this repo to triggerRefresh instead of using repositoriesChanged.

-------------------------------------
author: Marlie Beasley
date: 2010-09-10 16:34:40.000000000

Patch Set 6: (3 inline comments)



Line:220, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Now I understood this. It's done to schedule RCS without delay after window activation.

Line:315, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Is it possible that w threads in parallel enter onIndexChanged? In this case my first comment is wrong and synchronization on repositoriesChanged is needed.

Line:320, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> if triggerRefresh was not called because the Workbench window is inactive 
the change in repositoriesChanged is lost, right?
Perhaps it would be easier to do the refresh in any case.
The refresh does not conflict with command line git.
When RCS gets inactive due to inactive Workbench window there can only be refreshes triggered by the last RCS run.

-------------------------------------
author: Juliet Cantu
date: 2010-09-13 22:52:58.000000000

Patch Set 6: (3 inline comments)



Line:220, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Riight.

Line:315, org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java -> Yes. Any thread may trigger repository events. At the momemnt I'm not sure if that can happen, but imagine a pull beging performed in the background on one repo while committing in another

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

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