sapling
sapling copied to clipboard
ReviewStack showing incorrect diff when bottom PR is updated
trafficstars
Description of bug
Diffing breaks in reviewstack when only one PR in a stack is resubmitted
Steps to Reproduce
- Create a stack with "PR 1" and "PR 2" with any changes
- Rebase PR 1 onto a new base (updated main perhaps)
sl pr submiton PR 1- View PR 2 in review stack, observe that the changes from main are included (even though PR 1/2 don't touch those files).
Possible Solutions
- When any PR in a stack is updated, the whole stack should be resubmitted automatically (otherwise it leads to incorrect diff view)
- When showing the changes of PR 2 in ReviewStack, it should not be diffed against the most recent version of PR1, but rather the version it was submitted with
Fix 2 seems preferred given it doesn't require resubmitting the whole stack to change one piece, not sure on technical limitations.
@bolinfest Do you know if we can use the parent commit of PR 2 instead of PR 1 as "base" in this case?
Another side effect of this that I think we ran into is that if PR 1/2 are accepted, and you merge PR 1 then merge PR 2 (or perhaps just merge PR 2?) you end up without the updates to PR 1. Maybe PR 2 should also not be allowed to merge if not updated with the changes below it?