lib.fileset: Document decision for strict existence checks

Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>

+13
+13
lib/fileset/README.md
··· 252 - (+) That can change depending on which files are included, so if it's used for `fileFilter` 253 it would change the `subpath`/`components` value depending on which files are included. 254 - (+) If necessary, this restriction can be relaxed later, the opposite wouldn't be possible
··· 252 - (+) That can change depending on which files are included, so if it's used for `fileFilter` 253 it would change the `subpath`/`components` value depending on which files are included. 254 - (+) If necessary, this restriction can be relaxed later, the opposite wouldn't be possible 255 + 256 + ### Strict path existence checking 257 + 258 + Coercing paths that don't exist to file sets always gives an error. 259 + 260 + - (-) Sometimes you want to remove a file that may not always exist using `difference ./. ./does-not-exist`, 261 + but this does not work because coercion of `./does-not-exist` fails, 262 + even though its existence would have no influence on the result. 263 + - (+) This is dangerous, because you wouldn't be protected against typos anymore. 264 + E.g. when trying to prevent `./secret` from being imported, a typo like `difference ./. ./sercet` would import it regardless. 265 + - (+) `difference ./. (maybeMissing ./does-not-exist)` can be used to do this more explicitly. 266 + - (+) `difference ./. (difference ./foo ./foo/bar)` should report an error when `./foo/bar` does not exist ("double negation"). Unfortunately, the current internal representation does not lend itself to a behavior where both `difference x ./does-not-exists` and double negation are handled and checked correctly. 267 + This could be fixed, but would require significant changes to the internal representation that are not worth the effort and the risk of introducing implicit behavior.