microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.99k stars 29.19k forks source link

Source Control / File Watcher does not respect settings #225231

Open thesefer opened 2 months ago

thesefer commented 2 months ago

Does this issue occur when all extensions are disabled?: Yes/No

I am trying to limit Source Control and the file watcher to my home only in a shared workspace. At least Source Control is scanning across the whole /home/ directory.

Steps to Reproduce:

settings.json

  1. files.watcherInclude:
       "files.watcherInclude": [
        "/data/home/myuser/git/automation",
        "/data/home/myuser/git/deployment",
        "/data/home/myuser/git/services",
        "/data/home/myuser/git/Terraform",
        "/data/home/myuser/git/Other"
    ],
  2. trying to counter with files.watcherExclude:
    "files.watcherExclude": {
        "**": true,
        "**/**": true,
        "/data/home/myuser/git/_backup/**": true,
        "/data/home/myuser/git/team/ansible-team/**": true,
        "/data/home/myuser/git/team/ansible-team-roles/**": true,
        "/data/home/myuser/git/team/AnsibleCICD/**": true,
        "/data/home/myuser/git/external/**": true
    },
  3. tried adding resulting in Absolute paths not supported in "git.scanRepositories" setting.
     "git.scanRepositories": [
         "/data/home/myuser/git/automation",
         "/data/home/myuser/git/deployment",
         "/data/home/myuser/git/services",
         "/data/home/myuser/git/Terraform",
         "/data/home/myuser/git/munich"
     ],

home.code-workspace

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "terminal.integrated.cwd": "${env:HOME}",
        "ansible.python.interpreterPath": "/usr/bin/python3"
    }
}

How can I properly limit Source Control to only scan my specified directory/ies instead of everything visible in /data/home?

vs-code-engineering[bot] commented 2 months ago

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.92.1. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

gjsjohnmurray commented 2 months ago

Is your home.code-workspace file located in /data/home/myuser/? If yes, does it help to put this into the "settings" object of that file?

     "git.scanRepositories": [
         "git/automation",
         "git/deployment",
         "git/services",
         "git/Terraform",
         "git/munich"
     ],
thesefer commented 2 months ago

hi, I used information provided from a previous employee and provide home.code-workspace within /data/home so everyone sees the same within their workspace, can easily check / help other employees and has the same "default" settings.

This looked like good idea to provide "defaults" but via the personal settings you could extent.

In other words I need to limit the filewatcher / source control to only my specified directory/directories, no matter the size of the workspace.

EDIT: "git.scanRepositories is unsupported in .code-workspace EDIT2: Even if I place the .code-workspace within my home, the selected settings are not respected. Git repositories are scanned across the whole home* folder and I see repositories in Source Control which I do not wanna see or track. EDIT3: I adjusted git.scanRepositories to relative paths to the home /data/home and it still scans every other folder within the workspace root.

    "git.scanRepositories": [
        "my_user/git/automation",
        "my_user/git/deployment",
        "my_user/git/services",
        "my_user/git/Terraform",
        "my_user/git/munich"
    ],
thesefer commented 2 months ago

I forgot to mention this is used in a Remote SSH Setup in case it makes any difference.