I’ve just tried to have #include ~/.stignore in my various .stignores, in order to add the defaults above. This seems to work, as far as I can tell. So while there is no variable substitution, tilde expansion is available.
I’ve double-checked, and the tilde effectively is not expanded.
When looking at the source code, I see tests that verify that error messages are printed when the #include directives are invalid (e.g., testInvalidPatterns).
None of these errors shows up in my logs. This made me believe in the first place that tilde expansion worked.
Does anybody have more information about this? Would it make sense to file a bug for the missing error message?
Yes, please do, I’ve thought about it and forgotten it several times already.
The problem is that we’re specifically suppressing “file not found”, as we don’t want to log an error when trying to load a .stignore when there is none. But that also means we suppress a “file not found” when parsing #includes.
We can of course just check first if it exists, and if it does we actually do print whatever error we do run into when processing it. In the rare race condition where the user manages to delete the .stignore file between that check and the open, they’ll get the error and it’s no big deal…
Hi @maelcum
Not sure why you are listing .stignore and .stfolder, they don’t sync.
I like to sync the ~MicrosoftOffice lock files to reduce the chance of conflicts. If it is on a node when I try to open it I know there is a good chance I am about to create a conflict.
@Cyphase, since the thread is back up the top it might be worth updating your original post.
I don’t think it is worth ignoring the *.part or *.crdownload any more because we should be able to pull some of the blocks from them once the move/rename happens. Probably the same thing for .iCloud*.
Perhaps one one of the core developers could correct me if I am wrong.
> Not sure why you are listing .stignore and .stfolder, they don’t sync. yep, I know. The ignore list is the file I’d consult if in doubt what should sync. the .stignore and .stfolder are there as a reminder for me. Just that.
Thanks for the ping @kluppy, and to everyone else who has commented with suggestions. I’m too tired to do an update at the moment , but I’ll do one the next chance I get. I’m glad to see this post has gotten so many views and comments in the time that I’ve been inactive.
A pattern beginning with #include results in loading patterns from the named file. It is an error for a file to not exist or be included more than once. Note that while this can be used to include patterns from a file in a subdirectory, the patterns themselves are still relative to the folder root. Example: #include more-patterns.txt.
Meaning: if you write in .stignore the line: #include .stglobalignores, it’ll search for a .stglobalignores file in the same place that .stignore resides, and then parse .stglobalignore’s contents as a continuation of .stingnore.
(The point of using extra file in addition to the base .stignore, it that .stignore itself is device specific, that is - it won’t sync to other devices. So people use #include some_file_with_patterns_to_sync to add ingore patterns they like to be synced across several devices.)