DESCRIPTION

[repoView] Show name of checked out tag in repository label

Make the project decoration and repository decoration be
consistent when showing a non-symbolic ref.

This moves the logic to compute a short branch string
for a repository to RepositoryUtil to be accessed by
both the decorator for resources and the decorator
for repository view elements.

Updates the following decoration styling:
  * Ref name is now shortened so "refs/tags" prefix is dropped
  * Ref name is shown before abbreviated SHA-1
  * Parentheses have been removed
  * Ellipsis has been removed
  * Single space between ref name and SHA-1

Change-Id: Id8a1b6089763fd17980de7640fd42f14f2d41c2e


COMMENTS

author: Danika Greer
date: 2012-06-05 17:14:14.000000000

Patch Set 1: Verified

(1 inline comment)



Line:404, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> Would replace that with:

    String fullBranch = head.getObjectId().name();

and rename fullBranch to objectId, to make it clear that this is an ID, not a branch name.

-------------------------------------
author: Danika Greer
date: 2012-06-05 17:17:18.000000000

Patch Set 1: (1 inline comment)



Line:408, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> Should we abbreviate this using repository.newObjectReader().abbreviate(...) (with release() of course)? Would make sure that the ID can be resolved.

-------------------------------------
author: Jaidyn Nichols
date: 2012-06-05 17:19:52.000000000

Patch Set 1: (1 inline comment)



Line:408, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> I think that is overkill, I believe the odds of multiple SHA-1s in the same repository having the same 7 character prefix is incredibly small and other label providers don't worry about it.

-------------------------------------
author: Danika Greer
date: 2012-06-05 17:29:50.000000000

Patch Set 1: (1 inline comment)



Line:408, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> Hm, see here: https://lkml.org/lkml/2010/10/28/264

-------------------------------------
author: Jaidyn Nichols
date: 2012-06-05 17:37:56.000000000

Patch Set 1: (1 inline comment)



Line:408, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> That is an interesting read and I'm not oppose to changing it but it shouldn't be done in this commit affecting only a single place in the UI.

This commit was intended to clean up the presentation of checked out non-symbolic refs in the repositories view to be consistent with the project label decoration.

Previously 7 characters was shown with an ellipsis and I removed the ellipsis since SHA-1s are always 40 characters and  so showing the ellipsis is a waste of space in my opinion since it is dramatically shorter visually, 40 characters versus 7 characters and so I don't think the ellipsis adds any value.

If we want to change the 7 character abbreviation to actually verify the abbreviation is unique in the repository it should be done in a separate commit affecting all places in the UI consistently.

-------------------------------------
author: Danika Greer
date: 2012-06-05 18:03:46.000000000

Patch Set 1: (1 inline comment)



Line:408, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> I agree that it should be done separately, and also not for 2.0. I was just wondering about it there.

-------------------------------------
author: Jaidyn Nichols
date: 2012-06-05 19:49:45.000000000

Patch Set 1: (1 inline comment)



Line:404, org.eclipse.egit.core/src/org/eclipse/egit/core/RepositoryUtil.java -> Done

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