DESCRIPTION

Prevent Git Staging view to lose data when precommit hook aborts commit 

- CommitJob should not reset commit message if commit was aborted
- enableCommitWidgets() should not reset text widgets as a side effect

Bug: 461233
Change-Id: Id9902fa169ff68fd5727e88601357ae08a531470
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2015-03-06 14:59:10.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2015-03-06 15:16:45.000000000

Patch Set 1:

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

-------------------------------------
author: Maleah Marks
date: 2015-03-06 15:19:08.000000000

Patch Set 1:

(3 comments)

Line:131, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java -> I would find it more natural to return an IStatus that is not OK_STATUS in the case the commit has failed.
That way there's no need to add some artificial boolean in this Job class to keep track of the result.

Line:1218, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Is the removal below really related to the abort of a commit by a hook?
I'm pretty sure I'm wrong but I don't see the relation with the other changes.

Line:2655, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> Here you could access the IStatus that was returned by the job.

-------------------------------------
author: Brenden Conley
date: 2015-03-06 15:33:58.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2015-03-06 15:49:54.000000000

Patch Set 1:

(2 comments)

Line:1218, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> this wrong side effect doesn't hurt if the commit succeeds since then the commit message will be cleared (it's no longer needed since the commit was created) and committer and author field are repopulated by reinitialization of the CommitMessageComponent

Line:2655, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> I tried that if I return an error status then the Job framework seems to automatically bring up a generic error dialog. Is there a way to prevent this or raise a custom error dialog ?

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