Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

During uploadOnSave, files in "ignored" directories are still uploaded #15

Closed
6 tasks
duanehutchins opened this issue Jul 21, 2017 · 15 comments
Closed
6 tasks

Comments

@duanehutchins
Copy link

Issue:

During uploadOnSave, files in "ignored" directories are still uploaded on save. In other words, the 'ignore' setting is not respected for directories during uploadOnSave.

Relevant Settings:

{
    ...
    "uploadOnSave": true,
    "ignore": [
        "**/ignoreme"
    ]
}

Steps to duplicate:

  • Create new directory ignoreme/
  • Create a new file ignoreme/myfile.txt
  • Set uploadOnSave to true
  • Add **/ignoreme to the ignore list.
  • Change ignoreme/myfile.txt and save.
  • Note that ignoreme/myfile.txt is uploaded to the server, even though ignoreme/ is an ignored folder.

What should happen:

  • Files in "ignored" directories should not upload, even during uploadOnSave.

Please fix this. It is very annoying. It causes my local .git/ files to upload to the server.

@liximomo
Copy link
Owner

liximomo commented Jul 22, 2017

Please change you vscode setting option sftp.printDebugLog to true and provide me the full log(view -> output-> sftp).

@duanehutchins
Copy link
Author

I will get this for you on Monday.

@liximomo
Copy link
Owner

@tomjaimz Thanks for your help! I will take your advice.

@duanehutchins
Copy link
Author

duanehutchins commented Jul 24, 2017

Thanks @liximomo for looking at this, and thanks @tomjaimz for your help.

Here's the debug log output for sftp:

config at @workroot {
    "host": "web01",
    "port": 22,
    "username": "drh",
    "password": null,
    "protocol": "sftp",
    "agent": null,
    "privateKeyPath": "C:\\Users\\drh\\.ssh\\privatekey.ppk",
    "passphrase": null,
    "passive": false,
    "interactiveAuth": false,
    "remotePath": "./public_html/myinventory",
    "uploadOnSave": true,
    "syncMode": "update",
    "watcher": {
        "files": false,
        "autoUpload": false,
        "autoDelete": false
    },
    "ignore": [
        "c:/Users/drh/WebDocs/myinventory/**/.vscode",
        "c:/Users/drh/WebDocs/myinventory/**/.git",
        "c:/Users/drh/WebDocs/myinventory/**/.DS_Store",
        "c:/Users/drh/WebDocs/myinventory/.htaccess",
        "c:/Users/drh/WebDocs/myinventory/index.cgi",
        "c:/Users/drh/WebDocs/myinventory/invoice_pdfs",
        "c:/Users/drh/WebDocs/myinventory/jobpdfs",
        "c:/Users/drh/WebDocs/myinventory/pdfs",
        "c:/Users/drh/WebDocs/myinventory/materialimages/proofs",
        "public_html/myinventory/**/.vscode",
        "public_html/myinventory/**/.git",
        "public_html/myinventory/**/.DS_Store",
        "public_html/myinventory/.htaccess",
        "public_html/myinventory/index.cgi",
        "public_html/myinventory/invoice_pdfs",
        "public_html/myinventory/jobpdfs",
        "public_html/myinventory/pdfs",
        "public_html/myinventory/materialimages/proofs"
    ],
    "configRoot": "c:/Users/drh/WebDocs/myinventory"
}

Using the ignore pattern of **/.git/** works, but then causes another issue. When I ignore that pattern and keep uploadOnSave true, then I get a message in vscode on the bottom-left stating: retriving directory .git

image

This message doesn't go away. Well, sometimes it goes away, but then it comes back, and my memory and CPU usage for vscode goes up a bit.

@duanehutchins
Copy link
Author

Update: The issue with setting ignore **/.git/** may actually be causing a memory leak.

By using that setting and simply leaving my vscode open, unused, vscode memory usage climbs steadily at a rate of about 10kb per minute. This does not happen without that setting.

@liximomo
Copy link
Owner

liximomo commented Jul 25, 2017

**/.git/** means every file under .git but not include .git itself, which cause necessary retrieval of .git folder. I will fix the counter-intuitive behavior.

@BMannell
Copy link

I am not seeing any memory leakage using **/.git/**. I will keep an eye on it though.

@jessemao
Copy link

jessemao commented Sep 8, 2017

I am trying to ignore node_modules and tried **/node_modules/**, /node_modules, /node_modules/**, none of them works, need help!

@liximomo
Copy link
Owner

liximomo commented Sep 8, 2017

@jessemao Get me the logs.
Set option sftp.printDebugLog to true, then reload vscode, reproduce the problem, get the logs(view -> output-> sftp)

@liximomo
Copy link
Owner

liximomo commented Jan 26, 2018

I close this because how the ignore works changed after v1.0.0.

@tomazcp
Copy link

tomazcp commented Feb 23, 2018

Hey liximomo. I'm having the exact same issue, I can't get the package to ignore anything other than the .vscode folder where the config is in. I think it was working properly some time ago. I've been testing some variations of the config, none works. I've tried multiple patterns for the ignore array but nothing seems to work.

Anyway here's my output:

[info]: config at /Users/** {
    "protocol": "sftp",
    "host": "foo.bar",
    "port": 22,
    "username": "username",
    "password": "***********",
    "agent": null,
    "privateKeyPath": null,
    "passphrase": null,
    "interactiveAuth": false,
    "secure": false,
    "secureOptions": null,
    "passive": false,
    "remotePath": "/foo.bar",
    "uploadOnSave": true,
    "syncMode": "update",
    "ignore": [
        "**/.vscode/**",
        "**/.DS_Store/**",
        "project_details.txt",
        ".eslintrc.json",
        "**/node_modules/**",
        "**/.git/**"
    ],
    "watcher": {
        "files": false,
        "autoUpload": false,
        "autoDelete": false
    },
    "concurrency": 512,
    "context": "/Users/**"
}

Thanks in advance.

@liximomo
Copy link
Owner

Change to this and provide me the log if it still can't work.

"ignore": [
        ".vscode",
        ".DS_Store",
        "project_details.txt",
        ".eslintrc.json",
        "node_modules",
        ".git"
]

@tomazcp
Copy link

tomazcp commented Feb 24, 2018

Working now thanks a lot.

@joerimarquerinck
Copy link

Hi,

This issue is the one I am having where I have a local folder structure that is having the folders /assets/styles/ and then several .scss files (also within folder like /pages/, /components/. I would like to ignore this entire /assets/styles/ folder or every .scss file. I have tried several things but nothing is ignoring these files.

What's the correct way of ignoring files within subfolders or entire subfolders?

@EFXPROMedia
Copy link

This is not working for subdirectories /folder/subfolders/

Repository owner locked as resolved and limited conversation to collaborators Dec 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants