Add --rebase-on-conflict flag to `gh stack sync` to auto-run rebase on conflicts
@skarim đang làm issue này rồi.
Từ ngày 11/8/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Summary
Add a flag to gh stack sync so that when a conflict is detected it automatically runs gh stack rebase (instead of instructing the user to run rebase manually).
Background / motivation
Currently when users run gh stack sync and it encounters a conflict the CLI prints an instruction to run gh stack rebase. Some users would prefer a single-command flow that attempts a rebase automatically when a conflict occurs to avoid typing two commands.
Proposed behavior
- Add an explicit flag to
gh stack sync, for example--rebase-on-conflict(alternative names:--rebase-if-conflict,--auto-rebase). - Default behavior of
gh stack syncremains unchanged (safe, no automatic rebase). - When the flag is provided and sync detects a conflict,
gh stack syncshould automatically invoke the rebase flow (equivalent to runninggh stack rebase). - The flag signals that the user consents to the potential rebase-related outcomes (e.g., temporary detached HEAD during an in-progress rebase), so the command can proceed without an additional prompt.
- The command should preserve non-interactive behavior where appropriate (i.e., suitable for scripts). If prompts are required during rebase, consider a complementary
--yesor--no-interactiveoption, or clearly document the interaction expectations.
Acceptance criteria
gh stack sync --rebase-on-conflictwill run a rebase automatically if a conflict is encountered during sync.- The default
gh stack syncremains unchanged and does not perform automatic rebases. - Documentation for
gh stack syncincludes the new flag and describes its behavior and risks.
Example
- Normal:
gh stack sync - With flag:
gh stack sync --rebase-on-conflict
Notes / implementation hints
- Consider the exact flag name and whether a short alias (e.g.,
-r) is appropriate. - Ensure the UX communicates that the user opted in to automatic rebase behavior and any potential consequences.
- Make sure the behavior is deterministic for CI/automation usage (document or provide an explicit non-interactive mode).
- 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
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/gh-stack
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
feature request topic: cli - general
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
feature request topic: auto-merge
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
bug topic: docs
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
Tất cả issue của github/gh-stack
Issue tương tự
-
textual definition
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
geneontology/go-ontology#32653 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
needs design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100