New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display two-dot diff variant in PR "Files changed" #3027
Comments
I’m not entirely sure I understand the difference yet, but I think:
Can you point to a real PR that shows the issue rather than a made-up one? |
The biggest difference is that what you're comparing in the PR view is not the current code so basing the decision to merge code into the repo by comparing it here is inaccurate. This was committed on Jan 2nd and adds the When reviewing a newer PR from the same person, I was confused because I recalled we had already fixed this: The PR shows the left panel from the point in time they forked the repo and is not accurate to what you're reviewing to merge, it just shows what they changed it from without regard to what you're about to merge it into. This is a fairly innocuous example but it's happened a few times and extrapolated out for much larger commits on PRs with hundreds of files and it becomes a major issue (to me, perhaps I'm missing something most others seem to know?). The "Update branch" button does not work in this situation because it's a contributor's fork that we don't have write access to. We can request them to update their branch, but as soon as you merge in other PRs (assuming they modify the same files as other PRs), then you're right back in the same situation, as we were with multiple contributors submitting PHP 7.4 updates. I don't think the feature would need to actually do the diff itself, but just show the corresponding lines from the current file. The lines may not match up if the file has been drastically modified since the PR head, but if was scrollable or expandable like GH's is, that would be sufficient and/or it could be improved over time to be more accurate. If the extension can fetch the raw versions of the files, as it's on the same domain, there shouldn't be a CORS issue, but off-hand I'm not sure what extension restrictions are for fetching content from same-domain urls. I know this is a heavy feature and most likely violates your Rule 4 and I considered hacking something together to do this but figured it would benefit more people if it was in more suitable hands. |
That's incorrect, or should be incorrect. By default, GitHub suggests giving write access to the branch — but they can also remove this access. That is bad practice and hostile to those you're sending a PR to. We have a feature that specifically suggests avoiding this.
That sounds pretty unsafe. If I removed 10 lines, the diff will completely off and will make even less sense. I understand the problem, but this isn't something we can fix in a lightweight way, safely. |
As they suggested:
This is what our "Update branch" does and that's why the requester should give give write access. |
No problem, thank you for the discussion. I'll look for alternatives and/or tightening up our contributing guidelines. Closing this issue. |
Based off this discussion, a major shortcoming is that GitHub is showing the three-dot diff for PRs instead of the two-dot diff.
From Matt at GitHub Support:
Why this is a problem
Proposed Solution
When viewing the "Files changed", if the PR references an ancestor commit, Refined GitHub adds a button to show the two-dot diff (current base diffed with PR head) and grabs the raw view of each file (within a reasonable limit) and replaces(?) the current view (or a tab/toggle) that shows the same lines as displayed in the PR's change.
Feature URL Location
https://github.com/YourOrg/SomeProject/pull/123/files
The text was updated successfully, but these errors were encountered: