vscode-pull-request-github
vscode-pull-request-github copied to clipboard
Pull request diff shows outdated diff
- Accidentally push lines containing debug logs with the actual fix into a commit in a dev branch. Do not push.
- Start creating a pull request, but check the diff. Notice the debug logs are in the diff.
- Run
git reset --soft HEAD~in the terminal. Unstage the lines containing the debug logs using the SCM diff view. - Commit with the same commit message again by pressing the up arrow in the SCM commit message inputbox to get the last message.
- Start creating a pull request again, but check the diff.
- :bug: The debug logs are still in the diff.
- Create a draft PR and check the diff.
- :bug: The debug logs are still in the diff. GitHub shows the correct diff.
This is weird. I could repro, but then after some time, with no intervention from me, it sopped reproing. We get the file contents from the built in git extension, and I think that it had stale state somehow.
Nope, issue was that the file system provider didn't show that the modified time had changed.
I can still reproduce Steps 7 and 8. The pre-PR diff is now good, but the after-PR diff still shows outdated changes.
- Run git reset --soft HEAD~ in the terminal. Unstage the lines containing the debug logs using the SCM diff view.
This means that you still have the debug log changes in your workspace. You just unstaged and didn't do a checkout.
The PR diff when you create a PR shows the state of the file in your working tree on the right.