Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#415 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
64/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu từ entry point gh stack view và lần theo cách nó xử lý nhiều stack, việc lựa chọn tương tác và positional argument bị loại bỏ; so sánh với hành vi lựa chọn hiện có của gh stack checkout <n>. Hoàn thành khi gh stack view --stack <number> có thể chọn một stack từ một branch dùng chung mà không thay đổi branch đang được checkout, bao gồm cả kịch bản main đã được tái hiện.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Go
Star
1.5k
Fork
73
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
7

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/gh-stack

Tất cả issue của github/gh-stack

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.