Perforce plugin adding project files without user action
Hey guys,
Some users have started seeing an issue where IJ will add IJ-project files to Perforce without user action. These are .iml files and other files in .idea project directory. This started happening some time during 2019 release, I believe it was closer to .2 if I recall correctly. I originally though users clicked the add unversioned files to VCS action (which for our project would be great if we could disable this as its a great way to add tens of thousands of files to a users workspace); however even when users dismiss that action, the files are still being added.
Ive tried to do some debugging but I have been only able to reproduce this a few times and am unable to pinpoint a reproducible set of steps. The closest I have found is this happens only on the first time the project is loaded. Anyway I'm hoping someone may be able to point out what may be happening and if there is anything we can do to prevent this from happening, thoughts?
Thanks in advance!
Please sign in to leave a comment.
Hello Brianmay27
When you first time open the project you are prompted with a message in right bottom corner "Project files can be added to Perforce" - could you please clarify what option do you choose there?
Hey Ruslan Kuleshov
That was my original theory as well, but for my testing, I did press to disable the notification. For others, I have confirmed that 'ASKED_ADD_EXTERNAL_FILES' was set to true in workspace.xml as well as MARK_IGNORED_AS_EXCLUDED was NOT set (default to false)
Check the SHARE_PROJECT_CONFIGURATION_FILES flag in worksapce.xml.
Project files are not external, they are created by the IDE, so the external files notification do not affect them.
Thanks Dmitriy,
That looks really promising. It does seem to be set on the host I was able to reproduce this with, but I don't remember ever seeing a project configuration notification where I would have enabled this. Ill keep trying to figure out how this is set, but is there any way I can disable this at a project level? We share some files via VCS, but most files are generated.
This is set via a separate notification about sharing project files which appear when a project is first opened - the one Ruslan mentioned. It could be confused with External files notification though, as they look rather similar.
Also, it could have been set automatically if project files have been already committed to the repo when the settings appeared in 2019.2
> there any way I can disable this at a project level?
Set the flag value to False.
Or you can remove the flag, and the notification should appear the next time a new project file that could be shared appears, and you can select to never share project files.
There is no UI to control it at the moment.
That would explain it, like I mentioned, we do have most of the project configuration checked into VCS under .idea/ but the modules.xml and all imls are generated on the client.
For our project we need a way to be able to disable this feature. I have gone ahead and created a feature request: https://youtrack.jetbrains.com/issue/IDEA-238476 , this is something that has been nagging our users for a few months, so if it would help sped things up, Id happily take a stab at a PR.
Anyway thanks for your help Dmitriy!