DESCRIPTION

WIP: Added support for nested (linked) Git repositories in project.

reworked based on "https://git.eclipse.org/r/#/c/67186/"

The fixes are going to support nested repositories in one project and
the submodule fixes are "only" related to this, because they are nested
repos too. I've not planned to fix submodules first, but we are
investigating to use them later.

For adding nested Git repos we use "links", so the sub-repos are not
located in the "projects root git repo" directly, they are only linked
there. Additionally we use "worktree add" and i've updated JGit to
proposed solution (see #477475) and have small fix in EGit too
(https://git.eclipse.org/r/67223).

Problems:
- the nested repos are detected during project import but decoration is
not there --> after project close and open the decorations are available
again
- the nested repos are only sometimes available in repository view (as
top repo) --> have to think about how to add them as nested repos like
done for submodules
- getMapping(IPath) still iterates over all projects and all
repositories --> have to understand the whole IPath, IResource etc.
differences and drawbacks
- synchronize view does not show linked repo changes --> all this
isLinked() stuff should be verified

TODOs:
- automatic tests (have tested it with some manually created repos and
eclipse projects)
  - for submodules
  - nested and linked repos

Bug: 446344
Bug: 401556
Bug: 411742
Change-Id: Ie9aa6bd9df812c515e9f4967e1fb06c17e7cf636
Signed-off-by: Genevieve Hudson xxx@xxx.xxx


COMMENTS

author: Genevieve Hudson
date: 2016-03-02 13:06:09.000000000

Uploaded patch set 3.

-------------------------------------
author: Douglas Trujillo
date: 2016-03-02 14:18:00.000000000

Patch Set 3:

> (1 comment)
 > 
 > > Do you think the isLinked() stuff will not be that easy to
 > support?
 > 
 > I think this is opening a can of worms. The removal of the
 > isLinked() check in GitResourceDeltaVisitor is a quite major
 > change; may not be that easy to get all edge cases right. And, as
 > you write yourself, all other isLinked() occurrences will need
 > examination, and I fear we may still discover a lot of places that
 > may just silently assume that resources are not linked. But perhaps
 > I'm overestimating this... don't let yourself be discouraged by my
 > reservations!
 
I don't (yet) buy this linking story, I think we should not go down this road. It looks like this adds another feature similar to but different from submodules which will _only_ work in Eclipse and seems to increase complexity. There is probably no way to use this from JGit or native git or do I miss something ?

I think we should rather focus on improving submodules support instead.

If you need repo, this is available in jgit command line and we could consider to integrate it into EGit.

-------------------------------------
author: Genevieve Hudson
date: 2016-03-02 14:19:43.000000000

Patch Set 3:

It looks like the Hudson build trigger does not work and i didn't find any way to start it by myself...

-------------------------------------
author: Genevieve Hudson
date: 2016-03-02 14:37:24.000000000

Patch Set 3:

(In reply to comment #23)
> It looks like this adds another feature similar to but different from submodules
> which will _only_ work in Eclipse and seems to increase complexity. There is
> probably no way to use this from JGit or native git or do I miss something ?
The links are only related to Eclipse it self and we use them only for Eclipse. So this is not related to JGit or native Git and cannot be used there. This "feature" is used to have an EGit managed repo in project root to have EGit-Provider start looking at nested but linked repositories that are physically located in other locations. So, yes this is new for EGit, but already long there for Eclipse itself and is supported by other prlugins. As i said i can investigate the other solution with "real" nested but not linked repos or submodules now, because Thomas fixed it!

> I think we should rather focus on improving submodules support instead.
Yes, it's now more an more usable and i think nested repos (not submodules and not linked) should work too.

> If you need repo, this is available in jgit command line and we could consider
> to integrate it into EGit.
Thanks, but our company has an own tool and developers like me have to use them first :( but i want to investigate submodules in future.

-------------------------------------
author: Genevieve Hudson
date: 2016-03-04 13:57:50.000000000

Patch Set 3:

I've now reverted all patches for "linked" repo support and want to test nested and submodules first. After this is done and is stable i will try to support "linked" repos in other change. We will anyway use "linked" fixes locally and hopefully find all issues.

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-03-21 19:18:36.000000000

Change has been successfully merged into the git repository by Alayna Houston

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