No non-interactive way to select a stack when the branch belongs to several (e.g. the trunk)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 64/100
Direzione di ricerca
Inizia dal punto di ingresso gh stack view e segui come gestisce più stack, la selezione interattiva e l’argomento posizionale scartato; confrontalo con il comportamento di selezione esistente di gh stack checkout <n>. Il lavoro è completato quando gh stack view --stack <number> può selezionare uno stack da un branch condiviso senza modificare il branch sottoposto a checkout, incluso lo scenario main riprodotto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When the current branch belongs to more than one stack — most commonly the trunk, which is the base of every stack in the repo — gh stack view fails and offers no non-interactive way out:
$ gh stack view --short
✗ branch "main" belongs to multiple stacks; use an interactive terminal to select one
There is no --stack flag. Combined with gh stack view silently discarding positional arguments (#414), there is currently no way at all to view a specific stack non-interactively.
Why this matters
Two stacks off a shared trunk is the normal state for anyone working on more than one change at a time, not an edge case — and main is in that position permanently, so any script or agent that starts from the default branch hits this immediately.
"Use an interactive terminal" is not available in CI, in a shell script, or to an automated agent. The only workaround is to gh stack checkout <n> first purely to move onto a branch in the desired stack, which mutates the working tree just to perform a read.
Reproduction
# create two stacks that both base off main
git switch main
gh stack view --short # -> "belongs to multiple stacks; use an interactive terminal"
Public repo with two stacks off a shared main: https://github.com/xn/gh-stack-repro
Expected
A --stack <number> flag on view (and anywhere else this ambiguity can arise), so the stack can be named explicitly without changing the checked-out branch.
Environment
gh2.97.0gh-stackv0.1.0- git 2.50.1
- macOS 26.4.1, darwin/arm64
- Lingua principale
- Go
- Stelle
- 1.5k
- Fork
- 73
- Merge medio
- 1g 8h
- PR unite (30g)
- 7
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/gh-stack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
feature request topic: cli - general
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
feature request topic: auto-merge
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug topic: docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Tutte le issue di github/gh-stack
Issue simili
-
textual definition
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
geneontology/go-ontology#32653 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
needs design
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100