1

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?

  • 1
    Does your config file format support splitting out your personal paths, etc. into a different file from the "global" stuff, then having one of them include the other? Then you could check your personal one into a local Mercurial or git repo, or possibly into a different part of the same svn repo, checked out as an external (seem to remember svn doesn't commit changes to externals unless you commit from within them). – anton.burger Oct 08 '10 at 16:47
  • Well, that's why I tagged it "eclipse" as well. I am not aware of such feature, but may be other can suggest something. –  Oct 09 '10 at 16:52

3 Answers3

1

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.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 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. –  Oct 09 '10 at 16:50
  • @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 Oct 09 '10 at 18:15
0

git supports this with

git update-index --assume-unchanged <file>

and the complementary

git update-index --no-assume-unchanged <file>

See http://blog.pagebakers.nl/2009/01/29/git-ignoring-changes-in-tracked-files and http://kernel.org/pub/software/scm/git/docs/git-update-index.html#_options for more details.

Max Nanasy
  • 5,871
  • 7
  • 33
  • 38
0

.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
  • 6,652
  • 7
  • 36
  • 42
  • 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. –  Oct 08 '10 at 13:32
  • 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 Oct 08 '10 at 14:02
  • 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? –  Oct 10 '10 at 01:21