DCS: Comparing Content Changes Across Commits, Branches, Releases & Forks

Using DCS (git.door43.org), there is a way to compare what has changed between multiple commits, branches, release tags or forks of the same repo, but it’s not too easy to find and you may have to copy and paste to construct the URL. Below you will learn how to get to this page and how to modify the URL to fit your needs.

The “New Pull Request” page is the Compare Page

With that said, there is a button and an interface to at least get you to the page that allows you to compare changes. The compare changes page is only shown when you want to make a pull request, but it isn’t necessary to actually make a pull request.

To get there, go your repo’s home page on DCS, such as https://git.door43.org/unfodlingWord/en_tn, and click the “New Pull Request” button next to the branch dropdown (see image below). You can leave the branch in the dropdown as “master” if you want as that will make the compare page load faster as there is nothing yet to compare:

Screen Shot 2020-09-10 at 4.41.45 PM

This takes you to the “New Pull Request” page which you can actually use to compare any reference, as you will see below. The user interface here is limited though, allowing you only to select the branches in this repo and, if it is a forked repo, the other forks from the dropdowns:

As you will notice, changing either dropdown changes the URL at the top.

Here you can see one can compare any branch of the unfoldingword/en_tn repo and its forks, such as richmahn:test (which is the test branch of my fork of the en_tn repo). If your repo isn’t a fork or doesn’t have any forks, you shouldn’t see any branch names prefixed with the user or org name.

More than just banches

The above should be enough to compare branches, but what if you want to compare other reference types: individual commits and release tags? What if you want to mix and match those as well as branches? You can do so by editing the URL and putting your desired references before and after the ... in the URL.

As you can see from the above compare example, the URL format is like this:

https://git.door43.org/<owner>/<repo>/compare/<older ref>...<newer ref>

The last part of the URL is where you give it the reference you want to start from, <older ref>, and the reference of the final change, <newer ref>, separated by ....

Here are some examples with the different reference types:

All changes made from a given commit up to the current commit in the master branch, or another commit:

https://git.door43.org/unfoldingWord/en_ta/compare/aa3bbbfe91…master

To get the commit ID (SHA1), find it in the commit history (change the branch if not in master) of the repo and then copy and pasted it into the <older ref> part of the URL. Put master, or any branch/reference, as the <newer ref>. You can also compare between two commits by also putting a commit ID as the <newer ref> as well to see what changed between the two:

https://git.door43.org/unfoldingWord/en_ta/compare/aa3bbbfe91…86cd754a51

All changes between two tags (releases):

https://git.door43.org/unfoldingword/en_ta/compare/v10…v13

These tags can be found on the repo’s releases page or by clicking the “tags” tab when making a branch/tag selection on any Files page for the repo:

Using the tag name as the reference allows you to see what exactly changed between releases, even non-consecutive releases, such as in the above example which is comparing between v10 and v13.

All changes between a tag and master (or any other branch):

https://git.door43.org/unfoldingword/en_ta/compare/v13…master

All changes between branches of different forks:

https://git.door43.org/richmahn/en_ta/compare/master…unfoldingword:master

Listing Only the Files that Changed

If you want just a listing of what files have changed between the two references, you can do so on the same page that gives you all the individual changes. This list is hidden by default. Once you are viewing the changes between two references, below the list of commits and above the individual file comparison, you will see a dropdown titled “Diff Options”. From it select “Show Stats”:

You will then see the list of files changed between the commit list and the diff list: