1

There can be multiple patch-set in a given gerrit commit. Is it possible to create diff.patch from the difference of two specific patch-set of this same commit?

I need this because I made changes on top of patch-set 3 and by the time I pushed my changes patch-set 4 was already in. Now my changes are part of patch-set 5 and patch-set 4 changes are lost. Currently I am manually identifying changes and fixing :(

gaurav
  • 86
  • 6

1 Answers1

1

It is very easy to do this using the Gerrit UI. For example use the below link to examine the change: https://gerrit-review.googlesource.com/c/gerrit/+/253332/4..5

Select a different patch set:

enter image description here

You can select the patch sets you would like to compare in the drop down box.

enter image description here

Alternatively, if you prefer to do this from the command line you can download the individual patchsets and do a diff. Below I create branches with names to represent the patch sets. However, you can also run the diff using the SHA-1 of the patchsets.

git fetch "https://gerrit.googlesource.com/gerrit" refs/changes/32/253332/4 && git branch b253332-4 FETCH_HEAD
git fetch "https://gerrit.googlesource.com/gerrit" refs/changes/32/253332/5 && git branch b253332-5 FETCH_HEAD
git diff  b253332-4..b253332-5
uncletall
  • 6,609
  • 1
  • 27
  • 52