Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`gh stack submit` fails on forks by attempting to create PRs on upstream repository (`Head sha can't be blank`)

Đang mở
#509 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
65/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
git, github, go
Lĩnh vực
api, cli

Hướng nghiên cứu

Bắt đầu từ entry point gh stack submit và lần theo quá trình phân giải repository, bao gồm gh-stack.remote và repository mặc định đã cấu hình, cho đến lời gọi GraphQL createPullRequest. Tái hiện bằng thiết lập fork và GH_DEBUG=1. Được xem là hoàn tất khi việc tạo PR xếp chồng nhắm đến fork hoặc hỗ trợ rõ ràng repository head dự định mà không có các lỗi SHA trống.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)
  • gh version: gh version 2.100.0 (2026-09-03)
  • gh stack extension version: github/gh-stack v0.1.1
Repository Setup
Steps to Reproduce
  1. Clone a fork repository that has an upstream remote configured.
  2. Create stacked branches locally and push them to origin:
    a. main -> feature/branch-1 -> feature/branch-2
  3. Set the default repository using gh repo set-default Hakzai/pokerpulsepro-tauri.
  4. 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
Ngôn ngữ chính
Go
Star
1.5k
Fork
73
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
7

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/gh-stack

Tất cả issue của github/gh-stack

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.