Project metadata: differencing os-dependent from independent

Hello,

I'm using PyCharm for doing some cross platform development, and I often switch between Mac and Linux.

In this process, if often get diffs as the following one:

diff -r 80e44d0f7403 .idea/misc.xml

--- a/.idea/misc.xml    Fri Jan 21 00:15:46 2011 +0100

+++ b/.idea/misc.xml    Wed May 11 23:14:26 2011 +0200

@@ -6,6 +6,6 @@

   <component name="ProjectResources">

     <default-html-doctype>http://www.w3.org/1999/xhtml</default-html-doctype>

   </component>

-  <component name="ProjectRootManager" version="2" project-jdk-name="Python 2.6.6 (/usr/bin/python2.6)" project-jdk-type="Python SDK" />

+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 2.6.1 (/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python)" project-jdk-type="Python SDK" />

</project>

This generates a certain amount of "noise" in my commits, and I can't seem to ignore the file (IDEA keeps readding it to mercurial if I remove it).

I think that the project metadata should contain mostly os-independent configuration, and then another file, which does NOT get committed (and goes to .hgignore instead) holds a reference to the os-dependent files. e.g. something like

in misc.xml

<component name="ProjectRootManager" version="2" project-jdk-name="Python 2.6" project-jdk-type="Python SDK" />

while in something like private.xml which is ignored by source control:

<component type="project-jdk" name="Python 2.6" version="Python 2.6.1" location="/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python" />

This would read like "this project requires Python 2.6, which is provided by Python 2.6.1 at the location path on this platform".

Another OS would use the very same misc.xml but a different private.xml.

If the suggestion seems good I could open a ticket.

Please sign in to leave a comment.