Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#414 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
58/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
go
Área
cli

Línea de trabajo

Empieza por el análisis de argumentos del comando gh stack view y reproduce los dos comandos del issue, incluido su estado de salida y su salida. Comprueba cómo gh stack checkout gestiona un número de stack y añade cobertura para argumentos posicionales válidos e inválidos. La tarea estará terminada cuando el comando deje de ignorarlos silenciosamente: debe rechazarlos claramente o admitir de forma coherente la selección de un stack.

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

Descripción

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
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.