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 包含所有 PR 的更改时,如果 stack 中的所有 PR 都能被识别为已合并并已关闭,则表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
git, github, go
领域
cli, devtools
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
58/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。