DESCRIPTION

Do not pass on an uninitialized scope to callers from GitScopeUtil

This scope manager will be passed on as-is to Team, and
some implementations of the Team APIs will rely on its
proper initialization lest they fail in NPEs.

Signed-off-by: Gustavo Green xxx@xxx.xxx
Change-Id: I0025ac1a6c53eeba48ee4d35f230964ddd3072a0


COMMENTS

author: Brenden Conley
date: 2014-10-06 08:12:33.000000000

Patch Set 5:

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

-------------------------------------
author: Brenden Conley
date: 2014-10-06 08:27:53.000000000

Patch Set 5: Verified+1

Build Successful 

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

-------------------------------------
author: Sebastian Porter
date: 2014-12-11 15:52:40.000000000

Patch Set 5:

Is it really necessary to run this in a job? Almost all other places just use this pattern:

subscriber.init(new NullProgressMonitor());

If you really want to make use of the progress monitor then #collectRelatedChanges should pass in its monitor into #createScopeManager.

-------------------------------------
author: Gustavo Green
date: 2014-12-11 16:02:30.000000000

Patch Set 5:

Well, since initializing the scope is potentially a long-running operation, I find it better for the user to know that "something" is happening... using a null progress monitor would just do that without feedback. Do you think the pre-fetching is quick enough to bypass the progress reporting?

-------------------------------------
author: Sebastian Porter
date: 2014-12-11 16:32:20.000000000

Patch Set 5:

>Do you think the pre-fetching is quick enough to bypass the progress reporting?
I can't speculate on that but at other places we also don't do it there, but in the client code. Also here, the code that calls it already reports progress, and if you want to report correct progress then you'd have to pass the progress monitor into the method.

Matthias, what do you think?

-------------------------------------
author: Douglas Trujillo
date: 2015-01-02 21:45:12.000000000

Patch Set 5:

if we pass the monitor into #createScopeManager how can it pass the monitor to the WorkspaceJob ?

-------------------------------------
author: Gustavo Green
date: 2015-01-05 08:32:55.000000000

Patch Set 5:

>if we pass the monitor into #createScopeManager how can it pass the monitor to the WorkspaceJob ?

I believe Dani was referring to not calling a workspace job for the subscriber.init(...) call, but rather pass the monitor to createScopeManager and directly using it as parameter to the "init" method, without creating and scheduling a job for it.

-------------------------------------
author: Sebastian Porter
date: 2015-01-15 16:33:59.000000000

Patch Set 5:

Right

-------------------------------------
author: Douglas Trujillo
date: 2015-01-16 00:01:40.000000000

Patch Set 5:

then I'd follow Dani's advise

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