Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Is a relative path to git repository possible?
Is a relative path to git repository possible? [message #871513] Mon, 14 May 2012 10:01 Go to next message
Matthew Webber is currently offline Matthew WebberFriend
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 08:29 Go to previous messageGo to next message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
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 10:10 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
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 16:44 Go to previous messageGo to next message
Hunter Morgan is currently offline Hunter MorganFriend
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 17:58 Go to previous messageGo to next message
Hunter Morgan is currently offline Hunter MorganFriend
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 14:14 Go to previous message
Stefan Lay is currently offline Stefan LayFriend
Messages: 342
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 Mar 19 09:25:56 GMT 2024

Powered by FUDForum. Page generated in 0.02497 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top