No non-interactive way to select a stack when the branch belongs to several (e.g. the trunk)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 64/100
Línea de trabajo
Comienza en el punto de entrada gh stack view y sigue cómo gestiona múltiples stacks, la selección interactiva y el argumento posicional descartado; compáralo con el comportamiento de selección existente de gh stack checkout <n>. Se considera terminado cuando gh stack view --stack <number> puede seleccionar un stack desde una rama compartida sin cambiar la rama actualmente extraída, incluido el escenario reproducido de main.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Go
- Estrellas
- 1.5k
- Forks
- 73
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 7
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/gh-stack
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
-
feature request topic: cli - general
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
feature request topic: auto-merge
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
bug topic: docs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
Todos los issues de github/gh-stack
Issues similares
-
textual definition
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
geneontology/go-ontology#32653 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
-
needs design
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100