Title: gh stack rebase: queued PR treated as merged, causing incorrect rebases for downstream branches · Issue #144 · github/gh-stack · GitHub
Open Graph Title: gh stack rebase: queued PR treated as merged, causing incorrect rebases for downstream branches · Issue #144 · github/gh-stack
X Title: gh stack rebase: queued PR treated as merged, causing incorrect rebases for downstream branches · Issue #144 · github/gh-stack
Description: Reproduction On a repo with stacked branches and PRs queued in the merge queue, run gh stack rebase. Example observed output from a user report: ➜ token-scanning-service git:(aerendel/mixed-content-types3) gh stack rebase ✓ Fetched origi...
Open Graph Description: Reproduction On a repo with stacked branches and PRs queued in the merge queue, run gh stack rebase. Example observed output from a user report: ➜ token-scanning-service git:(aerendel/mixed-content...
X Description: Reproduction On a repo with stacked branches and PRs queued in the merge queue, run gh stack rebase. Example observed output from a user report: ➜ token-scanning-service git:(aerendel/mixed-content...
Opengraph URL: https://github.com/github/gh-stack/issues/144
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"gh stack rebase: queued PR treated as merged, causing incorrect rebases for downstream branches","articleBody":"Reproduction\n\n1. On a repo with stacked branches and PRs queued in the merge queue, run `gh stack rebase`.\n2. Example observed output from a user report:\n\n```\n➜ token-scanning-service git:(aerendel/mixed-content-types3) gh stack rebase\n✓ Fetched origin\n✓ Trunk main fast-forwarded to aed1023\nStack detected: (main) \u003c- aerendel/mixed-content-types1 \u003c- aerendel/mixed-content-types2 \u003c- aerendel/mixed-content-types3\nRebasing branches in order, starting from aerendel/mixed-content-types1 to aerendel/mixed-content-types3\n✓ Skipping aerendel/mixed-content-types1 (PR #9333 queued)\n✓ Rebased aerendel/mixed-content-types2 onto main (adjusted for merged PR)\n✓ Rebased aerendel/mixed-content-types3 onto aerendel/mixed-content-types2 (adjusted for merged PR)\nAll branches in stack rebased locally with main\nTo push up your changes, run `gh stack push`\n```\n\nActual behavior\n\n- `gh stack rebase` treated a queued PR (PR #9333) as if it were merged when computing rebases for subsequent branches. The command skipped the first branch due to it being \"queued\", but then rebased the next branch \"adjusted for merged PR\", and treated the final branch as rebased onto the intermediate branch \"adjusted for merged PR\". This resulted in the second-layer branch being rebased as if the queued PR had already been merged.\n\nExpected behavior\n\n- Queued PRs in the merge queue (not yet merged into trunk) should NOT be treated as merged when computing rebases for downstream branches. `gh stack rebase` should preserve the stack order and rebase subsequent branches relative to the actual trunk and the true merge state (or otherwise clearly document and provide an option to treat queued PRs as merged).\n\nAdditional context\n\n- Command used: `gh stack rebase`\n- Observed in token-scanning-service example above (output pasted by user).\n\nSuggested fix ideas\n\n- Detect PRs that are only queued (not merged) and ensure they are not considered merged when adjusting base refs for downstream rebases.\n- Add a flag or mode to opt-in to \"treat queued PRs as merged\" if there are valid workflows that expect that behavior.\n\nPlease let me know if you need logs or more reproduction details; the user who reported this is the original author of the pasted stack output.\n\n[View original Slack conversation](https://github.slack.com/archives/C09M2GA1KQX/p1782322028230539?thread_ts=1782322028.230539\u0026cid=C09M2GA1KQX)","author":{"url":"https://github.com/skarim","@type":"Person","name":"skarim"},"datePublished":"2026-06-24T17:45:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/144/gh-stack/issues/144"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:d35c2b31-4082-6bc9-5718-1bb8225544f2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AF30:11B239:DBEFBC:1353F3B:6A4FE5EC |
| html-safe-nonce | d65af71d0985ac57f38c0f5c5901260d875a378266162654cd0d66a4fb072d7d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRjMwOjExQjIzOTpEQkVGQkM6MTM1M0YzQjo2QTRGRTVFQyIsInZpc2l0b3JfaWQiOiIyNTQxMzc2MzI4ODYwNDI3NzU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 0238b9901d84bc40fa406737cd92f8c71a4086666d9858f9b437553f74226f52 |
| hovercard-subject-tag | issue:4737130427 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/github/gh-stack/144/issue_layout |
| twitter:image | https://opengraph.githubassets.com/292908704b4738c8c4cf47771c97904906572ff2f192476885d32b1a7dd5c51c/github/gh-stack/issues/144 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/292908704b4738c8c4cf47771c97904906572ff2f192476885d32b1a7dd5c51c/github/gh-stack/issues/144 |
| og:image:alt | Reproduction On a repo with stacked branches and PRs queued in the merge queue, run gh stack rebase. Example observed output from a user report: ➜ token-scanning-service git:(aerendel/mixed-content... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skarim |
| hostname | github.com |
| expected-hostname | github.com |
| None | 19b98c3d9767bb8a56238a89ff8401d1cbdf3bc5c353799aacf49fe6c76b4b7c |
| turbo-cache-control | no-preview |
| go-import | github.com/github/gh-stack git https://github.com/github/gh-stack.git |
| octolytics-dimension-user_id | 9919 |
| octolytics-dimension-user_login | github |
| octolytics-dimension-repository_id | 1151630728 |
| octolytics-dimension-repository_nwo | github/gh-stack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1151630728 |
| octolytics-dimension-repository_network_root_nwo | github/gh-stack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 142593e66413bbae27fd485859993597d5a3b104 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width