init writes branch.<name>.remote = '.', so submit reports a push that never happened
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
Reproduziere das Worktree-Szenario mit gh stack init --base develop feature/a feature/b, untersuche die resultierenden branch.*.remote-Werte mit git config, führe dann gh stack submit --auto aus und vergleiche das Ergebnis mit git ls-remote --heads origin. Erledigt bedeutet, dass init kein unbrauchbares .-Remote erstellt und submit nur dann Erfolg meldet, wenn die Branches tatsächlich das konfigurierte Remote erreichen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Environment
- gh 2.96.0 (2026-07-02), gh-stack v0.0.4, git 2.46.1, macOS 26.6
- Run inside a git worktree (
GIT_DIR=.git/worktrees/<name>) originis the canonical repo name, not a rename
Summary
gh stack init wrote branch.<name>.remote = . into git config. . means this local repository, so the subsequent gh stack submit pushed nowhere, printed Pushing to ...., and still reported ✓ Pushed and synced 2 branches. The branches did not exist on origin.
This is the same failure as #461 and the same family as #472, but a different trigger. There the cause was a renamed repo; here it is the remote config that init itself wrote.
Repro
git worktree add ../wt -b feature/a
# ... commit on feature/a, then branch feature/b on top, commit
gh stack init --base develop feature/a feature/b
git config --get-regexp 'branch\.feature.*remote'
Observed:
branch.feature/a.remote .
branch.feature/b.remote .
Every other branch in the same repo that was not created by gh stack init has remote origin.
Then:
gh stack submit --auto
Checking stack state...
Pushing to ....
⚠ failed to create PR for feature/a: creating PR: GraphQL: Head sha can't be blank,
Base sha can't be blank, No commits between develop and feature/a,
Head ref must be a branch (createPullRequest)
✓ Pushed and synced 2 branches
git ls-remote --heads origin 'feature/*' returns nothing. The push never happened, but the last line says it did. The PR-creation error is a downstream symptom: GitHub cannot see a branch that was never pushed.
Workaround
git push origin feature/a feature/b
git branch --set-upstream-to=origin/feature/a feature/a
git branch --set-upstream-to=origin/feature/b feature/b
After that, gh stack submit prints Pushing to origin... and works correctly. The stack view and the GitHub-side stack were unaffected throughout.
Why it matters
The empty remote name renders as Pushing to ...., which reads as ordinary progress ellipsis rather than an empty value, so there is nothing on screen to notice. Combined with the unconditional ✓ Pushed and synced line, the command looks like it succeeded. I only caught it because PR creation happened to fail in the same run; on a stack where the PRs already exist, submit would report success and silently push nothing.
Given #461 and #472 report the same shape from different causes, the general fix may be for submit to verify the push landed rather than trusting it, and to refuse an empty or . remote outright.
Note
I have not isolated whether the worktree is required to reproduce. It may be related to #459, which reports that gh-stack ties local state to $GIT_DIR and that a worktree changes it.
- Vorherrschende Sprache
- Go
- Sterne
- 1.5k
- Forks
- 73
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 5
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus github/gh-stack
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
-
feature request topic: cli - general
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
feature request topic: auto-merge
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
-
bug topic: docs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
Alle Issues in github/gh-stack
Ähnliche Issues
-
bug github_actions
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
registrystack/registry-stack#1393 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
JakeChampion/lang#10213 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100