Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

submit: handle closed/merged PRs

Open
#111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
git, github, go
Domain
api, cli, devtools

Research direction

Start with the gh stack submit and gh stack sync entry points, then inspect the existing gh stack orphan --force behavior and README.md warning guidance. Done means closed PRs are detected during submit, confirmation and --yes behavior handles affected stacked branches and skips them, README.md documents the destructive --yes warning, and sync feasibility is assessed.

Written by the indexing model from the issue text.

Description

enhancement

If a PR happens to be closed, but is still tracked, updating the PR will result in an error akin to:

Updating PR #1234 for some-branch (base: trunk-branch)... failed
! failed to update PR #1234 base: failed to update PR #1234 base: HTTP 422: Validation Failed (https://api.github.com/repos/some/repo/pulls/1234)
PullRequest.base is invalid

My ideal solution is to detect closed PRs and prompt the user to orphan the branch. However, if this branch is in the middle of a stack, orphaning the branch would cause the rest of the branches behind it to also be orphaned (this is the behavior of gh stack orphan --force). In that case, the prompt message should note this and list the branches that will also be orphaned.

This feature will respect the --yes flag as provided to submit. The README.md should be updated with a warning (> [!WARNING]) about destructive operations that can occur if the --yes flag is provided.

If the user confirms that the branch(es) should be orphaned, then they are immediately orphaned. If those branches would have otherwise been updated in remainder of the gh stack submit operation, they must be skipped. We do not need to notify the user that the branches have been skipped.

Bonus points:

  • Investigate feasibility of detecting closed (but unmerged) PRs on a gh stack sync operation. If it would not significantly impact performance, then we can prompt the user as above.
Dominant language
Go
Stars
9
Forks
2
Avg merge
15h 9m
Merged PRs (30d)
4

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boneskull/gh-stack

All issues in boneskull/gh-stack

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.