Feature request: support merge-based stack synchronization without force-pushing
- 主要语言
- Go
- 星标
- 1.5k
- 派生
- 70
- 平均合并
- 1 天 8 小时
- 30 天内合并 PR
- 7
描述
## 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:
```text
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
贡献指南
调研方向
Start by tracing the existing "Rebase stack" workflow and the stack synchronization command in the CLI. Map how branch updates, force-pushes, conflicts, approvals, checks, and protected branches are handled. Done means a selectable merge-based mode synchronizes branches in stack order without force-pushing while existing rebase-based stacks continue to work.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, github, go
- 领域
- cli, devtools
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100