github / github/gh-stack

Stack should be merged when merge commit is already pushed

未關閉
#457 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Go
星號
1.5k
分支
70
平均合併
1 天 8 小時
30 天內合併 PR
7

描述

## Reproduce step

Let's say you have this stacked PRs.

```
main <- PR#1 <- PR#2 <- PR#3
```

Now, you manually create merge commit and push it to the `main`.

```
prv_main <- PR#1 <- PR#2 <- PR#3
\---------------------+-------new_main
```

## Current Behavior

- `PR#1` is closed, because it's base is `main`, and GitHub automatically closes already merged PRs.
- `PR#2` and `PR#3` are **NOT closed**, because their bases aren't `main` (they point to previous PR's tip), so they still have diff remaining, and PR isn't closed.

## Expected Behavior

- All PRs should be closed.

## How to fix this

Stacked PR should check it's mergeability against the whole stack's base (e.g. `main` in this case).

Basically the whole point of stacked PR is that "your PR is pointing to another PR, but they are treated as pointing to base".

## Why this should be fixed

1. These PRs are shown as "open PRs" while they are already merged.
2. This will help 3rd-party integrations -- e.g. [bors](https://bors.tech/index.html) manually creates octopus merge commit of PRs and push it to main.

I know that you can manually `gh stack sync`, but I think this should be done automatically.

貢獻指南

開啟貢獻指南

研究方向

追蹤現有的 `gh stack sync` 進入點,以及用來判定堆疊 PR 是否已合併的邏輯。將其對 base 的處理與此處描述的手動推送 merge commit 情境進行比較。當 stack 的 base 包含它們的變更時,如果 stack 中的所有 PR 都被辨識為已合併並已關閉,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
git, github, go
領域
cli, devtools
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
活躍
描述清晰度
基本清楚
新手友好度
58/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。