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

Abierto Apto para principiantes
#416 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
go
Área
cli

Línea de trabajo

Comienza en el punto de entrada gh stack view --json y compara su payload con la salida legible para humanos de gh stack view --short. El cambio estará terminado cuando el JSON incluya el identificador del stack como campo de nivel superior number, mientras que los campos existentes branches, currentBranch y trunk sigan disponibles; revisa las pruebas existentes del comando, si las hay.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Go
Estrellas
1.5k
Forks
73
Merge medio
1 d 8 h
PR fusionados (30 d)
7

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de github/gh-stack

Todos los issues de github/gh-stack

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.