christiansandberg / canopen

CANopen for Python
http://canopen.readthedocs.io/
MIT License
446 stars 196 forks source link

Git: correctly ignore docs build directory #499

Closed erlend-aasland closed 4 months ago

erlend-aasland commented 4 months ago

FTR; here's the current variant of the gitignore template that this project's .gitignore was based on:

https://github.com/github/gitignore/blob/main/Python.gitignore

Perhaps it is time to sync with the modern variant.

acolomb commented 4 months ago

Wow, that template really has a lot of stuff listed. I hope I'm not alone with my opinion though - what's ignored in a project's Git configuration should be based on objective decisions relevant to the code-base. Thus I don't want any IDE state crap (e.g. .vscode) there, nor temporary files used by random tools (*.swp) or operating systems (.DS_Store). In my view, all these are specific to the individual developer's environment and should therefore be added as "local" or "system-wide" ignores in Git (see GitHub's docs ).

The version-tracked ignore patterns should target files that are expected to be generated by the build process(es) and should be hidden to avoid accidently adding generated files to the versioning. Thus this (remaining) change is fine, as the docs will land at the specified location.

Putting a venv directory inside the source worktree is a concious choice by the developer, thus their individual responsibility. It can be ignored locally via .git/info/exclude.

Temporary files and system caches can be handled the same way, or even globally via ~/.config/git/ignore.

If anything, we should clean out the current .gitignore to get rid of all this template stuff that someone imagined could ever be there. For adding new stuff, my current policy is outlined above, and tries to avoid piling up stuff from random trending IDEs and such, because there will be no end to the proliferation.

erlend-aasland commented 4 months ago

If anything, we should clean out the current .gitignore to get rid of all this template stuff that someone imagined could ever be there.

Sure, go ahead :) I have no interest in following this up.