Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-user] Git and synchronized projects



On Fri, Jul 5, 2013 at 1:00 PM, Dr. David E Hudak <dhudak@xxxxxxx> wrote:
Hi Christoph,

I got it!

My main point of confusion was the preference among the Egit community to keep the git and workspace directories separate.  I assumed incorrectly that I would have my clean source code under ~/git and my eclipse project files (.project, .cproject, .settings) and builds under ~/workspace.  

I think this should work. I reopened https://bugs.eclipse.org/bugs/show_bug.cgi?id=371507.

Roland
 

That is not how it works.  Eclipse wants source code, git metadata, eclipse project files and build output all under the same directory tree.  The developer is expected to use the .gitignore file to ensure that project files and executables are not considered for source control.

So, its a 3-step process for me.  Step 1 - get a git repository.  Step 2 - create an eclipse project in that directory.  Step 3 - update the .gitignore to omit project files.  

Step 1:  Clone remote git repository (this is my "99% of the time" use case, and github should work this way too)
a.     go to “git repository exploring” perspective
b.     enter host:  oakley.osc.edu
c.      enter path:  ~dhudak/git/hpp_core.git
d.     hit Next
e.     hit Next
f.      hit Finish
g.     then, eclipse will clone the repository and create a local copy on my Mac (in my case, in ~dhudak/git/hpp_core)
 
Step 2:  Create synchronized project
a.     go to “C/C++” perspective
b.     right-click in Project Explorer, select Import
c.      Select dialog opens, choose Git->Projects from Git
d.     Select “Local”, click Next
e.     Select your local repository clone, click Next
f.      Select “Use the New Project Wizard”, click Finish
g.     Select Remote->Synchronized C/C++ Project
h.     New Synchronized Project dialog
a.     Name the project
b.     Local Directory
               i.     Unselect “Use Default Location”
               ii.     Click “Browse…” and find the directory of the local clone (under the ~/git directory)
c.      Remote Directory
               i.     Same as always
d.     Project Type and Remote Toolchain
               i.     Same as always
 
Step 3:  Filter out Eclipse project files from git by adding them to .gitignore
a.     I added the following:
               i.     /.cproject
               ii.     /.project
               iii.      /.settings
b.     Then, I committed my .gitignore

Note that for Step 1, you could have a locally created git repository, but it better not have existing Eclipse metadata (.project files) if you're initializing a project in there.

Thanks,
Dave
On Jul 5, 2013, at 7:19 AM, Christoph Pospiech <Christoph.Pospiech@xxxxxxxxxx>
 wrote:

On Tuesday, July 02, 2013 12:00:08 "Dr. David E Hudak" <dhudak@xxxxxxx> wrote:
> Hi All,
>
> Am I allowed to use git for source control with a synchronized project in
> PTP 7?  
>
> Here is what is happening:
>         1.  I created a synchronized project.  
>         2.  I copied in my files and got it to build. 
>         3.  I right-clicked on the project in the Project Explorer and did
> "Team"-> "Share Project"->"Git" and created a local repository.  
> 4.  I staged my new files and committed them.
>         5.  I began editing my source file.
>         6.  I try to save my source file and I get a "Save As" dialog box
> that says: "The original file "helloheat_omp.c" has been deleted or is not
> accessible.  
>
> Any insight appreciated!
>
> Thanks,
> Dave

 

Dave,

 

I tried to recreate what you did, and I can confirm that I have problems as well - albeit different problems.

 

Here is what I did:
       1.  I created a synchronized project, pointing it to a directory that
already contained the files (Makefile, hello_par.c).
As usual, I am keeping my sources (= git tree) *outside* of the
eclipse workspace. And this directory exists locally.
2.  I right-clicked on the project in the Project Explorer and did
"Team"-> "Share Project"->"Git" and created a local repository
( .git directory in the same directory as Makefile, hello_par.c)
3. I staged my new files and committed them.
4. There are two build configurations, one for Gnu+OpenMPI,
one for Intel compiler (remote).
5. When I tried to compile locally, Eclipse would try to "cd" to
the remote directory, which doesn't exist locally and flag
an error.
6. For remote compile I was missing "Environment management".
How should I tell Eclipse where to look for the Intel compiler ?
7. I closed Eclipse and used "git status" and "gitk --all" for
investigating, what Egit has been doing.
=> The (local) .git repository seems OK
8. The synchronization looked OK.

 

Re-reading both posts (the original from Dr. David E Hudak and mine), it appears that there is a confusion about local and remote configurations.
--

 

Mit freundlichen Grüßen / Kind regards

 

Dr. Christoph Pospiech
High Performance & Parallel Computing
-------------------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland GmbH / Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Martina Koederitz (Vorsitzende), Reinhard Reschke, Dieter Scholz, Gregor Pillen, Joachim Heel, Christian Noll
Sitz der Gesellschaft: Ehningen / Registergericht: Amtsgericht Stuttgart, HRB 14562 / WEEE-Reg.-Nr. DE 99369940

 

_______________________________________________
ptp-user mailing list
ptp-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-user

---
David E. Hudak, Ph.D.          dhudak@xxxxxxx
Senior Research Scientist
Ohio Supercomputer Center















--
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309

Back to the top