Home » Eclipse Projects » EGit / JGit » EGit and linked folders in eclipse
| |
Re: EGit and linked folders in eclipse [message #766032 is a reply to message #765915] |
Thu, 15 December 2011 05:27 |
|
Am 14.12.2011 23:13, schrieb R Shapiro:
> It's always a good idea to keep your working directory in a different location than your Eclipse workspace. The
> workspace and the working directory are two entirely different things.
Can you please share some arguments for this assertion?
IMHO the fact that Eclipse *can* link IProjects to external locations doesn't make this mechansim the only valid one.
Not even the preferred one for these reasons:
1) The linking mechansim is insufficient because it can't deal with relative paths. This seems to be fixed in e4:
https://bugs.eclipse.org/229633
2) All scripts (e.g., Ant) that don't run in OSGi headless mode have at least hard times to deal with linked resources.
3) The idea of swapping in and out arbitrary Java projects is fundamentally corrupted by the fact that a workspace can
have only one active target platform at a time.
4) Last not least the term "work" in both "workspace" and "working directory is an indication that they're meant to be
the same thing, *the* place to work with files.
> This is true regardless of what kind of source control you're using (git, hg, svn, cvs, whatever).
Whether we agree that it's (conceptually) true, or not, neither SVN nor CVS have problems storing their working trees
*within* the workspace. From my experience that's even the most common scenario with these kinds of cource control.
The fact that EGit seems to have trouble (is that true? why?) with this common and reasonable (see the 4 reasons above)
makes me think that this is a technical issue with EGit, rather than a conceptual one with the other tools.
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Re: EGit and linked folders in eclipse [message #766056 is a reply to message #766032] |
Thu, 15 December 2011 06:32 |
Jan Pohanka Messages: 29 Registered: June 2011 |
Junior Member |
|
|
Thank you for the reactions. Maybe I have not described my situation clearly.
I have the workspace directory e.g. ~/work_embedded. In the same directory there are project directories e.g. ~/work_embedded/linux-kernel and these directories have "linked folder" which points to a directory with sources (e.g. ~/src/kernel/linux-at91). That means, that the directory with sources, which contains also .git, does not contain .project file. I have found this approach in some "how to import kernel sources to eclipse" on the net, but maybe this idea is not suitable for the work with EGit.
As the eclipse can point to a .project outside of workspace directory, maybe it is better to do it in that way...
regards
Jan
[Updated on: Thu, 15 December 2011 06:57] Report message to a moderator
|
|
| |
Re: EGit and linked folders in eclipse [message #767766 is a reply to message #767648] |
Sun, 18 December 2011 22:04 |
Robin Rosenberg Messages: 332 Registered: July 2009 |
Senior Member |
|
|
hawleyw skrev 2011-12-18 16.30:
> I've been trying to understand the logic behind keeping git repos and / git working directories out of my eclipse workspace and I just don't get it.
> The one thing mentioned that makes sense to me is that having the repo in the workspace could slow eclipse down because of the size/number of files.
>
> So I looked into whether it's possible to have the .git repo not be within your working project, and it is:
> see progit.org blog posting 2010.4.11 on environment variables
> via environment variables (not granular enough for my purposes),
> or via the work-tree / git-dir config options. I've been trying to find documentation on setting this up but most of the info that I've found online is about trouble when
> these variables have been set by accident, not on intentionally using them.
>
> It seems to me that the Egit team could investigate this more carefully and set the default/ recommended wizard actions to put the git repo in ~/git/<projectName>/.git and
> leave the working directory under the workspace. I know that I've seen arguments for keeping all code out of the workspace, but I don't understand that either, so it might
> be nice if the Eclipse docs on workspaces vs projects was updated and also the Egit docs were updated to give more fleshed out explanations for why we shouldn't have code
> in our workspace directories.
>
> The pita for me was that I am working on a yii based web app and spent a bunch of time getting permissions set up properly for the app to run under eclipse, without being
> published to my main webserver and then I put it under git contol with egit, which moved it to ~/git/project/project so it won't run now until I fix up the permissions &
> vhosts again.
To begin with, I agree that having the code in the workspace is perfectly fine. Workspaces are an excellent way
of being able to work on multi-repo projects.
Second you do not have to move the projects out of the workspace. It is an option, though the default. Look at the
sharing dialog and examine the options there.
-- robin
|
|
|
Re: EGit and linked folders in eclipse [message #768683 is a reply to message #767766] |
Tue, 20 December 2011 15:52 |
hawleyw Messages: 5 Registered: December 2011 |
Junior Member |
|
|
Robin Rosenberg wrote on Sun, 18 December 2011 17:04hawleyw skrev 2011-12-18 16.30:
> So I looked into whether it's possible to have the .git repo not be within your working project, and it is:
> see progit.org blog posting 2010.4.11 on environment variables
> via environment variables (not granular enough for my purposes),
> or via the work-tree / git-dir config options.
---> I have, since writing this post used the command
git init --separate-git-dir=/mydir/git/demo .
to set up a git repo in the /mydir/git/demo/ location with the working dir in the location of the original source code. No trouble from the command line, but not possible from egit wizard
>
> It seems to me that the Egit team could investigate this more carefully and set the default/ recommended wizard actions to put the git repo in ~/git/<projectName>/.git and
> leave the working directory under the workspace. I know that I've seen arguments for keeping all code out of the workspace, but I don't understand that either, so it might
> be nice if the Eclipse docs on workspaces vs projects was updated and also the Egit docs were updated to give more fleshed out explanations for why we shouldn't have code
> in our workspace directories.
>
> The pita for me was that I am working on a yii based web app and spent a bunch of time getting permissions set up properly for the app to run under eclipse, without being
> published to my main webserver and then I put it under git contol with egit, which moved it to ~/git/project/project so it won't run now until I fix up the permissions &
> vhosts again.
To begin with, I agree that having the code in the workspace is perfectly fine. Workspaces are an excellent way
of being able to work on multi-repo projects.
Second you do not have to move the projects out of the workspace. It is an option, though the default. Look at the
sharing dialog and examine the options there.
-- robin
-----> Robin: I've looked at the egit sharing wizard again and again and again. I've tried using it on a new, previously unshared project. I can't get it to save the git repo in the parent dir. I select the create repository in parent folder project check box and then get a message saying Creation of repositories in the Eclipse workspace is not recommended and no option to move forward or finish the wizard, only options to cancel or go back.
I've also seen references to the Egit team having "fixed" the wizard so that the non-recommended behavior is no longer possible.
I have Egit 1.1.0.201109151100r from download.eclipse.org/egit/updates and the latest stable release of eclipse (3.7.1.r2)
I have just uninstalled Egit and reinstalled it and get the same results: although the option to create the repo in the workspace exists, when I select it I am unable to move forward in the wizard. I guess for now I'm going to use git from the command line to handle this project and try to figure out where to report this bug to the Egit project folks
|
|
| | | | |
Re: EGit and linked folders in eclipse [message #768968 is a reply to message #768863] |
Wed, 21 December 2011 06:51 |
Robin Rosenberg Messages: 332 Registered: July 2009 |
Senior Member |
|
|
R Shapiro skrev 2011-12-21 01.18:
> Robin wrote:
>
>
> Quote:
>> To begin with, I agree that having the code in the workspace is perfectly fine. Workspaces are an excellent way
>> of being able to work on multi-repo projects.
>
>
> Workspaces are indeed an excellent way to work with multi-repo projects, I do it frequently. But I don't keep the repos in the workspace directory, which is an entirely
> different question.
>
> Apparently there are unusual cases where they have to be in the workspace directory. I'm not sure I see why but let's take it as a given. In this odd case, nothing prevents
> you doing that as far as I know.
>
> For sure this is not the typical case. Over the past few years I've created several dozen workspaces with projects managed by several version control systems and never once
> has there been any reason at all to tie the location of the repo/checkout to the location of any workspace.
>
> Why would I want to mix them up in this way? Sometimes I work with my repositories in Eclipse, sometimes in a shell, sometimes in Emacs, sometimes in IDEA, sometimes in
> GitX etc etc. Any given Eclipse workspace has no special claim on any given repo. It's just one of a number of contexts in which I use it.
>
> Similarly sometimes I want a single project to be in more than one Eclipse workspace. What would I do then if the rule is to keep project's repository in the workspace
> directory? I'd have to pick one of them at random.
> Considering what an Eclipse workspace is for and what a Git repository is for it seems clear to me that it's best to avoid any confusion and preserve the distinction in the
> file system when possible. Certainly this should be the default.
I do use multiple tools, but it is *my* problem and recommendations to either way is
my choice and applies to *my* workflow. Recommendations either way has nothing to do
with EGit. It has to do with *your* workflow and only that. EGit should not care
which way *you* do it and be happy with whatever I do.
-- robin
|
|
| | | |
Goto Forum:
Current Time: Fri Apr 19 18:11:39 GMT 2024
Powered by FUDForum. Page generated in 0.05545 seconds
|