Bug 358285 - Support copy/move of workspace and/or local Git repository clone
Summary: Support copy/move of workspace and/or local Git repository clone
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.1   Edit
Hardware: All All
: P3 normal with 1 vote (vote)
Target Milestone: 4.3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 430510 (view as bug list)
Depends on: 359744
Blocks:
  Show dependency tree
 
Reported: 2011-09-20 14:24 EDT by Markus Keller CLA
Modified: 2016-03-15 10:59 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-09-20 14:24:29 EDT
1.1.0.201109151100

An Eclipse workspace should be movable to another directory (or another machine). Paths inside a workspace should be stored in a relative form, such that they don't break if the entire workspace is moved.

With Git repositories, this platform rule is violated, since
a) Git repositories always use an absolute path, even if they are stored inside a workspace, and
b) imported projects from a Git repository's working directory use an absolute path from the root of the file system to the project directory.

(a) is a problem that can be solved in the EGit implementation.
(b) is harder, since project locations can only be relative to a workspace path variable, and I don't see a pre-defined path variable for the workspace root directory. You may want to ask Platform/Resources for a default variable.


An alternative "solution" would be to give the user a way to migrate a repository along with all checked out projects to another instance of the same repository. That would still need some manual work from the user, but it would at least only require migration of repositories and not of individual projects.
Comment 1 Dani Megert CLA 2011-09-21 02:23:20 EDT
> (b) is harder, since project locations can only be relative to a workspace path
> variable, and I don't see a pre-defined path variable for the workspace root
> directory.
I'm not sure this is true, since it is possible to select the 'WORKSPACE_LOC' variable when creating a linked folder via UI - just not when creating a folder.
Comment 2 Dani Megert CLA 2011-09-27 12:31:30 EDT
> Paths inside a workspace should be stored in a relative form, such
> that they don't break if the entire workspace is moved.
There's another problem with the full path: if I export the preferences and then import them in a new workspace all the Git repositories are pointing to the other workspace.
Comment 3 Markus Keller CLA 2011-10-03 14:04:48 EDT
(In reply to comment #2)
> There's another problem with the full path: if I export the preferences and
> then import them in a new workspace all the Git repositories are pointing to
> the other workspace.

Yes, that's what I meant with comment 0 a).

Filed bug 359744 for out-of-the-box support for comment 0 b).
Comment 4 Kaj Kandler CLA 2011-12-05 12:08:02 EST
Help! Is there a workaround by editing the metadata of the git-repo or workspace?

In other words in which files are a) and b) stored?
Comment 5 Stefan Lay CLA 2013-04-03 10:34:12 EDT
a) is stored in .metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.egit.core.prefs. It is stored as an absolute path. (see RepositoryUtil.PREFS_DIRECTORIES)

b) is stored in .metadata\.plugins\org.eclipse.core.resources\.projects\demo.helloworld\org.eclipse.egit.core\GitProjectData.properties. As far as I can see it is stored relative to the repositoy location (see constructor of RepositoryMapping).

So I would say a) is the problem to be fixed.
Comment 6 Markus Keller CLA 2016-03-02 10:17:08 EST
*** Bug 430510 has been marked as a duplicate of this bug. ***
Comment 7 Eclipse Genie CLA 2016-03-03 18:39:31 EST
New Gerrit change created: https://git.eclipse.org/r/67783
Comment 8 Eclipse Genie CLA 2016-03-15 10:59:23 EDT
Gerrit change https://git.eclipse.org/r/67783 was merged to [master].
Commit: http://git.eclipse.org/c/egit/egit.git/commit/?id=71d222e1e23e1579ebde825fe84053fae2f8ea97
Comment 9 Matthias Sohn CLA 2016-03-15 10:59:45 EDT
submitted