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

Offen Anfängerfreundlich
#416 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
72/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Ruhig
Tech-Stack
go
Bereich
cli

Rechercherichtung

Beginne beim Einstiegspunkt gh stack view --json und vergleiche dessen Payload mit der menschenlesbaren Ausgabe von gh stack view --short. Die Änderung ist abgeschlossen, wenn das JSON den Stack-Identifier als Top-Level-Feld number enthält, während die vorhandenen Felder branches, currentBranch und trunk weiterhin verfügbar bleiben; prüfe die vorhandenen Tests des Befehls, falls welche vorhanden sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
Go
Sterne
1.5k
Forks
73
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
7

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus github/gh-stack

Alle Issues in github/gh-stack

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.