Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

No non-interactive way to select a stack when the branch belongs to several (e.g. the trunk)

オープン
#415 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
64/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go
領域
cli

調査の方向性

gh stack view のエントリーポイントから開始し、複数の stack、インタラクティブな選択、破棄される位置引数をどのように処理しているかを追跡します。これを、既存の gh stack checkout <n> の選択動作と比較します。gh stack view --stack <number> が、チェックアウト済みのブランチを変更せずに共有ブランチから stack を選択でき、再現した main のシナリオも含まれていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

feature request topic: cli - view

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

  • gh 2.97.0
  • gh-stack v0.1.0
  • git 2.50.1
  • macOS 26.4.1, darwin/arm64
主要言語
Go
スター
1.5k
フォーク
73
平均マージ
1日 8時間
マージ済み PR(30日)
7

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/gh-stack のほかの issue

github/gh-stack の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。