views:

34

answers:

2

I am using Eclipse and Subversion for Java development, and I find myself wishing for a feature in version control systems (one that is not available in SVN, to the best of my knowledge).

I would like my project settings files to be half-ignored. To be more precise, I want them to be available in VCS, I want merge to occur when someone checks in changes, but. I want my own changes ignored unless I very explicitly tell the system to take them.

This would allow me to have my local paths (and other settings) in my local configuration w/o screwing up other people's configuration. But, when I have a substantial change, I can still check it in (very very carefully, may be temporarily removing my other local changes) and have it delivered to other people.

Now, the actual question: is there any VCS that supports this feature? Or may be I am missing something in SVN? How do other people solve this problem in Eclipse?

A: 

.gitignore for git, .hgignore for mercurial and file paths and patterns can be added that will not be committed. There similar in SVN but i never worked out how to use it myself but my sysop did set it up form me.

PurplePilot
I am aware of .ignore files - they do too much for my purposes. I don't want the Eclipse project settings completely ignored - I just want the changes in them to be ignored when I commit - and even that only most of the time.
Arkadiy
Are you talking about Eclipse project setting files? Surely these are not part of the actual project but belong to the environment on the development machine? And as such should stay there?
PurplePilot
And how would a new person get a copy of those files? And how do I propagate changes when I need to add a new .jar?
Arkadiy
Have edited my answer with this info
PurplePilot
+1  A: 

Yes, Git support that feature through filter driver (a clean script can run upon commit, allowing you to clean the content from any of your changes if you want).

alt text

But another way would be to never version that setting file, and only version:

  • a template file
  • a value file
  • a script able to replace variables in the template files with the values from the value file, in order to generate the actual (and "private", as in "not versioned") setting file.

That way, you can modifying it at your heart's content without ever committing your changes.

VonC
Thanks for the Git feature - it requires some configuration, but it's clearly capable of doing what I need.I like the idea of checking in a "generator" that produces the configuration. How about "essential" changes - how to propagate those? A set of "update" scripts? It may become quite a chore.
Arkadiy
@Arkadiy: essential changes would be propagate in the versioned "value" file, while "private" changes would only be done in the final configuration file (which remains private).
VonC