I understand that Gerrit receives git commits (using the update
hook perhaps), and write them on a fake ref somewhere until the peer review is done, but how exactly does that process work in terms of the technical implementation? And what Git commands are involved?
Gerrit is a web-based code review tool, which is integrated with Git and built on top of Git version control system (helps developers to work together and maintain the history of their work). It allows merging changes to Git repository when you are done with the code reviews.
The Gerrit UI includes a download link in the Gerrit Code Review Screen to make it easy for reviewers to fetch a branch for a specific change. To manually verify a change, a reviewer must have the Verified permission. Then, the reviewer can fetch and checkout that branch from Gerrit.
You might reference the magic reference refs/for/<branch ref>
which is used by user when pushing new commits.
To create new changes for review, simply push to the project’s magical
refs/for/'branch'
ref using any Git client tool:
git push ssh://sshusername@hostname:29418/projectname HEAD:refs/for/branch
E.g.
john.doe
can use git push to upload new changes for theexperimental
branch of projectkernel/common
, hosted at thegit.example.com
Gerrit server:
git push ssh://[email protected]:29418/kernel/common HEAD:refs/for/experimental
Each new commit uploaded by the git push client will be converted into a change record on the server.
The remote refrefs/for/experimental
is not actually created by Gerrit, even though the client’s status messages may say otherwise.
Technically, this is managed by the cmd-receive-pack.
Invoked by 'git push' and updates the project's repository with the information fed from the 'git push' end.
It is implemented by gerrit/sshd/commands/Receive.java
, which receives change upload over SSH using the Git receive-pack protocol.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With