fix: pull merge matching, PR update hash, and force-push branch tip - #78
Merged
Conversation
Compare branch tip to target hash with rev-parse and always branch -f when they differ so pushes are correct even when that branch is checked out. Resolve the stack commit hash from the current stack before updating a PR, propagate reload errors, and key pull merge sources by subject and commit hash so rebase edit stops still match after subject normalization. Deduplicate temp-branch cleanup, warn when fewer merges than expected, and refresh the stack after pull. Made-with: Cursor
hokwangchoi
approved these changes
May 6, 2026
simtel12
deleted the
pgit/gregorios-leach/fix--pull-merge-matching--pr-update-hash--and-forc
branch
May 6, 2026 22:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Force-push the intended commit when updating a PR branch you have checked out.
force_update_and_pushused to skipgit branch -fwhen the working branch matched the PR branch, sogit push -fcould still publish whatever was atHEADinstead of the requested hash. It now compares the branch tip to the target hash and resets the ref whenever they differ (still trimming the hash input).Resolve the PR update hash from the live stack.
handle_update_prno longer trusts a possibly stale hash from when the suspend was queued. It re-resolves by matching the patch subject to the current stack (cursor first, then scan) and surfaces a clear error with a refresh hint if the commit moved.More reliable “pull remote” merges during interactive rebase. Diverged PR stops are keyed by both subject and full commit hash, so rebase/edit/amend flows still match after subject lines diverge from
git log -1 --format=%s. Temppgit-temp-patch-*branches are deleted once per unique remote ref. If fewer merges ran than expected, the UI warns about partial merges and overwriting remote-only work.Propagate errors from
reload_stack()after PR update and after pull so failures are not silently ignored.Test plan
HEAD).git log -1; confirm merge stops still find the right remote ref.