stack submit reports success (push + PR creation) without actually doing either, when origin remote is an old/renamed repo name
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia dal punto di ingresso gh stack submit e riproduci il caso di un’origine rinominata usando i comandi e i controlli git ls-remote nell’issue. Segui i risultati del push e della creazione delle PR attraverso il percorso di risoluzione di GitHub, confrontandoli con il repository canonico e con il caso del repository di lavoro. Il lavoro è completato quando le operazioni non riuscite restituiscono un errore e non possono produrre un output di successo che dichiari che sono stati creati branch e PR.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Environment
- gh version 2.96.0 (2026-07-02)
- gh-stack v0.1.0
- macOS/Linux (bash), two sibling repos in the same GitHub org, one hit the bug and one didn't with the exact same command sequence
Summary
gh stack submit printed full success output — branches pushed, 3 PRs created, a "Stack #478" created — but none of it actually happened on GitHub. The branches were never updated on origin, and no PRs existed anywhere I could find them. A second repo in the same session, using the identical workflow, worked correctly.
Repro shape
- Repo A (worked correctly): plain repo, origin is the canonical name of the repo on GitHub.
- Repo B (bug): origin remote (
git@github.com:<org>/<old-repo-name>.git) is an old/renamed name — GitHub transparently redirectsgh api repos/<org>/<old-repo-name>andgh repo viewto the current canonical name. The canonical repo also happens to carry stalefork/parentmetadata pointing at an unrelated third repo (from some past history), though I'm not sure that part is relevant.
Steps, same in both repos:
gh stack init --base <trunk> branchA branchB branchC # adopts 3 existing local commits, one per branch
gh stack submit
In Repo A, gh stack submit output:
Checking stack state...
Pushing to origin...
✓ Created PR #N1 for branchA
✓ Created PR #N2 for branchB
✓ Created PR #N3 for branchC
✓ Stack created on GitHub with 3 PRs (stack #N4)
✓ Pushed and synced 3 branches
...and this was true — git ls-remote --heads origin showed the branches updated, and gh pr view N1 etc. resolved to real, correctly-based PRs.
In Repo B, gh stack submit printed the exact same shape of success output (different PR numbers), but:
git ls-remote --heads originafterward showed the three branches unchanged —branchB(the one branch that existed beforestack init, now rewritten to a different commit locally) was still pointing at its old pre-rewrite SHA onorigin.branchAandbranchCdidn't exist onoriginat all.- The claimed PR numbers didn't correspond to any real PR:
gh pr view <N1>against the repo (by its canonical resolved name, by the old renamed name, and by the stale fork-parent repo) all failed with "Could not resolve to a PullRequest".gh pr list --head branchA(all three variants of repo name) returned[]. - A second, unmodified
gh stack submitrun reportedPR #N1 is up to date/✓ Stack on GitHub is up to date with 3 PRs/✓ Pushed and synced 3 branches— again fully green, again not reflecting reality.
Workaround
Plain git push -f origin branchA branchB branchC (outside gh-stack) worked immediately and updated origin correctly. Manually running gh pr create --repo <canonical-name> --base ... --head ... for each of the 3 layers created real, correctly-stacked PRs. After that, gh stack view correctly picked up the manually-created PRs (via head-branch matching, presumably) and rendered a consistent stack — so the local stack metadata itself wasn't corrupted, only submit's push+create step silently no-op'd while reporting success.
Impact
This is a correctness/trust issue rather than a crash: there's no error, no non-zero exit code (that I checked), and no indication anything is wrong — gh stack submit reports the same "everything succeeded" shape whether or not it actually did anything. Anyone scripting around this or trusting the CLI output at face value would believe their PRs are live when they aren't.
Suspected cause
Possibly a repo-resolution issue: pushing/creating against a stale resolved repo identity (following the old→canonical rename, or the stale fork/parent link) that either 404s silently or targets a repo the invoking user doesn't actually have write access to, without the tool checking the actual API response before printing ✓.
Happy to provide more repro detail/logs if useful — this was found mid-task rather than in an isolated repro, so I don't have a minimal standalone case yet, but the shape above (rename + fork-parent metadata) is the one differentiating factor I found between the working and failing repo.
- 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
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
NVIDIA/gpu-operator#2955 ·
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Broadcast Documentation Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
kovidgoyal/kitty#10516 ·
-
CVE-2024-24786 CPE mismatch Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
cisagov/vulnrichment#337 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100