Why is PHPStorm suggesting committing a file that contains my project path for my computer?

I just recently allowed it to add .idea folder project-specific files, which are supposed to be shared among PHPStorm users for the repo to minimize configuration (or easily fixing configuration that breaks when PHPStorm can't find the .idea folder like what happens with WSL2 randomly), but then I notice this one file that committed the specific OS pathname to my project... which makes no sense if other people are using different pathnames on their computers:

While I haven't tested this, I'm pretty sure if someone else's file has their own path, the file is gonna show up as a change in git... I don't really care to have specific computer project paths in the repo at all.

Am I misreading this? Is the path only set on project create? I'm a little confused on why something this specific is in a file suggested by PHPStorm to commit for all project users.

Comment actions Permalink

I just noticed this in the .idea/.gitignore file... an absolute path reference containing my computer's user folder and the project's parent folders:

It's totally unnecessary and contrary to the point of committing these files to include my specific user folder.

Also, the `dataSources` file and path can be specified completely relatively in that .gitignore file... just like the other files specified there. There's no reason to use the absolute path.

Bizarrely, the absolute path includes a bunch of 'up 1 directory' specifications: 


Why are you doing this, JetBrains?!

Just specify `/dataSources` and call it good... that should be fine, right?!

Now I'm hoping doing your suggested standard of committing .idea project files won't cause weird merge conflicts or even expose too much information on a public repo...

OS user paths should not be suggested for commit, period, especially when it appears to be 100% completely avoidable by JetBrains.

Comment actions Permalink

Do I get it right that you chose 'Always Add' in the popup?
The feature doesn't check whether or not there are absolute paths in the XML files it adds.
It knows certain files it should not add, like workspace.xml, but in general, it just adds stuff.
The .gitignore issue is just a bug that has to be fixed: https://youtrack.jetbrains.com/issue/IDEA-248816
As for the command-line tools, I've extracted it as this feature request: https://youtrack.jetbrains.com/issue/WI-59295

Comment actions Permalink

I don't remember what I clicked exactly, but I think I clicked View Files first, then after looking at the files, I clicked Add. I suppose I clicked Always Add at some point, but why does it matter whether I clicked "Add" or "Always Add"? 

> The feature doesn't check whether or not there are absolute paths in the XML files it adds.

So what? The issue isn't what it checks, the issue is that it's printing absolute paths in non-ignored project files. So... why does it matter what it doesn't check?

Thanks for the ticket link, that appears to be the issue.


Please sign in to leave a comment.