views:

245

answers:

7

Almost any IDE creates lots of files that have nothing to do with the application being developed, they are generated and mantained by the IDE so he knows how to build the application, where the version control repository is and so on.

Should those files be kept under version control along with the files that really have something to do with the aplication (source code, application's configuration files, ...)?

The things is: on some IDEs if you create a new project and then import it into the version-control repository using the version-control client/commands embedded in the IDE, then all those files are sent to the respitory. And I'm not sure that's right: what is two different developers working on the same project want to use two different IDEs?


I want to keep this question agnostic avoiding references to any particular IDE, programming language or version control system. So this question is not exactly the same as these:

A: 

Anything that would be devastating if it were lost, should be in SVN.

Kyle Rozendo
"...should be under version control" you say? :)
Toto
+3  A: 

This is where build automation and build files come in.

For example, you can still build the project (the two developers will need the same build software obviously) but they then could in turn use two different IDE's.

As for the 'junk' that gets generated, I tend to ignore most if it. I know this is meant to be language agnostic but consider Visual Studio. It generates user files (user settings etc..) this should not be under source control.

On the other hand, project files (used by the build process) most certainly should. I should add that if you are on a team and have all agreed on an IDE, then checking in IDE specific files is fine providing they are global and not user specific and/or not needed.

Those other questions do a good job of explaining what should and shouldn't be checked into source control so I wont repeat them.

Finglas
+2  A: 

In my opinion it depends on the project and environment. In a company environment where everybody is using the same IDE it can make sense to add the IDE files to the repository. While this depends a bit on the IDE, as some include absolute paths to things.

For a project which is developed in different environments it doesn't make sense and will be pain in the long run as the project files aren't maintained by all developers and make it harder to find "relevant" things.

johannes
As you write, some IDE include absolute paths, so its a real headache to put those files in. plus - what's the benefit? If the 'junk files' get lost, you can re-generate them, and I don't remember a single time that I needed to revert back to a previous version of a project configuration.
Ofri Raviv
Depending on the language and IDE you'Re using these files include build isntructions, build configurations, .. which might be worth sharing among developers for using similar settings
johannes
+6  A: 

I think it's best to put anything under version control that helps developers to get started quickly, ignoring anything that may be auto-generated by an IDE or build tools (e.g. Maven's eclipse plugin generates .project and .classpath - no need to check these in). Especially avoid files that change often, that contain nothing but user preferences, or that conflict between IDEs (e.g. another IDE that uses .project just like eclipse does).

For eclipse users, I find it especially handy to add code style (.settings/org.eclipse.jdt.core.prefs - auto formatting on save turned on) to get consistently formatted code.

sfussenegger
+3  A: 

Everything that can be automatically generated from the source+configuration files should not be under the version control! It only causes problems and limitations (like the one you stated - using 2 different project files by different programmers).

Its true not only for IDE "junk files" but also for intermediate files (like .pyc in python, .o in c etc).

Ofri Raviv
+6  A: 

Rules of thumb:

  1. Include everything which has an influence on the build result (compiler options, file encodings, ASCII/binary settings, etc.)
  2. Include everything to make it possible to open the project from a clean checkout and being able to compile/run/test/debug/deploy it without any further manual intervention
  3. Don't include files which contain absolute paths
  4. Avoid including personal preferences (tab size, colors, window positions)

Follow the rules in this order.

Aaron Digulla
I'd add two rules "Avoid anything that may be generated from other included files" and "Avoid anything that changes frequently and automatically"
sfussenegger
Rules 1 and 2 are totally wrong. They apply to the distribution tarball, but NOT to the VCS.
William Pursell
I actually agree with 1 and 2 100%. It's very important to be able to get a copy of the source, type "ant run" or somesuch, and be up and going. I'll even include the source or binary of a library I depend on. I'm totally happy with this approach; it's far better than requiring all developers to go download and install something every time there's a new dependency.
Russell Mull
A: 

In my opinion, anything needed to build the project (code, make files, media, databases with required program info, etc) should be in repositories. I realise that especially for media/database files this is contriversial, but to me if you can't branch and then hit build the source control's not doing it's job. This goes double for distributed systems with cheap branch creation/merging.

Anything else? Store it somewhere different. Developers should choose their own working environment as much as possible.

mavnn