Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] Selected files are not add to commit

2011/7/3 Erwin Mueller <erwin.mueller@xxxxxxxxxxx>

Hello,


I have two similar projects in Eclipse, both are using Git. With the one project I can select files in the package explorer, go to commit and the selected files are checked in the commit window. In the second project if I select any file, the file is not checked in the commit window. No files are checked at all.


Both projects are maven projects, with one parent project and inside one child project. The file structure looks like this:


parent-project

* .git

*-> child-project


Why is that, that with the first project I can select the files to commit in the package explorer window, but not with the first?


I have attached two screenshots of the dialog for the two project how the git repository is configured. egit_a.png is the working project, egit_b.png is the project where it's not working. You can see that with project a) I have different choises then with project b).


I don't know why there is a difference, I like to select the files to commit in the package explorer window.


this is probably caused by importing nested projects which isn't really well 
supported in Eclipse [1]. Ugly things happen then like duplicate resource 
entries in the Eclipse resource model. EGit doesn't try to workaround these 
problems. Try not importing the parent project, then these problems will
probably go away. EGit has limited support for non-workspace resources, 
so if you keep your parent pom in the root of the repository without importing 
the associated parent Eclipse project you will be able to commit changes 
to the parent pom but all Eclipse views will not show the parent pom as it's 
not mapped to an Eclipse project.

To fix this you may consider to put the maven parent project into an Eclipse 
project which is on the same level as the other projects, this way you avoid 
nesting Eclipse projects.

The maven modules then need to specify the relative path to their parent pom:
<parent>
   <artifactId>org.example.helloworld.hello</artifactId>
   <groupId>org.example.helloworld</groupId>
   <version>0.1.1-SNAPSHOT</version>
    <relativePath>../org.example.helloworld.parent</relativePath>
</parent>

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=35973

--
Matthias

Back to the top