github / github/gh-stack

Stack should be merged when merge commit is already pushed

Offen
#457 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
1.5k
Forks
70
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
7

Beschreibung

## 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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Trace the existing `gh stack sync` entry point and the logic that determines whether stacked PRs are merged. Compare its base handling with the manually pushed merge-commit scenario described here. Done means all PRs in the stack are recognized as merged and closed when the stack's base contains their changes.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git, github, go
Bereich
cli, devtools
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
58/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.