`gh stack view --json` omits the stack number that the text output prints
还没有人认领这个 Issue。
评估
调研方向
从 gh stack view --json 入口点开始,将其 payload 与 gh stack view --short 的人类可读输出进行比较。当 JSON 包含作为顶层 number 字段的 stack 标识符,同时现有的 branches、currentBranch 和 trunk 字段仍然可用时,修改就完成了;如果该 command 存在现有测试,请检查它们。
由索引模型根据 Issue 内容生成。
描述
Summary
gh stack view prints the stack number in its human-readable output, but gh stack view --json omits it:
$ gh stack view --short
Stack #6
» stack-b-one ○ #4 (current)
...
$ gh stack view --json | jq 'keys'
[
"branches",
"currentBranch",
"trunk"
]
The per-branch objects carry pr.number, pr.url and pr.state, but the stack's own identifier is nowhere in the payload.
Why this matters
The stack number is the identifier gh stack checkout and gh stack link take, and the one shown in the GitHub stack UI — so it is the natural key for any automation. Because it is missing from the machine-readable output, scripts have to scrape it from gh stack submit's human-readable text (✓ Stack created on GitHub with 2 PRs (stack #6)) or from the UI.
Expected
Include the stack number as a top-level field in --json output, e.g. "number": 6, so --json is sufficient on its own.
Environment
gh2.97.0gh-stackv0.1.0- git 2.50.1
- macOS 26.4.1, darwin/arm64
- 主要语言
- Go
- 星标
- 1.5k
- 派生
- 73
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 7
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/gh-stack 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 85/100
-
难度 1/5 1 小时以内 新手友好度 92/100
-
feature request topic: cli - general
难度 2/5 1-3 小时 新手友好度 68/100
-
feature request topic: auto-merge
难度 2/5 1-3 小时 新手友好度 68/100
-
bug topic: docs
难度 1/5 1 小时以内 新手友好度 68/100
相似的 Issue
-
feature-request helm
难度 2/5 1-3 小时 新手友好度 68/100
gravitational/teleport#69785 ·
-
bug
难度 1/5 1 小时以内 新手友好度 92/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 88/100
crossplane/crossplane#7859 ·
-
难度 1/5 1 小时以内 新手友好度 90/100