github / github/gh-stack

Feature request: support merge-based stack synchronization without force-pushing

オープン
#445 コメント 0 件 リアクション 12 件 担当者 0 名 GitHub で見る
feature request topic: rebase alternative
主要言語
Go
スター
1.5k
フォーク
70
平均マージ
1日 8時間
マージ済み PR(30日)
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

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

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

調査の方向性

まず、既存の "Rebase stack" ワークフローと CLI の stack 同期コマンドを追跡します。ブランチの更新、Force-Pushes、競合、承認、checks、保護されたブランチがどのように処理されるかを整理します。選択可能な Merge ベースのモードによって、Force-Pushes を行わずに stack の順序でブランチが同期され、既存の Rebase ベースの stack も引き続き動作すれば完了です。

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

評価

技術スタック
git, github, go
領域
cli, devtools
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

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

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