Repository navigation
Add #include directive to .stignore (fixes #424) - #589
Conversation
|
Can I be a pain and add a test case? d840d28 An include loop breaks, but not a file that includes itself (for some reason I didn't immediately understand, it didn't look like this was handled?). Should we log at least an info level message for including a file that doesn't exist? Including a file in subdirectory has confusing effects, i.e. if I include |
|
Oh, 1961480 is nice too when running that failing test... :/ |
|
Yes, I was thinking that I should write some tests, looked at Circular includes are not handled, that is correct, though I don't think it will be such a common error case. The fact that ignores are applied at the level the file is somehow made sense to me, as feel that Also But if we do drop .stignore in subdirs, then yes, includes should be applied in the directory the files is being included from. I will add a info message about non-existing files. |
Though breaks syncthing#502 in a way, as .stignore is not the only place where stuff gets defined anymore. Though it never was, as .stignore can be placed in each dir, but I think we should phase that out in favor of globbing which means that we can then have a single file, which means that we can have a UI for editing that. Alternative would be as suggested to include a .stglobalignore which is then synced as a normal file, but gets included by default. Then when the UI would have two editors, a local ignore, and a global ignore.
6722985 to
c2daedb
Compare
|
Let me know if you want me to do something else (such as handle recursion) |
|
Yeah I think we need to handle recursion, since the results are so bad if the user happens to do it (basically hang using 100% cpu until it crashes a while later). The test tests that now. |
There was a problem hiding this comment.
I'd probably simplify this to a simple map to just ignore files that we have seen before, recursion or no recursion, but this works too.
Add #include directive to .stignore (fixes #424)
Though breaks #502 in a way, as .stignore is not the only place where
stuff gets defined anymore.
Though it never was, as .stignore can be placed in each dir, but I think we
should phase that out in favor of globbing which means that we can then
have a single file, which means that we can have a UI for editing that.
Alternative would be as suggested to include a .stglobalignore which is then synced
as a normal file, but gets included by default.
Then when the UI would have two editors, a local ignore, and a global ignore.