DESCRIPTION

Get HEAD commit info in ModalContext to avoid UI freezes

getHeadCommitInfo() is potentially long running and should not freeze
the UI thread.

Bug: 457105
Change-Id: I73d4f9b31b2c40eea15416aea7059404e4c762d9
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2015-01-09 07:33:37.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2015-01-09 07:45:47.000000000

Patch Set 2:

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

-------------------------------------
author: Brenden Conley
date: 2015-01-09 08:00:56.000000000

Patch Set 2: Verified+1

Build Successful 

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

-------------------------------------
author: Jayvion Booth
date: 2015-01-09 09:48:42.000000000

Patch Set 2: Code-Review-1

If I put breakpoint into the new runnable, open staging view, say amend: I see no progress dialogs, no busy cursors, nothing and *can commit*. 

So if this can take time user will not notice anything and simply commit without having actual amended commit head info inserted.

Unfortunately using 
new ProgressMonitorDialog(getShell()).run(true, false, 
blocks UI with the modal dialog. 

Same with 
PlatformUI.getWorkbench()				.getProgressService().busyCursorWhile(new IRunnableWithProgress() {

They will do it in a nicer way as before and user knows what happens, but still not the best way may be, but better as committing without amended info.

The best solution would be to have a (view/wizard) context from ICommitMessageComponentNotifications and reuse their progress services to indicate that staging view (or commit wizard) is doing something but not block the entire UI for that.

-------------------------------------
author: Douglas Trujillo
date: 2015-01-09 10:13:05.000000000

Patch Set 2:

thanks for catching this, didn't think that far. I will try what you proposed

-------------------------------------
author: Jayvion Booth
date: 2015-01-09 10:19:47.000000000

Patch Set 2:

Just tried to use IWorkbenchSiteProgressService but this one also blocks the entire UI, not only the view.

So I would just use 
ProgressMonitorDialog(getShell()).run(true, false

as we do it in many other places.

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