php-perfect / ddev-intellij-plugin

DDEV Tool Integration for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/18813-ddev-integration
BSD 3-Clause "New" or "Revised" License
109 stars 15 forks source link

Plugin generates untracked files #361

Open mikesnoeren opened 2 months ago

mikesnoeren commented 2 months ago

Is there an existing issue for this?

Are you sure that this bug is related to this DDEV Integration Plugin?

Enter your error report ID (If available)

No response

Describe the bug

When opening a DDEV project in PhpStorm for the first time, the plugin generates several files within the ./.ddev/ folder. Initially, no .gitignore file is present in this directory, which results in these generated files being tracked by Git. Once the project is started, a .gitignore file is created by DDEV, and files are properly ignored.

However, our workflow involves occasionally pulling in projects to review code without starting them. This process generates files that remain as uncommitted changes, cluttering the working directory.

To address this issue, we need a solution to prevent these files from being tracked until a .gitignore is generated by ddev, would that be possible?

Steps to reproduce

  1. Open ddev project that has never been started, with ddev-intellij-plugin installed.
  2. Check .ddev folder for uncommited changes.

Additional context

No response

rfay commented 2 months ago

Previous link is malware post, please delete

AkibaAT commented 2 months ago

It looks like ddev start is one of the few commands that creates the .gitignore. The majority of commands - such as ddev --version that is being called on project opening - create files in the .ddev directory, but without a .gitignore. So that seems like an issue in DDEV itself to me.

Looking at the DDEV code itself, PopulateExamplesCommandsHomeadditions is being run on init, which copies dotddev_assets to .ddev, as soon as you're within a project directory, no matter which command is called. While that in itself is an unexpected program behaviour to me, it wouldn't really be an issue if that assets skeleton also included a default .gitignore file.

stasadev commented 2 months ago

@mikesnoeren and @AkibaAT,

Please test:

AkibaAT commented 2 months ago

@mikesnoeren and @AkibaAT,

Please test:

Thanks. Looks good to me, git status is staying clean with that version.

mikesnoeren commented 2 months ago

All good here too!

rfay commented 2 months ago

To recreate the problem with current DDEV:

mkdir ~/junk && cd ~/junk
ddev config --auto
git add .
git commit -m "my project"
rm -r .ddev
git reset --hard
ddev --version
git status