我可以使用逻辑运算符 OR 搜索 github 标签吗?

编程入门 行业动态 更新时间:2024-10-09 15:18:20
本文介绍了我可以使用逻辑运算符 OR 搜索 github 标签吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试像这样过滤我在 github 上的所有问题:

label:bug 或 label:enhancement

但显然这行不通.我找到了这个页面help.github/articles/searching-issues/我认为它必须写在那里,但我不知道该怎么做.

难道真的不能过滤两个标签的问题吗?我的意思是,这将是一项如此基本的任务,不是吗?

好吧,如果有人能就这件事给我一个暗示,我会很高兴听到的.

解决方案

Github 不支持以这种方式搜索标签.对问题的搜索被认为是一个AND".而不是或".

这是用于尝试此操作的存储库.

示例演示github支持AND"在搜索中

我的期望

所有增强、功能或两者的问题都应该出现..

  • 增强和功能

  • 增强

  • 功能

  • 实际结果

    仅显示两者.

  • 增强和功能
  • 因此它不支持 OR 运算符.

    更新

    另一个乏味的黑客可能是在标签前使用 -(减号)符号删除不需要的标签.看下面的例子

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

    这将列出所有没有 foo、bar 和 bug 作为标签的项目.这会奏效,但如果标签太多会变得乏味.

    过滤仅包含增强功能的问题

    截至 2021 年的更新

    现在您可以使用 OR 运算进行搜索.请参阅@VonC 的回答

    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 help.github/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.

    解决方案

    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..

  • enhancement and feature

  • enhancement

  • feature

  • Actual result

    Only the ones which were both were shown.

  • 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

    更多推荐

    我可以使用逻辑运算符 OR 搜索 github 标签吗?

    本文发布于:2023-11-09 04:02:17,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1571347.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:可以使用   运算符   逻辑   标签   github

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!