Introduction to Gerrit principle

Code review can avoid many problems before the code is put on the library, or some low-level problems or design problems. The open source projects we are familiar with are git and linux insisting on code review. The source code cannot be privately modified and submitted to the project code, but need Send the patch email to the corresponding person in charge, and the person in charge will not merge until the review is passed. Gerrit is a tool for code review based on a web interface. A good tool is first to provide complete functions, and more importantly, to provide a set of convenient, fast, and efficient ways to use this function. Gerrit is such a good tool, it provides the function of code review, and at the same time facilitates the cooperation of developers, reviewers and project managers.

Gerrit is deployed on the code server. When the developer pushes the modification, he must first push the code to gerrit, and then the approver can approve it before it is actually put into the library. If the approval fails, comment on the modification for the developer to correct and revise. Then push again until the approval is passed.

图1.a central source repository

Figure 1 is a code server without Gerrit. Both developers and continuous integration pull or push code directly from the code server, which means that developers can directly modify the code on the server, which is not conducive to code review.

图2.Gerrit as the Central Repository

Figure 2 is a code server containing Gerrit. Both developers and continuous integration pull code directly from the code server. Modifications made by the developer are first submitted to the pending area for the approver to approve and comment. When the approver passes the approval , Before submitting to the central code server.

Official guide website: https://gerrit-review.googlesource.com/Documentation/

Guess you like

Origin blog.csdn.net/qq_36413391/article/details/110139450