`gh stack submit` fails on forks by attempting to create PRs on upstream repository (`Head sha can't be blank`)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
Direzione di ricerca
Inizia dal punto di ingresso gh stack submit e segui la risoluzione del repository, inclusi gh-stack.remote e il repository predefinito configurato, fino alla chiamata GraphQL createPullRequest. Riproduci il problema con la configurazione del fork e GH_DEBUG=1. Il lavoro è completato quando la creazione di PR impilate punta al fork o supporta esplicitamente il repository head previsto, senza errori relativi a SHA vuoti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When using gh stack submit on a repository cloned from a fork, the command attempts to query and submit the stack against the upstream parent repository instead of the fork (or specified default repository).
Since the feature branches only exist on the fork (origin), GitHub's GraphQL API rejects the PR creation because the branches do not exist on the target upstream repository, resulting in Head sha can't be blank / Base sha can't be blank.
Executing gh repo set-default <fork-owner>/<repo> does not alter this behavior.
Environment
- OS: Windows 11 (Git Bash / MINGW64)
ghversion:gh version 2.100.0 (2026-09-03)gh stackextension version:github/gh-stack v0.1.1
Repository Setup
- origin: https://github.com/Hakzai/pokerpulsepro-tauri.git (Fork)
- upstream: https://github.com/davidelvar/pokerpulsepro-tauri.git (Parent Repo)
gh repo set-defaultis explicitly set toHakzai/pokerpulsepro-tauri.
Steps to Reproduce
- Clone a fork repository that has an
upstreamremote configured. - Create stacked branches locally and push them to
origin:
a.main->feature/branch-1->feature/branch-2 - Set the default repository using
gh repo set-default Hakzai/pokerpulsepro-tauri. - Run
gh stack submit.
Expected Behavior
gh stack submit should resolve stacked PRs against the configured default repository (Hakzai/pokerpulsepro-tauri) or provide cross-repository fork support by specifying the head branch owner/ref.
Actual Behavior
The command targets davidelvar/pokerpulsepro-tauri and fails with:
⚠ failed to create PR for feature/add-brazil-real-currency: creating PR: GraphQL: Head sha can't be blank, Base sha can't be blank, No commits between main and feature/add-brazil-real-currency, Head ref must be a branch (createPullRequest)
Debug Output (GH_DEBUG=1 gh stack submit)
Relevant log excerpts showing API requests targeting the upstream repo instead of the fork:
* Request to https://api.github.com/repos/davidelvar/pokerpulsepro-tauri/stacks?per_page=100&page=1
...
[git.exe push origin --force-with-lease=refs/heads/feature/add-brazil-real-currency:... refs/heads/feature/add-brazil-real-currency:refs/heads/feature/add-brazil-real-currency]
* Request to https://api.github.com/graphql
⚠ failed to create PR for feature/add-brazil-real-currency: creating PR: GraphQL: Head sha can't be blank, Base sha can't be blank, No commits between main and feature/add-brazil-real-currency, Head ref must be a branch (createPullRequest)
Git Config
Git config is pointing correctly the upstream to davidelvar/pokerpulsepro-tauri and the origin to the fork at Hakzai/pokerpulsepro-tauri.
submodule.active=.
remote.origin.url=https://github.com/Hakzai/pokerpulsepro-tauri.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.gh-resolved=base
branch.main.remote=origin
branch.main.merge=refs/heads/main
branch.main.vscode-merge-base=origin/main
lfs.repositoryformatversion=0
remote.upstream.url=https://github.com/davidelvar/pokerpulsepro-tauri.git
remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*
...
branch.feature/full-backup-impl.vscode-merge-base=origin/main
branch.feature/full-backup-impl.remote=origin
branch.feature/full-backup-impl.merge=refs/heads/feature/full-backup-impl
branch.feature/add-brazil-real-currency.vscode-merge-base=origin/main
branch.feature/add-brazil-real-currency.remote=origin
branch.feature/add-brazil-real-currency.merge=refs/heads/feature/add-brazil-real-currency
branch.feature/create-winners-board.vscode-merge-base=origin/main
branch.feature/create-winners-board.remote=origin
branch.feature/create-winners-board.merge=refs/heads/feature/create-winners-board
branch.bugfix/prize-tab-not-showing-champion.vscode-merge-base=origin/main
branch.bugfix/prize-tab-not-showing-champion.remote=origin
branch.bugfix/prize-tab-not-showing-champion.merge=refs/heads/bugfix/prize-tab-not-showing-champion
branch.chore/deploy-to-github-pages.vscode-merge-base=origin/main
branch.chore/deploy-to-github-pages.remote=origin
branch.chore/deploy-to-github-pages.merge=refs/heads/chore/deploy-to-github-pages
rerere.enabled=true
rerere.autoupdate=true
gh-stack.remote=origin
- 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