Skip to content

add BEGIN NOT-CLEAN-FILES marker to .gitignore.#10233

Closed
shkit wants to merge 2 commits intopytorch:masterfrom
shkit:add-not-clean-files-section
Closed

add BEGIN NOT-CLEAN-FILES marker to .gitignore.#10233
shkit wants to merge 2 commits intopytorch:masterfrom
shkit:add-not-clean-files-section

Conversation

@shkit
Copy link
Contributor

@shkit shkit commented Aug 4, 2018

Using Visual Studio Code and Visual Studio, these IDEs store configurations to FOLDER/.vscode and FOLDER/.vs.
But "setup.py clean" deletes these folders because those are described in .gitignore file.

To prevent this, add "BEGIN NOT-CLEAN-FILES" marker to .gitignore file and "setup.py clean" ignores lines after this marker.

Discussed in #10206

setup.py Outdated
os.remove(filename)
except OSError:
shutil.rmtree(filename, ignore_errors=True)
pat = re.compile('^#( BEGIN NOT-CLEAN-FILES )*')

This comment was marked as off-topic.

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks basically reasonable. Don't know if there are other bits which we should preserve (.idea maybe?)

@ezyang
Copy link
Contributor

ezyang commented Aug 4, 2018

@shkit How did you test?

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@shkit
Copy link
Contributor Author

shkit commented Aug 5, 2018

@ezyang I simply type python setup.py clean and checked exsitence of .vs and .vscode in my workspace.
I think adding other IDEs is better, but I don't know which filename is to be added. I wish others' contribution.

@shkit shkit deleted the add-not-clean-files-section branch August 9, 2018 09:59
goodlux pushed a commit to goodlux/pytorch that referenced this pull request Aug 15, 2018
Summary:
Using Visual Studio Code and Visual Studio, these IDEs store configurations to `FOLDER/.vscode` and `FOLDER/.vs`.
But "setup.py clean" deletes these folders because those are described in `.gitignore` file.

To prevent this, add "BEGIN NOT-CLEAN-FILES" marker to `.gitignore` file and "setup.py clean" ignores lines after this marker.

Discussed in pytorch#10206
Pull Request resolved: pytorch#10233

Differential Revision: D9175515

Pulled By: ezyang

fbshipit-source-id: 24074a7e6e505a3d51382dc5ade5c65c97deda37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants