DESCRIPTION

Introduce context menu "import changed projects"

The context menu action "import changed projects" analyzes the files of
the commit and is importing the matching projects. This is a handy
feature for very large repositories with lots of projects where it is
impossible to import all projects. Import only the relevant projects
needed for the selected change/commit.

Change-Id: I55aac6258659d61088e9abdafe95f5a4a6a6fe63
Signed-off-by: Daphne Cuevas xxx@xxx.xxx

COMMENTS

author: Daphne Cuevas
date: 2014-09-10 15:14:24.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-09-10 15:14:30.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2014-09-10 15:31:10.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Kyler Ryan
date: 2014-09-11 13:41:40.000000000

Patch Set 1: Code-Review-1

(4 comments)

File Comment: org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/HistoryViewCommands.java -> we should avoid this file appear changed just due to an empy line

Line:183, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> we should check that we do not search in directories above the root of the repository the changed files are located in

Line:188, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> it would be nice to get a notification about files no .project has been found for

File Comment: org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java -> seeing this file as "changed" just due to an empty line should be avoided

-------------------------------------
author: Douglas Trujillo
date: 2014-09-11 15:10:01.000000000

Patch Set 1: Code-Review-1

(14 comments)

I think this is a command which will only be used by a few users (those using a huge repository with many projects), hence I would like to avoid to add it to frequently used menus which are already pretty long. Hence I suggest to only add it to the history view as this is the place where it makes most sense as the command is inspecting a single commit as far as I understood.

Maybe you could also add it as an option to the already existing "Import Projects" command on repository nodes in the repositories view ?

Line:397, org.eclipse.egit.ui/plugin.properties -> I think it's not clear which changes are meant here:
* projects changed in a commit
* projects changed in all commits reachable from a branch
* projects changed in all commits reachable from a branch but not from another branch
* projects newly introduced in a commit/branch

Line:103, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/HistoryViewCommands.java -> remove this unrelated formatting change

Line:1, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> missing license header

Line:45, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> we want JavaDoc on public classes and public non-trivial methods

Line:47, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> I'd rather name this like the menu entry: ImportChangedProjectCommand

Line:60, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> style nit: we don't use braces around single line blocks

Line:129, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> I hit this when trying to import changed projects from the history view and this error only ended up in the error log without direct feedback for the user, it should be shown in an error dialog so that the user knows what went wrong.

I don't understand how this can fail in the history view if it shows the history of a repository, in that case the repo should be known

Line:138, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> why not RevWalk ?

walks which are no longer used should be released in a finally block

Line:159, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> why not RevWalk ?

Line:206, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> fix discouraged access warnings

Line:223, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> why this catch all ?

Line:3452, org.eclipse.egit.ui/plugin.xml -> it's unclear what are relevant projects hence better
s/RepositoriesViewImportRelevantProjects/RepositoriesViewImportChangedProjects/

Line:843, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java -> remove this unrelated formatting change

Line:10, /COMMIT_MSG -> what are matching projects ?

do you also import projects needed to compile the "matching projects" ?

-------------------------------------
author: Douglas Trujillo
date: 2014-09-11 15:15:10.000000000

Patch Set 1:

some more comments:
* I think it would make sense to show feedback which projects have been imported, maybe in a wizard similar to the one opened when clicking "Import Projects" on a repository node in the repositories view
* in this feedback page maybe show all projects and pre-select those found by the command and allow the user to add some more projects or remove some in the same step 
* maybe instead of adding an explicit menu action you could add a preference to enable automatic triggering of the command when the user switches to a different branch ? Or both an excplicit action and a preference to auto-trigger the command ?

-------------------------------------
author: Daphne Cuevas
date: 2014-09-12 16:43:45.000000000

Patch Set 1:

(12 comments)

Line:397, org.eclipse.egit.ui/plugin.properties -> it is the first. Could you please help in finding a better name? Please make a proposal.

Line:103, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/command/HistoryViewCommands.java -> done in https://git.eclipse.org/r/#/c/33192/

Line:1, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> done in https://git.eclipse.org/r/#/c/33192/

Line:45, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> Done

Line:47, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> Done

Line:138, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> Please help here. I am not an expert of EGit and JGit API. I just  tried to get it working.

Line:159, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> Same as above. Please give advise and help here.

Line:206, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> How? Plugin org.eclipse.ui.ide needs to be changed.

Line:223, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> see https://git.eclipse.org/r/#/c/33192/
switched to CoreException

Line:3452, org.eclipse.egit.ui/plugin.xml -> please take a look at the last patchset of https://git.eclipse.org/r/#/c/33192/ 
If the naming is fine, I will move all the changes from stable-3.4 to master.

Line:843, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java -> done in https://git.eclipse.org/r/#/c/33192/

Line:10, /COMMIT_MSG -> No, only the matching projects for the files containing in a revision will be imported. 
Use case is the following:
User fetches a change done by a colleague for code review or testing. Now he wants to ensure that all the projects needed for this change are locally imported so that the build will work locally and the change can be tested running the target ide (for eclipse plugin projects). Finding all the necessary projects for a change by hand is quite complex for a large git repository and can be taken over by the tool.

-------------------------------------
author: Douglas Trujillo
date: 2014-11-07 13:45:02.000000000

Patch Set 1:

(5 comments)

Line:397, org.eclipse.egit.ui/plugin.properties -> "Import projects changed in latest commit"

Line:183, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/ImportRelevantProjectsCommand.java -> good point, this should be ensured

Line:3452, org.eclipse.egit.ui/plugin.xml -> the names in the other change look good

Line:843, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/CommitGraphTable.java -> I won't cross review two changes, this new feature can only be accepted on master so I'd prefer if you do the updates to fix review comments here

Line:10, /COMMIT_MSG -> from where do the other bundles needed to compile and run come if the projects aren't imported ?

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