Add negation to merge files, adds CACHEDIR.TAG support
#757
+21
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes the previously forbidden
!modifier available tomergeanddir-mergefilters.It's effect is that it turns the default for that filter file to
- /**(which is added after the merge file rules).Additionally, unless the
emodifier is also set, another rule for including the rules file is added.This by itself makes it possible to honour
CACHEDIR.TAGfiles by specifying--filter='dir-merge,+! CACHEDIR.TAG'. TheCACHEDIR.TAGis still parsed. Its first line is usuallySignature: 8a477f597d28d172789f06886806bc55, so currently a rule for that is added, but it would in practice never(tm) match.I could imagine adding another modifier specifying a merge file is just a tag, meaning it is not parsed at all. Maybe
t. Or, special-case theCACHEDIR.TAGfilename. Or, ignore all rules with the exact contentSignature: 8a477f597d28d172789f06886806bc55. But also this is already very usable as is, and IMO a pretty small change.Additionally it would be easy to add aliases like
tarand others have them:Let me know what you think!
Implements #451, #499.
For reference, the
CACHEDIR.TAGspec: https://bford.info/cachedir/