Quantcast
Channel: Adam Young's Web Log
Viewing all articles
Browse latest Browse all 468

What changed in that latest patch?

$
0
0

Gerrit is great, but one thing it does not do well is tell you the differences in an update to a review request. Here’s how I found I could focus review requests to just the deltas between submissions.

I’m going to use one of my own patch submissions as an example.

As you can see, Dolph had significant comments on version 7 of the patch. I made a lot of changes, and submitted version 8.

If you want to see what the differences are, you can do so using your own git repository. After cloning the original project, you can use the git lines for each of the patches. It is posted on the change request next to the word Download. I recommend using the “checkout option” and then naming the new branch using a description of the change and the revision number.

Change 7 is

git fetch https://review.openstack.org/openstack/keystone refs/changes/82/17782/7 && git checkout FETCH_HEAD
git checkout -b module-cleanup-patch7

Change 8 is

git fetch https://review.openstack.org/openstack/keystone refs/changes/82/17782/8 && git checkout FETCH_HEAD
git checkout -b module-cleanup-patch8

Now, personally, I find that the git difftool technique of opening each individual file is too slow and clunky. Here’s an improvement.

To generate a diff between the two patches:

 git diff module-cleanup-patch7 module-cleanup-patch8

While Rob Crittenden is amazing in his ability to do a code review from just a patch, I personally find it easier to use a graphical diff tool. I tend to use Kompare. If you use the -o option, it will take a patch and compare it with the underlying file system. Using a dash as the file name makes it read from standard input.

git diff module-cleanup-patch7 module-cleanup-patch8 | kompare -o -

Here’s what it produces:

Clicking through the file list on the left shows the changes in the panel on the right.


Viewing all articles
Browse latest Browse all 468

Latest Images

Trending Articles





Latest Images