Inserting a layer in the middle of a stack requires unstack + link, which permanently drops merged PRs
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia riproducendo il comportamento segnalato di gh stack link e gh stack unstack, quindi esamina la limitazione di REST PATCH /repos/{o}/{r}/pulls/{n} e il flusso esistente di appartenenza allo stack. Il lavoro è completato quando un inserimento nel mezzo dello stack o una ricostruzione senza perdite preserva l’appartenenza delle PR unite e mantiene intatta l’intera cronologia dello stack.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
There is no way to insert a layer in the middle of an already-submitted stack while keeping the stack's merged PRs as members. The only working procedure (unstack + link) moves the still-open PRs into a new stack and leaves every merged PR behind in the old one, which is then closed. The historical grouping of the stack is lost, permanently and irreversibly.
Current behavior
Given a submitted stack S with, bottom to top, one merged PR #1 and open PRs #2 → #3 → #4, and the need to insert a new layer between #2 and #3:
gh stack modifyis TUI-only, so it is unusable non-interactively (and it restructures the local stack, not the server-side membership of an existing PR).- Retargeting the base of an existing stacked PR is refused:
- REST
PATCH /repos/{o}/{r}/pulls/{n}→HTTP 422 … PullRequest.base is invalid gh pr edit <n> --base <branch>→Cannot change the base branch because the pull request is part of a stack
- REST
gh stack linkonly appends to the top (gh stack link <stack#> <new>); it has no position/insert argument, and it rejects arguments that belong to a different stack.- So the only way out is
gh stack unstack <S>+gh stack link <bottom> … <top>.unstack(v0.1.0) unstacks the open PRs and leaves the merged#1inS;Sbecomesopen: falsewith#1as its sole member, and#1cannot be linked into the new stack (rejected as belonging to another stack).
Net effect: a purely structural edit in the middle of the stack silently destroys the association between the merged layers and the layers that are still in flight.
Expected behavior
Either of:
- Insertion: a way to place a PR/branch at an arbitrary position of an existing stack, e.g.
gh stack link --after <pr>/--before <pr>/--position <n>, without tearing the stack down. - Lossless rebuild: allow merged PRs to be re-linked into a stack (or have
unstack+linkcarry them over), so the recovery procedure above at least preserves the full history of the stack.
Why it matters
Merged layers are exactly the part of a stack that documents why the remaining layers look the way they do. Keeping them attached is useful today when reading the stack, and it is what would let the web UI group a whole line of work — landed and in flight — under a single stack. Today, any mid-stack restructuring resets that grouping, so long-lived stacks progressively lose their own history.
Environment
gh stack version 0.1.0- Private repository, stacks enabled.
- Lingua principale
- Go
- Stelle
- 1.5k
- Fork
- 73
- Merge medio
- 1g 8h
- PR unite (30g)
- 7
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/gh-stack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
feature request topic: cli - general
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
feature request topic: auto-merge
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
bug topic: docs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Tutte le issue di github/gh-stack
Issue simili
-
textual definition
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
geneontology/go-ontology#32653 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
needs design
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Priority/High ready-for-agent Severity/Major Type/Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100