Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compare two non-sequential pull request updates in VSTS?

Tags:

azure-devops

In VSTS (now Azure DevOps), multiple updates can be pushed to a pull request (PR). You can compare any update with its previous update, and you can compare a rolled-up view of all updates with the original code before any changes were made. But how do I compare two arbitrary, non-sequential updates?

My scenario is that a PR has had quite a bit of back-and-forth with a total of 8 updates pushed. I last reviewed update 5, but now 3 more updates exist. I don't want to review 6-5, 7-6, 8-7 or all updates, I just want to review 8-5. How do I do that?

like image 756
prlcutting Avatar asked Sep 14 '18 13:09

prlcutting


People also ask

How do you compare changes in Azure DevOps?

You can also press Shift and then double-click the file. Or, right-click the file and select Compare with Latest Version to compare your changes to the latest version of the file on Azure DevOps Server. The Diff window appears. You can continue to make changes to the file in this window.

How do I compare two branches in Azure repository?

From your web browser, open the team project for your Azure DevOps organization. In the Repos > Branches view, select the ellipsis for any branch and choose Compare branches to open the Branch compare view. In the Branch compare view, choose the two branches that you want to compare.

How do I compare two DevOps branches?

Update your compare branch to see how far ahead or behind your branches shown on the page are to another branch in your repo: Select the ... next to the branch you want to set as the baseline for comparison. Select Set as compare branch.


1 Answers

A workaround (in the absence of any user interface to configure two non-sequential updates to be compared) is to edit the iteration=xxxand base=xxx query string parameters in the url, e.g.:

https://xxx.visualstudio.com/xxx/_git/xxx/pullrequest/123?iteration=8&base=5&_a=files

This updates the UI as shown below:

VSTS diff of two non-sequential updates

I discovered this because I received an automated email from VSTS notifying me about the latest pushed updates. The email included a "View pull request" button. I clicked the button which took me to the PR in VSTS (I think to the Overview section). There was a notification banner towards the top of the page with a link about comparing update 5 with update 8 which I had never seen before. This sounded promising, so I clicked the link and it took me to the Files section and showed the differences between update 5 and 8 which is exactly what I wanted!

However, subsequent visits to the page (or clicking the "View pull request" button in the email again) don't show that link again, and I can't find anywhere in the UI that lets me define the two updates to compare. So this seems like a one-time opportunity. Miss it, and it's gone forever. I'd still like to know if there's a way to define two non-sequential updates to be compared in the UI, however, the poor man's url hack is a viable workaround for now.

like image 85
prlcutting Avatar answered Nov 24 '22 03:11

prlcutting