DESCRIPTION

Add a "Git Repositories View"

This is a very first implementation of a "Git Repositories View"
(analogous to e.g. CVS Repositories View). It allows addition
and removal of local Git Repositories, cloning of Git
Repositories as well as checking-out of branches.

Project import can be done using the standard "Import Existing Projects"
wizard.

We should use bug 301168 to discuss this.

Bug: 301168 (also: 281394, 302742, 303403)

Signed-off-by: Willow Cantrell xxx@xxx.xxx

COMMENTS

author: Yoselin Hanna
date: 2010-03-12 18:41:49.000000000

Patch Set 1: I would prefer that you didn't submit this; No score

This is interesting.  I have only taken an initial scan through the code, but I think there is a lot of potential here for something very useful for users.  Notes on some lines below.  Obviously we don't want to submit this in its current state, but I'm happy to see this bug being worked on.

Line:108, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Style-nit:  As a project we prefer "static final".  And at least please be consistent within the same class, just 17 lines later you use the reverse ordering of "static final".

Line:160, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Would it be cleaner to just have different subclasses of this class for the different types that can appear?  Rather than faking a type system using an enum and some rather ugly switch statements?

Line:530, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Can you use Repository.shortenRefName here to shorten the leaf's name?  Showing refs/heads/ to a user is ugly.

Line:533, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Every one of these calls causes a disk IO operation.  (Well, open, read, close.  Hopefully its cached.)  You might want to cache this in the repository node when children are fetched so we aren't incurring this lookup every time the UI needs the label text.

Line:542, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Can you use Repository.shortenRefName here to shorten the name?  Showing refs/heads/ to a user is ugly.

Line:1004, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> FWIW, this is nested way too deep.  Maybe some utility classes or helper methods at the outer class would help.

Line:1048, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Hmm.  We probably can't active detect file locks on pack files on Windows, can we?  It would be nice if we could support a delete, but only if the repository is reasonably believed to be not-in-use right now.

Within EGit you might be able to check GitProjectData and its repositoryCache to see if the repository is open by this workspace.  If it is, then we know we shouldn't try to delete it.

Line:1147, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Obviously this text needs to be externalized.

Line:1302, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Use Constants.DOT_GIT.

But actually if you want to test that a directory is a Git repository, use RepositoryCache.FileKey.isGitRepository().

-------------------------------------
author: Juliet Cantu
date: 2010-03-12 22:00:28.000000000

Patch Set 1: I would prefer that you didn't submit this; No score

You should also add NLS string

Line:160, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> or attach methods to the enum values.

Line:260, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Please sort.

Line:290, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Just iterating over the values results in easier to read code.

Line:318, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Please sort the result here

Line:353, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Reusing messages across different view is, I think, not a good thing. The name of this message clearcly states that it belongs to anoter piece of code.

Line:1280, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> forgot something?

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:18:03.000000000

Patch Set 1:

Most suggestions were implemented. I also externalized Strings and added Icon support.

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:108, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:160, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Added the icons support to the enum.

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:160, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> I added Icon support to the type enum, so I would rather stay with that. Going for subclasses wouldn't do away with the type, either, unless you would want to use instanceof to detect the actual type.

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:260, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:290, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:318, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:353, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:530, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:533, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:542, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:1004, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:1048, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Added your remarks to the code in the form of comments. Let's try to look into this in one of the next iterations.

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:1147, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:1280, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

-------------------------------------
author: Willow Cantrell
date: 2010-03-15 14:17:09.000000000

MISMATCHED INLINE COMMENT
Line:1302, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java -> Done

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