`gh stack view --json` omits the stack number that the text output prints

Aberta Para iniciantes
#416 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Pouca atividade
Stack de tecnologia
go
Domínio
cli

Direção de pesquisa

Comece pelo ponto de entrada gh stack view --json e compare seu payload com a saída legível por humanos de gh stack view --short. A alteração estará concluída quando o JSON incluir o identificador do stack como um campo de nível superior number, enquanto os campos existentes branches, currentBranch e trunk continuarem disponíveis; verifique os testes existentes do comando, se houver.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

feature request topic: cli - view

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

  • gh 2.97.0
  • gh-stack v0.1.0
  • git 2.50.1
  • macOS 26.4.1, darwin/arm64
Linguagem predominante
Go
Estrelas
1.5k
Forks
73
Merge médio
1d 8h
PRs com merge (30d)
7

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de github/gh-stack

Todas as issues de github/gh-stack

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.