Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Is a relative path to git repository possible?
Is a relative path to git repository possible? [message #871513] Mon, 14 May 2012 06:01 Go to next message
Matthew Webber is currently offline Matthew Webber
Messages: 198
Registered: December 2010
Senior Member
Currently we clone our git repositories outside the workspace (as recommended), to a special location ${workspace.root}_git. So we have:

/parent
  /workspace
    . metadata
    features/
       feature_project_that_came_from_subversion/
    plugins/
       plugin_project_that_came_from_subversion/
  /workspace_git
    repo1/
       .git
       project11/
       project12/
    repo2/
       .git
       project21/
       project22/

This is very useful, since scripts know the relative path from the workspace to the git checkout parent.

However, it all breaks if I change the absolute location, for example by "mv parent parent_old". When I start Eclipse pointing to "parent_old", all the projects in the workspace open correctly, but all the projects that were imported from git cannot be opened, since EGit seems to retain the absolute path to the repository.

Is there any way for EGit to use a path relative to the workspace root?

Thanks


Re: Is a relative path to git repository possible? [message #872981 is a reply to message #871513] Thu, 17 May 2012 04:29 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin Rosenberg
Messages: 317
Registered: July 2009
Senior Member
Matthew Webber skrev 2012-05-14 12.01:
> Currently we clone our git repositories outside the workspace (as recommended), to a special location ${workspace.root}_git. So we have:
>
> /parent
> /workspace
> . metadata
> features/
> feature_project_that_came_from_subversion/
> plugins/
> plugin_project_that_came_from_subversion/
> /workspace_git
> repo1/
> .git
> project11/
> project12/
> repo2/
> .git
> project21/
> project22/
> This is very useful, since scripts know the relative path from the workspace to the git checkout parent.
>
> However, it all breaks if I change the absolute location, for example by "mv parent parent_old". When I start Eclipse pointing to "parent_old", all the projects in the
> workspace open correctly, but all the projects that were imported from git cannot be opened, since EGit seems to retain the absolute path to the repository.
>
> Is there any way for EGit to use a path relative to the workspace root?

Not at the moment. I suggest you disconnect and reconnect.
I thought moving a workspace was not possible. Maybe it was, but now is.

-- robin
Re: Is a relative path to git repository possible? [message #874649 is a reply to message #872981] Mon, 21 May 2012 06:10 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew Webber
Messages: 198
Registered: December 2010
Senior Member
>> I thought moving a workspace was not possible.
You can move the workspace, but it looks like EGit projects use an absolute path.
Re: Is a relative path to git repository possible? [message #1031375 is a reply to message #871513] Mon, 01 April 2013 12:44 Go to previous messageGo to next message
Hunter Morgan is currently offline Hunter Morgan
Messages: 2
Registered: April 2013
Junior Member
So, interesting story. If you add a relative path for a git repo to eclipse/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.egit.core.prefs (msys/cygwin path, so /'s) such as .\\git\\asdf2\\.git; (windows path, so \'s), you're in business. You just can't add or create through the gui. I'm not sure if there is any other manipulation or operation through the gui that deals with this seemingly-bogus absolute path check that may break by using this.

so the org.eclipse.egit.core.prefs file looks like this:
GitRepositoriesView.GitDirectories=C\:\\Users\\7student\\Desktop\\git test yard\\repo1\\.git;C\:\\Users\\7student\\Desktop\\git test yard\\asdf\\.git;.\\git\\as
df2\\.git;
RepositorySearchDialogSearchPath=C\:\\Users\\7student\\Desktop\\git test yard
eclipse.preferences.version=1
Re: Is a relative path to git repository possible? [message #1031408 is a reply to message #874649] Mon, 01 April 2013 13:58 Go to previous messageGo to next message
Hunter Morgan is currently offline Hunter Morgan
Messages: 2
Registered: April 2013
Junior Member
Ok, so Eclipse throws a fit when you try and share projects into a git repo with relative paths. So right now, being able to work on relative path defined git repo's works in EGit(it looks like) but working on projects in them is broken.
Re: Is a relative path to git repository possible? [message #1032854 is a reply to message #1031408] Wed, 03 April 2013 10:14 Go to previous message
Stefan Lay is currently offline Stefan Lay
Messages: 340
Registered: July 2009
Senior Member
There are open bugs for this: https://bugs.eclipse.org/bugs/show_bug.cgi?id=359744 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=358285
Previous Topic:Does Egit Support Mylyn Commit Changesets?
Next Topic:How do I squash commits?
Goto Forum:
  


Current Time: Tue Jul 29 13:11:31 EDT 2014

Powered by FUDForum. Page generated in 0.02267 seconds