Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359050

Summary: Wrong .gitignore in all repos
Product: [Eclipse Project] JDT Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Dani Megert <daniel_megert>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, john.arthorne, markus.kell.r, Michael_Rennie, Olivier_Thomann, pwebster, remy.suen
Version: 3.8   
Target Milestone: 3.8 M3   
Hardware: All   
OS: All   
Whiteboard:

Description Dani Megert CLA 2011-09-27 08:54:59 EDT
The current .gitignore file in all Git repositories is incorrect. It causes nested folders / Java packages to be ignored if they have a 'bin' or 'target' segment.

The following change must be made for all top-level .gitignore files:

bin/ ==> /*/bin/
target/ ==> /*/target/

BTW: I cannot see the reason to ignore 'target'. We didn't do this in the CVS world either. I would remove this unless there are good reasons.
Comment 1 Remy Suen CLA 2011-09-27 08:57:34 EDT
(In reply to comment #0)
> target/ ==> /*/target/
> 
> BTW: I cannot see the reason to ignore 'target'. We didn't do this in the CVS
> world either. I would remove this unless there are good reasons.

I believe target/ is the default output folder of Maven.
Comment 2 Dani Megert CLA 2011-09-27 08:59:03 EDT
(In reply to comment #1)
> (In reply to comment #0)
> > target/ ==> /*/target/
> > 
> > BTW: I cannot see the reason to ignore 'target'. We didn't do this in the CVS
> > world either. I would remove this unless there are good reasons.
> 
> I believe target/ is the default output folder of Maven.

If we don't use Maven then we should not blindly add that folder.
Comment 3 John Arthorne CLA 2011-09-27 10:11:51 EDT
I think individual teams should just make this change if they need it, rather than have Releng do it. Many of the platform git repositories have added further organization to their repository, like this:

/
  .gitignore
  bundles/
  tests/
  examples/

So the exact pattern would be different in each case. Also we don't usually ask releng to commit changes in our source repositories - the only way to fix this is to commit and push the file change in each component team repo.
Comment 4 Dani Megert CLA 2011-09-27 10:21:05 EDT
(In reply to comment #3)
> I think individual teams should just make this change if they need it, rather
> than have Releng do it. Many of the platform git repositories have added
> further organization to their repository, like this:
> 
> /
>   .gitignore
>   bundles/
>   tests/
>   examples/
> 
> So the exact pattern would be different in each case. Also we don't usually ask
> releng to commit changes in our source repositories - the only way to fix this
> is to commit and push the file change in each component team repo.

I guess one can't do that via EGit?
Comment 5 Remy Suen CLA 2011-09-27 10:26:04 EDT
(In reply to comment #4)
> I guess one can't do that via EGit?

If you edit these files in the repository but aren't in a project registered with the Eclipse workspace, it should still show up in the 'Git Staging' view. You should be able to stage and commit from there if desired.
Comment 6 Dani Megert CLA 2011-09-27 10:54:25 EDT
OK, we will fix our repos ourselves but others can also run into this and waste lots of time debugging it. Like PDE last week.
Comment 7 Olivier Thomann CLA 2011-09-27 12:24:56 EDT
I applied the change on the .gitignore file in the master branch of the jdt.core repo. I'll apply it to the maintenance branch 3.7 maintenance as well.
Comment 8 Markus Keller CLA 2011-09-27 14:07:38 EDT
> I'll apply it to the maintenance branch 3.7 maintenance as well

Good point. Does anybody know how to commit the new .gitignore to *all* branches at once?
Comment 9 BJ Hargrave CLA 2011-09-28 11:23:22 EDT
(In reply to comment #8)
> Good point. Does anybody know how to commit the new .gitignore to *all*
> branches at once?

You can't. But you can cherry-pick the first commit onto each of the other branches. Once you are done, you can push all the branches at the same time.
Comment 10 Dani Megert CLA 2011-09-28 11:41:23 EDT
(In reply to comment #9)
> (In reply to comment #8)
> > Good point. Does anybody know how to commit the new .gitignore to *all*
> > branches at once?
> 
> You can't. But you can cherry-pick the first commit onto each of the other
> branches. Once you are done, you can push all the branches at the same time.

Yep. That's what I did now.

Fixed for all repos where I have commit rights in
master
R3_7_maintenance
R3_development (platform.ui only)
R4_development (platform.ui only)