How to manage IDE files in a git repository?
Asked Answered
H

2

14

The application is developed using Sencha Architect, which uses a host of auxiliary files for managing various IDE-related things (export paths, versioning of the IDE etc.).

Some of these files will change every time a team member just opens a project in the Sencha Architect IDE.

To give an example of a particularly annoying change, consider the property exportPath in the Architect-generated *.xds files. I will have a server of choice which I publish to, to a specific path, and other team members will have different server/path configurations.

In our code-base, I would very much like to either have the IDE files:

  1. in a separate repository,
  2. in a sub-module (yes, git-specific, I know) or
  3. reside on the user machine, with the VCS oblivious to changes in them.

The key thing to note here is, that Sencha Architect expects the files to be in certain places relative to the projects, so the IDE files must be available at the same place as the normal source files.

Also, using .gitignore is not an option, since Sencha Architect will write information in some of them that are vital for other team-members opening them correctly. E.g. when opening a project, Sencha Architect could decide to upgrade the project to a newer version (its non-optional, if you want to open the project at all), and in the course of updating, the IDE will modify some of the source-code files. The other team members must be aware of the version upgrade in order to be able to open the project correctly.

This SO question gives some background to the convoluted format that Sencha uses. I pardon for the negative tone in my assessment of the architecture of Sencha Architect, but it seems that they took a good idea (using metadata and code generation) a bit too far (invalidating the use of all good unix tools, including git).

what would be the preferred approach here? And why?

Homeless answered 10/6, 2013 at 12:55 Comment(4)
It depends on how important for the project the files are. For example, in case of C# and ReSharper, .DotSettings files are put into VCS, while .user.DotSettings files are not. Just ask yourself a question: if the file is missing, is it possible to build the project? Will it build correctly?Jerryjerrybuild
@Athari: thanks for your comment, I have updated the question with more information related to thisHomeless
I'm afraid there's no simple solution if project-level and user-level options are mixed in one file. You can't commit only some parts of the file and leave other ignored, AFAIK. I'd submit a feature request to Sencha to separate options into different files. In the mean time, you can agree with other developers to commit IDE files only if there're substantial changes, and deal with merging options.Jerryjerrybuild
@ThorbjørnRavnAndersen: git submodules (or subtrees for that matter) seems like a viable solution, which is why I mentioned them in my question. But how? The administration of submodules coupled with the Sencha Architect requirement to have the IDE files lying with the source files seems to make this hard to do...Homeless
V
13

IDE files should not be versioned unless you have a pretty compelling reason. Perhaps your project only builds using a plugin in a particular IDE and you need to version those settings. If you don't need those files to build or run your project, you probably shouldn't version them.

You can ignore those files using Git. In particular, IDE files are good candidates for the global gitignore as each user will use whatever IDEs they want and those settings should be applied to all of their repositories.

Vixen answered 10/6, 2013 at 13:4 Comment(1)
I completely agree with you. This project however, already has all kinds of IDE-files under version control, the team-members rely on the files being in a VCS. Gitignoring them is not an option, since the Sencha Architect will write information in some of them that are vital for other team-members opening them correctly. I will add this to the question. Thanks.Homeless
G
3

It could be helpful to use versioning for the IDE files except files which store user specific settings. See also https://intellij-support.jetbrains.com/hc/en-us/articles/206544839-How-to-manage-projects-under-Version-Control-Systems.

Advantage of using version control for these files is

  • Sharing of code styles for the whole development team
  • Manage and share nested repositories that are under version control as well.
  • etc.
Goldshell answered 24/3, 2015 at 15:43 Comment(1)
Your link is broken, current working link is intellij-support.jetbrains.com/hc/en-us/articles/…Deliverance

© 2022 - 2024 — McMap. All rights reserved.