How do I stop Intellij from changing the .ipr file.

I have my project checked into source control (Subversion) with the source.  When we branch and switch to the branch, reopening the project file causes intellij to change the file.

If our project file contained this:


<component name="ProjectKey">
   <option name="state" value="svn://master/repo/projectx/trunk/IDE/allcode/allcode.ipr" />
</component>


And we switch to a branch the project file now contains.

<component name="ProjectKey">
    <option name="state" value="svn://master/repo/projectx/branches/foo/IDE/allcode/allcode.ipr" />
</component>

The same happens if we switch/relocate from the master server to a much faster local mirror server.

<component name="ProjectKey">
   <option name="state" value="svn://mirror/repo/projectx/trunk/IDE/allcode/allcode.ipr" />
</component>


The project file has been changed without developer intent.  This makes it all too easy to accidentally check the project file back in during a commit even though it should not have been changed.  This commit noise makes it difficult to see when real project changes have occurred and doesn't seem to do anything useful (EG we can munge that entry or point it to another branch we've never loaded and it makes no difference).

Can this either:

  1. Be turned off.
  2. Be externalised to another file that we can svn:ignore.

5 comments
Comment actions Permalink

Store your project as directory based format, wait until the IDEA build with
the bug fixes (e.g. IDEA-23478, IDEADEV-37856) is released, then just
add/commit those parts of your project configuration which is necessary to
share.

0
Comment actions Permalink

Unfortunately the dir-based format isn't any better.  It stores 'Project Key' in misc.xml which ends up being the Subversion URL - this changes depending upon the branch and which server you checked out from.  misc.xml contains project content so not checking that in isn't an option.

Additionally several folders in the .idea folder appear to be blown away and recreated by the IDE each time it loads the project.  This blows away the .svn folders which breaks the check-out.

All in all the file-based format is the disappointing lesser of the two evils.

0
Comment actions Permalink

JetBrains could provide guidance in the form of comments in the various configuration file on whether they should be checked in or not.


Also get JetBrains to reopen IDEADEV-38112.

The ProjectKey solution should never be an absolute path, I don't even think it should be a path but a random number.
In my opinion, see my comments in IDEADEV-38112., the Cache should include a path, and the project key.
If there is a mismatch then the cache should be regenerated, or a new cache for that directory recreated.

I am not happy at all that they close this issue.

If JetBrains provided some guidance on what exactly the ProjectKey is used for, I am just guessing what its used for,
maybe a user  could provide a simple solution like maybe the  project key is in a file by itself that is hidden, and thus less likely to be checked in.

-Rob

0
Comment actions Permalink

Additionally several folders in the .idea folder appear to be blown away and recreated by the IDE each time it loads the project.  This blows away the .svn folders which breaks the check-out.


Try #9920.

0
Comment actions Permalink

Hello Rob,

As described already, the ProjectKey is used for sharing the workspace file
via the IDEA Server plugin. If you disable the plugin, it will not be generated
at all.

JetBrains could provide guidance in the form of comments in the
various configuration file on whether they should be checked in or
not.

Also get JetBrains to reopen
http://www.jetbrains.net/jira/browse/IDEADEV-38112.

The ProjectKey solution should never be a absolute path, I don't even
think it should be a path but a random number.

In my opinion, see my comments in ../jira/browse/IDEADEV-38112., the
Cache should include a path if it is even needed and the project key
with a random number.

If there is a mismatch then the cache should be regenerated, or a new
cache for that directory recreated.

I am not happy at all that they close this issue.

If JetBrains provided some guidance on what exactly the ProjectKey is
used for, I am just guessing what its used for,

maybe a user  could provide a simple solution like maybe like a
project key is in a file by itself that is hidden, and thus less
likely to be checked in...

-Rob

---
Original message URL:
http://www.jetbrains.net/devnet/message/5244603#5244603

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.