Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search: add NOT as syntactic sugar #12520

Merged
merged 8 commits into from Jul 29, 2020
Merged

Conversation

stefanhengl
Copy link
Member

@stefanhengl stefanhengl commented Jul 28, 2020

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"

@stefanhengl stefanhengl added this to the 3.19 milestone Jul 28, 2020
@stefanhengl stefanhengl marked this pull request as ready for review July 28, 2020 18:04
@stefanhengl stefanhengl requested review from a team and rvantonder July 28, 2020 18:04
Copy link
Contributor

@rvantonder rvantonder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving to unblock, see inline comments

@stefanhengl stefanhengl merged commit c2b33bf into master Jul 29, 2020
@stefanhengl stefanhengl deleted the sh/not-as-syntactic-suggar branch July 29, 2020 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add NOT as syntactic sugar for negatable fields
2 participants