DESCRIPTION

Added check for warnings and errors before commit

Bug: 475559
Change-Id: I352c33d0fed1b610babda2992c6b1b211952dfb2
Signed-off-by: Reilly Hart xxx@xxx.xxx

COMMENTS

author: Reilly Hart
date: 2015-09-03 12:43:52.000000000

Uploaded patch set 5.

-------------------------------------
author: Brenden Conley
date: 2015-09-03 12:43:58.000000000

Patch Set 5:

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

-------------------------------------
author: Brenden Conley
date: 2015-09-03 13:06:43.000000000

Patch Set 5: Verified+1

Build Successful 

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

-------------------------------------
author: Reilly Hart
date: 2015-09-03 13:16:10.000000000

Patch Set 5: Code-Review+1

-------------------------------------
author: Douglas Trujillo
date: 2015-09-03 22:09:50.000000000

Patch Set 5: Code-Review-1

(1 comment)

> I still found some problems:
 > * when changing the option in the staging view this isn't reflected
 > in the preferences, when closing and reopening the staging view the
 > change is gone. Changes to view configurations should be always
 > persisted immediately.
 > * when changing the option in the preference editor this isn't
 > reflected in the staging view if it was already open, probably it
 > lacks some event handler listening on the preference change
 > * I think we should show an explicit warning if the commit button
 > is disabled explaining why, the staging view already has a warning
 > area above the commit message editor which displays warnings if
 > present

this problems are still present

Line:1027, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/uitext.properties -> s/contains/contain/

-------------------------------------
author: Douglas Trujillo
date: 2015-09-03 22:17:42.000000000

Patch Set 5:

see here how you can implement a listener which reacts to preference changes
https://git.eclipse.org/r/#/c/54829/5/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java

-------------------------------------
author: Jayvion Booth
date: 2015-09-03 22:18:23.000000000

Patch Set 5: Code-Review-1

(11 comments)

I will push my changes which are still not complete. I've fixed many but not all comments below. Please follow up.

Open issue: commit dialog warning should react on selection. If the file with warnings or errors is unselected, the warning must go away.

Also you will see 2 TODO's in the StagingView.

Line:3192, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/UIText.java -> Typo. _c -> _C

Line:855, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> should be not selected by default.

Line:887, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> whitespace change again

Line:2600, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> the check happens before the content is updated, so it must be moved after content update.

Line:2664, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java -> this line overrides the button eneblement again. Not your fault, but we should fix it to get it working.

Line:570, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java -> Please don't add unrelated white space changes

Line:730, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java -> here we should put an "if(ignoreErrors != null)" where we decide if we should show a normal information above or setMessage(UIText.CommitDialog_MessageErrors, IMessageProvider.WARNING);

Line:799, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java -> please restore new line

Line:820, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java -> Why "true"? It should be "false" - do *not* ignore warnings/errors because check_before_committing is *on*.

Additionally I miss the warning shown if the dialog is opened. Might be it works for you, but on Linux while dialog is not shown the event is not dispatched. 

So I would put this line above adding the listener, and put setMessage(UIText.CommitDialog_MessageErrors, IMessageProvider.WARNING); at line 730 above.

Line:957, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java -> the method does not what the name says. It should just be named "updateCommitButtons" and take a boolean. So you can use this in another place too.

Line:1173, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/CommitDialog.java -> The check should happen before defining commit status message/type, and if noErrors == false the message/type must be set to the warning.

-------------------------------------
author: Gerrit Johnathan Pham
date: 2015-09-11 23:59:01.000000000

Change has been successfully merged into the git repository by Douglas Trujillo

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