smarthomeNG / smarthome

Device integration platform for your smart home
https://www.smarthomeNG.de
GNU General Public License v3.0
122 stars 91 forks source link

shng: modify gitignore for --cfg-etc switch #655

Closed Morg42 closed 4 months ago

Morg42 commented 5 months ago

Adding the --cfg-etc switch to shng enabled keeping the whole configuration below ./etc, which was well-received by at least some users.

Organizing your config in /etc with git leads to clashes between the . and ./etc repositories, as both try to interpret etc/.gitignore, leading to git not accepting changes in/below ./etc.

Moving all shng .gitignore-directives from ./etc, ./logics, ./functions, ./scenes, ./structs to the root .gitignore and modifying the entries accordingly smoothes things over. Instead of ignoring everything below ./etc (or the other dirs), the whole etc-dir is ignored.

For ./etc, the default configs are un-ignored as in the original config.

This works well and after intensive testing without interference with the etc-git-repo.

One point to consider is: ignoring the whole directory (for logics and functions) also ignores the example logics and the logics/uf template.

In my opinion, the examples are negligible; maybe not so the templates. BUT - as the whole directory is ignored (and deleting it also is ignored), unignoring logics/logic.tpl recreates the original problem.

I have no singular solution; one way would be to simply ignore the templates, another would move the templates to another directory, possibly below dev (as the sample plugins) or doc, or even a new directory "templates" or something. Possibly, both ways could be employed in parallel: the five config dirs are "shipped" by default and contain all example, default and template files like now; removing any of these directories or files is ignored but the relevant files are present a second time at another location...?

As this is not strictly a non-breaking change, I would like to discuss this before merging.