-
|
Can someone explain me the details of how include/exclude of the --glob argument works? The help (and documentation) mentions the following And the examples in the documentation only highlight excludes. As far as I understand, when only using excludes, via the I'm not sure how include would work, I'm assmuing by leaving out the By search through the github issues, i've read thread where it appears you can also mix and match includes and excludes for more complex matching, but as I don't see any reference to the docs for this I can only guess how that should work My use case:
I made little sample setup: Give my following source structure For 1 I would expect only to match For 2 I would expect only to match For 2 (excluding dot files/directories) I can make it work with the following glob: I would assume for 1 by removing the Perhaps my understanding of the include is wrong. When I for example run the following (which should only include the For now I will just settle on a snapshot that includes both the dot files/directories and the normal ones. But I am curious on how the include/exclude mechanism is working. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Hi @sjiep! The include/exclude behavior currently depends on the In meanwhile you can use |
Beta Was this translation helpful? Give feedback.
-
|
Knowing that it uses the First of all it gave me this piece of information:
and
So my case for "exclude dotfiles at root" was already working with this: # Exclude all files/directories under the given path that start with a dot
--glob="!/home/sjiep/Playground/backup/dot/.*"My case I was struggling with (as I wasn't writing it as an exclude was) "only containing the dot files/directories from the root (recursively)" which can be achieved via an exclude like so: # Exclude all files/directories under the given path that do not start with a dot
--glob="!/home/sjiep/Playground/backup/dot/[!.]*" |
Beta Was this translation helpful? Give feedback.
Hi @sjiep!
The include/exclude behavior currently depends on the
ignorecrate which is e.g. also used by ripgrep.We however plan to rework this soon as it turns out that many people are facing problems with using this for their backup selections. This, however, will take a bit.
In meanwhile you can use
rustic ls(with a local path) to test your globs and get the result very quickly...