New Change ScreenIn this exercise you will do a code review in Gerrit and use the new Change Screen.The new Change Screen was introduced as optional replacement with Gerrit 2.8 and will replace the old one in 2.9.
PreparationSwitch on the new Change Screen
● Open the settings page
● Open the Preferences, change “Change View” to “New Screen” and save
Review the source code changes from GerritSteps:
● Look at the list of files. These are the files that were added, modified or deleted within this change.
● Click on a file name to open a page displaying the changes done in this file. The left side shows the “old version” and the right side shows the “new version” of the file. The diff is highlighted:
● If you want to comment on a source code line type ‘c’ and type in your comment:● You can also select a range in the source code before commenting in order to show the
scope of the comment
● You can also enter comments for the whole file● Click Save in order to save the (draft of) your comment
○ NOTE: the comments you create are not yet visible to anybody else but you. Only when you publish your comments they will become visible to everybody.
● Continue reviewing other files in the same way
Review the commit messageProviding a good commit message is as important as writing good code. A good commit message should describe why (the motivation) and not what. When months or years later you look at a change in your Git history you will easily see what was changed. However, only if the commit message was good we will know why this change was made.
Therefore, Gerrit also provides review of the commit message. It is done the same way as reviewing a file and the commit message appear at the top of the file list:
Edit the commit messageYou can now directly edit the commit message in Gerrit. Click on the “Edit Message” button and edit the message.
Click on save. Gerrit creates a new Patch Set.
Navigate between Patch Sets
The Patch Set navigation is now available under the drop down named “Revisions”.
Vote and Publish Comments● Click on the small arrow on the upper right to go back to the change.● Click the “Reply” button● Vote in the “Code Review” category
● Vote +1 in the “Verified” category. If you are running against http://git.eclipse.org/r/ the Verified vote will be done by a Hudson job which is verifying all changes pushed for review.
● Write the cover message and click the “Send” button:
You are done with the review!
Copyright © 2014 by C. Halstrick, E. Kempin, S. Lay, S. Zivkov, M. Sohn