fix(server): pin a pull request's diff to its base commit - #9
Merged
Conversation
The ref comes from the URL, so a tab left open from an earlier session — or a bookmark, or a hand-edited address — kept rendering a different diff than the pull request's, under a header that still read "Changes from master". A pull request's diff has to be the one GitHub shows. A /diff request whose ref disagrees with the pull request's base commit is now redirected to it, with the other query parameters preserved. Switching revision inside the UI is a client-side navigation and never reaches the server, so exploring other revisions in an open session still works; reloading returns to the pull request. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs
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.
The ref comes from the URL, so a tab left open from an earlier session kept rendering a different
diff than the pull request's — under a header that still read "Changes from master", because the
description is instance-level while the diff follows the query parameter. #8 makes the stale ref
resolve to something sane; this makes it impossible for a PR view to show anything but the PR.
A
/diffrequest whoserefdisagrees with the pull request's base commit is redirected to it,other query parameters preserved. Switching revision inside the UI is a client-side navigation that
never reaches the server, so exploring other revisions in an open session still works — reloading
returns to the pull request.
Verified:
Stacked on #8.
🤖 Generated with Claude Code
https://claude.ai/code/session_018PkYQzbsnMihHesafWvXKs