Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Working with Egit and non-Eclipse projects
Working with Egit and non-Eclipse projects [message #897341] Mon, 23 July 2012 16:25 Go to next message
Jason Litton is currently offline Jason LittonFriend
Messages: 3
Registered: July 2012
Junior Member
I'd like to import a non-Eclipse project and work with it in Eclipse, but I keep getting blocked by Egit. I'm wondering if the following workflow is possible without leaving Eclipse and, if so, how.
1. Clone a git repo for a non-Eclipse project
2. Fetch a gerrit branch for the project above. The gerrit branch also lacks a .project file.
3. Merge the two branches and resolve conflicts.

I've tried several strategies:

A. Do step 1 above -> New project -> uncheck 'use default' -> point project to git location -> when project is added, share project to git repo. This hooks the project into the git repo well. I can branch from there, change code, commit and push. However, I cannot fecth and merge the gerrit branch if I do that.

B. Fetch each as a separate repo, then open different projects for each. This doesn't work because there doesn't seem to be a way to merge two projects.

C. Try to clone the original repo, make a branch and then merge without making a project. If the merge has conflicts, there's no way to create an Eclipse project and I have to go to a different editor to resolve conflicts.

So, is there a way accomplish this using ONLY Egit? I know I can do command line git and a different editor, but I'd like to be able to do it from within Eclipse.

Any pointers would be greatly appreciated. Thanks.
Re: Working with Egit and non-Eclipse projects [message #901336 is a reply to message #897341] Fri, 10 August 2012 21:40 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 612
Registered: July 2009
Senior Member
- what do you mean with "non-Eclipse project" ? Do you mean there is no .project in this repository ?
- what do you mean with "Gerrit branch" ? Is the repository hosted on a Gerrit server or not ?
- can you give a more explicit example ?
Re: Working with Egit and non-Eclipse projects [message #901337 is a reply to message #901336] Fri, 10 August 2012 21:52 Go to previous messageGo to next message
Jason Litton is currently offline Jason LittonFriend
Messages: 3
Registered: July 2012
Junior Member
1) Correct. The project itself was not created in Eclipse. Some people who work on the project use Eclipse, but some do not. The actual project is not required to use Eclipse, but I, as a developer, would like to use Eclipse for my editing and debugging.
2) There is a general public repository for the project and a separate gerrit server for commits. When a patch has been approved from gerrit, it goes to the general public repository. So when I say "Gerrit branch" I mean a branch of the project that is awaiting review on that gerrit server.
3) A good "for instance" would be Linux Kernel development. They use git and gerrit, but do not necessarily need to be developed in Eclipse. Some developers would edit through vim, some through notepad, some on Eclipse. I've also got developers working on the coreboot project, which has the same drawbacks. Eclipse is useful but not required to be a developer on these projects, so it cannot be guaranteed that every git or gerrit pull will contain .project data.
Re: Working with Egit and non-Eclipse projects [message #901404 is a reply to message #901337] Sat, 11 August 2012 20:54 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 612
Registered: July 2009
Senior Member
Try the following:
- add .project file(s) of the type required to work on your project.
- Ignore ".project" [1] to prevent that you unintentionally commit it. You probably don't want to share this ignore so define it in .git/info/exclude which isn't shared.
- add a remote "review" for the URL of your project on the Gerrit server
- add another remote "origin" for the public repository (not sure if this is needed since changes seem to all arrive from Gerrit)
- fetch changes in review you want to test from Gerrit using remote "review"
- push changes for review to remote "review" use "Gerrit Configuration..." in Repositories View to configure which branch's review queue you are shooting for. If you use EGit 2.1 (nightly build) there is also a "Push to Gerrit..." in Repositories View which allows to dynamically choose which branch's review queue you want to push to
- fetch updates from "origin" to see which changes arrived in the public repository

[1] http://www.kernel.org/pub/software/scm/git/docs/gitignore.html
Previous Topic:Flash builder and Egit
Next Topic:commit process hangs:()
Goto Forum:
  


Current Time: Tue Dec 23 01:48:42 GMT 2014

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

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