Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

`gh stack view` silently ignores positional arguments, including a valid different stack number

Offen
#414 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
58/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Ruhig
Tech-Stack
go
Bereich
cli

Rechercherichtung

Beginne mit der Argumentanalyse des Befehls gh stack view und reproduziere die beiden Befehle aus dem Issue, einschließlich ihres Exit-Status und ihrer Ausgabe. Prüfe, wie gh stack checkout eine Stack-Nummer verarbeitet, und füge dann Tests für gültige und ungültige Positionsargumente hinzu. Fertig ist die Aufgabe, wenn der Befehl sie nicht mehr stillschweigend ignoriert: Er sollte sie entweder eindeutig ablehnen oder die Auswahl eines Stacks konsistent unterstützen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

bug topic: cli - view

Summary

gh stack view accepts no positional argument, but supplying one is silently discarded instead of rejected. The harmful case is passing a valid stack number that isn't the current one — you get a different stack's contents, with that stack's number in the header, and no indication your argument was ignored.

On a branch belonging to stack #6, asking for stack #3 (which exists):

$ gh stack view --short 3
Stack #6                          <-- rendered #6, not the #3 that was requested
├ stack-b-two ○ #5
» stack-b-one ○ #4 (current)
└ main

$ gh stack view --short garbage999
Stack #6                          <-- also silently succeeds
├ stack-b-two ○ #5
» stack-b-one ○ #4 (current)
└ main

Exit status is 0 in both cases.

Why this matters

The output carries a stack number in its header, so it reads as authoritative. Anyone comparing two stacks — or scripting against view — can act on the wrong one without any signal. It is also a natural mistake to make, because gh stack checkout does take a stack number, so the two commands look like they share a selector.

Reproduction

In a repo with two stacks:

git switch <a-branch-in-stack-B>
gh stack view --short <stack-A-number>   # shows stack B
gh stack view --short garbage999         # shows stack B

Public repo with two stacks set up for this: https://github.com/xn/gh-stack-repro

Expected

Either error with unknown argument "3" (the usual gh behaviour for unexpected positionals), or accept a stack selector here the way gh stack checkout does. The latter would also give a non-interactive escape hatch for the ambiguity in #415.

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.