Use cached base ref after Pull Request is merged - #866
Open
lucasec wants to merge 1 commit into
Open
Conversation
Previously, when viewing a pull request merged with a merge commit, Forge would fails to calculate a diff for the changes that were merged. This prevents quickly reviewing the diff of changes that were merged by pressing "d d" on the pull request, a common and helpful workflow. The root issue is forge--pullreq-range used by the diff commands looks at the pull request's base branch name, and compares the pull request HEAD commit to the *current* commit at the base branch. After the PR is merged, the merge commit will provide a common ancestor for both, leading to the empty diff. This applies the same fix applied in commit a3cf64d to forge--insert-pullreq-commits, which uses the cached base ref retrieved from the server, which represents the commit at the base branch *at the time the PR was open*. This should produce consistent diffs that line up with the commits listed in the topic buffer.
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.
Previously, when viewing a pull request merged with a merge commit, Forge would fails to calculate a diff for the changes that were merged. This prevents quickly reviewing the diff of changes that were merged by pressing "d d" on the pull request, a common and helpful workflow.
The root issue appears to be that
forge--pullreq-rangeused by the diff commands looks at the pull request's base branch name, and compares the pull request HEAD commit to the current commit at the base branch. After the PR is merged, the merge commit will provide a common ancestor for both, leading to the empty diff.This applies the same fix applied in commit a3cf64d to
forge--insert-pullreq-commits, which uses the cached base ref retrieved from the server, which represents the commit at the base branch at the time the PR was open. This should produce consistent diffs that line up with the commits listed in the topic buffer.