Feature request: support merge-based stack synchronization without force-pushing
還沒有人認領這個 Issue。
評估
研究方向
首先追蹤現有的 "Rebase stack" 工作流程以及 CLI 中的 stack 同步命令。整理分支更新、Force-Pushes、衝突、核准、checks 和受保護分支的處理方式。完成標準是:可選取的基於 Merge 的模式能夠按照 stack 順序同步分支,且不會執行 Force-Pushes,同時現有的基於 Rebase 的 stack 繼續正常運作。
由索引模型根據 Issue 內容生成。
描述
Summary
Please add an option for stacked pull requests to synchronize branches using merge commits instead of rebasing and force-pushing branch history.
Motivation
Our organization does not allow force-pushes because they rewrite branch history and can make audit trails, approvals, and incident investigation more difficult. The current "Rebase stack" workflow is therefore incompatible with our repository policies.
Proposed behavior
Add a merge-based synchronization mode for stacks:
- When a parent branch changes, merge the parent into each child branch in stack order.
- Preserve existing commits and branch history.
- Do not force-push rewritten branch history.
- Keep the existing rebase behavior as the default or as a selectable repository/stack setting.
- Make the selected synchronization mode visible in the stack UI and CLI.
- Respect branch protection and merge-commit policies.
Example
Given:
main
└── feature-a
└── feature-b
When main advances, merge main into feature-a, then merge the updated feature-a into feature-b, instead of rebasing both branches and force-pushing them.
Acceptance criteria
- A stack can be configured to use merge-based synchronization.
- Synchronizing the stack does not require force-pushing any branch.
- Existing approvals and checks are handled consistently with the merge-based history.
- Conflicts are reported per branch and can be resolved through the normal workflow.
- The behavior works with protected branches that block force-pushes.
- Existing rebase-based stacks continue to work unchanged.
Related issues
- #268: Stacked PR cannot be merged into a merge-queue branch
- #442: gh stack sync pushed a stack branch's merge commit directly onto the trunk branch
- 主要語言
- Go
- 星號
- 1.5k
- 分支
- 73
- 平均合併
- 1 天 8 小時
- 30 天內合併 PR
- 7
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/gh-stack 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 85/100
-
難度 1/5 1 小時以內 新手友好度 92/100
-
feature request topic: cli - general
難度 2/5 1-3 小時 新手友好度 68/100
-
feature request topic: auto-merge
難度 2/5 1-3 小時 新手友好度 68/100
-
bug topic: docs
難度 1/5 1 小時以內 新手友好度 68/100
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 60/100
github/gh-aw-mcpg#13748 ·
-
agentic-workflows
難度 2/5 1-3 小時 新手友好度 65/100
-
needs-triage
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 65/100
-
難度 2/5 1-3 小時 新手友好度 75/100
googleapis/librarian#7670 · 2 則留言 ·