Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I search github labels with logical operator OR?

Tags:

github

filter

I'm trying to filter all my issues on github like this:

label:bug OR label:enhancement 

But obviously that does not work. I found this page https://help.github.com/articles/searching-issues/ and i thought it must be written there, but I cannot figure out how to do it.

Could it really be that one cannot filter issues of two labels? I mean that would be such a basic task, wouldn't it?

Well if anyone could give me a hint upon that matter I'd be glad to hear it.

like image 355
Merc Avatar asked Mar 19 '15 02:03

Merc


People also ask

How many and OR and NOT operators are you allowed to use in one search query on GitHub?

Limitations on query length The Search API does not support queries that: are longer than 256 characters (not including operators or qualifiers). have more than five AND , OR , or NOT operators.

How do I find pull requests on GitHub?

To see pull requests, click the Issues filter. Show activity on this post. It searches for both issues and pull request.


1 Answers

Github does not support searching the labels that way. The searching for issues is considered to be an "AND" instead of an "OR" .

Here's a repository used to try this out.

Example demonstrating github supports "AND" in search

My expectations

All the issues that are enhancement, feature or both should appear..

  1. enhancement and feature

  2. enhancement

  3. feature

Actual result

Only the ones which were both were shown.

  1. enhancement and feature

Hence it does not support OR operator.

UPDATE

Another tedious hack around this could be remove the unwanted labels using a -(minus) symbol before the label. Look at the following example

label:enhancement -label:bug -label:foo -label:bar 

This will list all the items not having foo, bar and bug as a label on them. This will work but can become tedious if labels are too many.

Filtering issues containing only the enhancements

UPDATE as of 2021

Now you can search using an OR operation. Please see the answer by @VonC

like image 55
cafebabe1991 Avatar answered Nov 12 '22 18:11

cafebabe1991