跳转到内容

cnb-rs commit annotation list ​

cnb-rs commit annotation list <SHA>
cnb-rs commit annotation list --batch <SHA,SHA,...>

列出一个或批量列出多个 commit 的所有 annotations。单个 <SHA> 与 --batch 互斥。

选项 ​

  • <SHA>: 单个 commit SHA(支持短 SHA / 分支 / tag;未指定 --batch 时必填)
  • --batch <SHA,SHA,...>: 批量查询 commit 引用,逗号分隔或多次指定,最多 20 个;与 <SHA> 互斥

批量模式会先将每个引用解析为完整 commit SHA,再通过一次批量 API 请求查询。表格按 commit 分组,没有 annotation 的 commit 显示 (无)。

继承的全局选项:

  • --repo <REPO>: 指定仓库路径
  • --domain <DOMAIN>: 指定目标域名
  • --json: 单个模式输出原始 Vec<CommitAnnotation>;批量模式输出原始 Vec<CommitAnnotationInBatch>

示例 ​

bash
# 按分支名列出 annotations
$ cnb-rs commit annotation list main
KEY                VALUE
cnb-rs-test        phase2-ok
deployed           true

# JSON 拿完整字段(含 meta)
$ cnb-rs --json commit annotation list 349be5a | jq '.[].meta'

# 一次查询多个 commit
$ cnb-rs commit annotation list --batch main,v1.0.0
COMMIT     KEY                            VALUE
349be5a    deployed                       true
8b7a6c5    (无)

# --batch 可多次指定
$ cnb-rs commit annotation list --batch main --batch v1.0.0 --json

# 单个 commit 没有 annotations 时友好提示
$ cnb-rs commit annotation list deadbeef
Commit deadbeef 下没有 annotations

另请参阅 ​

Released under the MIT License.