Home » Eclipse Projects » EGit / JGit » Error when trying to use existing git repository
| | |
Re: Error when trying to use existing git repository [message #920257 is a reply to message #919566] |
Sat, 22 September 2012 22:40 |
James Rice Messages: 3 Registered: September 2012 |
Junior Member |
|
|
Thanks. I looked in the error log (didn't know there was one at the time I posted). It said that the "<my source dir> is not a valid location because the project contains a linked resource at that location". Which is true, because I have an "out of source" build as cmake recommends. My build looks like this.
topLevelDir/sourceDir/.git + source
topLevelDir/buildDir/.project + build stuff
So the I already have a project file, generated by cmake, and also already have a .git repository. I was just starting to use EGit and wanted to integrate with it.
If I use "Import existing projects", on my git repository, it complains because it can't find the .project file "No existing projects".
Must my .git directory be in the same place or above my .project file? This seems a little constraining, as keeping your build files out of source is fairly popular, and makes using .git easier, as I don't have to .gitignore everything.
[Updated on: Sat, 22 September 2012 22:41] Report message to a moderator
|
|
| |
Re: Error when trying to use existing git repository [message #920984 is a reply to message #920795] |
Sun, 23 September 2012 17:48 |
James Rice Messages: 3 Registered: September 2012 |
Junior Member |
|
|
You can do it like that, use of cmake encourages out-of-source builds. The build files don't clutter up the source tree, and you don't have to ignore it, since Git isn't even aware of it, or clean it up when you're done. Just another way of doing things. Also, we don't commit our .project files, they're generated, with our make files when we run cmake. The only thing we move into our CM repository is the source, cmake files and .gitignore(s). We have several collaborative projects, each cloned of a different repository. Each containing it's own .git directory. So, we wouldn't use the project level.
I guess I am coming from the opposite direction. Why does EGit care about the relative location of the repository and .project files? Since cmake is used quite a bit, integrates well with Eclipse, it would seem as though EGit should support this paradigm. But, there may be good reasons why not.
|
|
|
Re: Error when trying to use existing git repository [message #921109 is a reply to message #920984] |
Sun, 23 September 2012 21:00 |
R Shapiro Messages: 386 Registered: June 2011 |
Senior Member |
|
|
As far as I know the EGit auto-importer is looking at the Git repository's working directory for .project files. Where else could it look? As I recall the SVN and CVS auto-importers behave the same way. So the reason the EGit importer says "no existing projects" is because there aren't any that it can see -- you've explicitly put the .project file somewhere else.
Conversely, you can manually import the .project in topLevelDir/buildDir, but since buildDir is not under version control, again by your explicit design, it won't be treated as an EGit project.
In short the behavior you report is exactly what I would expect.
Fwiw I've configured Eclipse C++ projects as I described earlier and it works fine, including EGit linkage, and with no "clutter". But I was not using cmake.
ps:
I don't know how you're using Eclipse here, but if you're treating the sources as just a tree of files, with no Eclipse builders, you can define a trivial .project in topLevelDir/sourceDir to do that and then commit it. This will give all developers EGIt access to your source tree.
[Updated on: Sun, 23 September 2012 21:11] Report message to a moderator
|
|
|
Re: Error when trying to use existing git repository [message #922281 is a reply to message #921109] |
Mon, 24 September 2012 22:35 |
Robin Rosenberg Messages: 332 Registered: July 2009 |
Senior Member |
|
|
R Shapiro skrev 2012-09-23 23.00:
> As far as I know the EGit auto-importer is looking at the Git repository's working directory for .project files. Where else could it look? As I recall the SVN and CVS
> auto-importers behave the same way. So the reason the EGit importer says "no existing projects" is because there aren't any that it can see -- you've explicitly put the
> .project file somewhere else.
>
> Conversely, you can manually import the .project in topLevelDir/buildDir, but since buildDir is not under version control, again by your explicit design, it won't be
> treated as an EGit project.
>
> In short the behavior you report is exactly what I would expect.
>
> Fwiw I've configured Eclipse C++ projects as I described earlier and it works fine, including EGit linkage, and with no "clutter". But I was not using cmake.
There are some thoughts about connecting containers (directories) at any level, but it's nowhere consistently done. This is kind of exotic, but I see the point
and it should be possible, though I'm not any team provider does it. Now we just someone willing to invest in this.
-- robin
|
|
|
Goto Forum:
Current Time: Wed May 15 03:12:13 GMT 2024
Powered by FUDForum. Page generated in 0.03818 seconds
|