DESCRIPTION

Extract non-decoration things into new IResourceState

Separates UI-related things like branch names (actually labels) from
the state of the file in the repository and enables use of this state
elsewhere without incurring overhead for name calculations.

Bug: 355809
Change-Id: If283be82612b15d14c773eea628777eb79f263ae
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Brenden Conley
date: 2015-11-26 18:24:40.000000000

Patch Set 5:

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

-------------------------------------
author: Jayvion Booth
date: 2015-11-26 18:26:41.000000000

Patch Set 5: Code-Review+2

-------------------------------------
author: Brenden Conley
date: 2015-11-26 18:47:53.000000000

Patch Set 5: Verified+1

Build Successful 

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

-------------------------------------
author: Douglas Trujillo
date: 2015-11-26 21:35:41.000000000

Patch Set 5: Code-Review-1

(1 comment)

Line:67, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> s/staged/isStaged/  this would be more consistent compared to the other methods

-------------------------------------
author: Alayna Houston
date: 2015-11-28 11:22:54.000000000

Patch Set 5:

(1 comment)

Line:67, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> I had thought about that, too. But an "is..." or "has..." method name implies (for me, at least) a boolean result. In the end I decided to keep the former name. All this was factored out of IDecoratableResource. Perhaps "getStaged" or "getStaging" would be better.

-------------------------------------
author: Jayvion Booth
date: 2015-11-29 20:39:58.000000000

Patch Set 6: Patch Set 5 was rebased

-------------------------------------
author: Jayvion Booth
date: 2015-11-29 21:38:52.000000000

Patch Set 5:

(2 comments)

Line:35, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> Usually I like to have "UNKNOWN" enum entry for such enum types. Does this make sense?

Line:67, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> I would rename Staged enum to State and this method to getState().

-------------------------------------
author: Jayvion Booth
date: 2015-11-29 21:41:37.000000000

Patch Set 5:

(2 comments)

Line:37, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/ResourceState.java -> "staged" would be then "state"

Line:85, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/ResourceState.java -> setState() sounds also better

-------------------------------------
author: Alayna Houston
date: 2015-11-30 06:08:30.000000000

Patch Set 5:

(2 comments)

Line:35, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> Not sure. This represents the staging state of a resource. How can that be unknown? Either it _is_ staged, and then it is one of modified, added, removed, or renamed, and otherwise is not staged. UNKNOWN might be the initial state, but in what way would it differ from NOT_STAGED?

Line:67, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> Just "State" is too general IMO. Probably simply renaming this method to "getStaged" is good enough. Or rename the enum to "StagingState" and then "getStagingState", but that is a bit cumbersome.

-------------------------------------
author: Jayvion Booth
date: 2015-11-30 07:46:21.000000000

Patch Set 5:

(2 comments)

Line:35, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> OK.

Line:67, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> StagingState sounds OK. getStagingState() is also OK.
I do not like "Staged" and getStaged() because it implies that the result is "staged" but it is not, or not always :-)

Reading code like: if (staged() != NOT_STAGED) makes me crazy.

-------------------------------------
author: Alayna Houston
date: 2015-11-30 18:35:16.000000000

Patch Set 5:

(1 comment)

Line:67, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/resources/IResourceState.java -> Done.

-------------------------------------
author: Gerrit Johnathan Pham
date: 2015-11-30 23:52:54.000000000

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

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