search: add NOT as syntactic sugar
Created by: stefanhengl
Fixes #9976, relates to RFC94
This PR adds NOT as syntactic sugar to our query syntax. We support NOT for all negatable fields. If NOT comes before an unsupported field, we wrap the operand in a negated content field.
Examples
query | equivalent to |
---|---|
not file:foo |
-file:foo |
not repo:foo |
-repo:foo |
not content:foo |
-content:foo |
not foo |
-content:foo |
not foo:bar (unknown keyword) |
-content:"foo:bar" |