3 *******************************
4 Getting a Patch Reviewed
5 *******************************
7 This section describes how to get FD.io VPP sources reviewed and merged.
12 If you don't have a Linux Foundation ID, `create one here. <https://identity.linuxfoundation.org/>`_
14 With your Linux Foundation ID credentials sign into `Gerrit Code Review at gerrit.fd.io <https://gerrit.fd.io/r/login/%23%2Fq%2Fstatus%3Aopen>`_
16 `Install git-review, <https://www.mediawiki.org/wiki/Gerrit/git-review>`_ which is a "command-line tool for Git / Gerrit to submit a change or to fetch an existing one."
18 If you're on Ubuntu, install keychain:
20 .. code-block:: console
22 $ sudo apt-get install keychain
27 To get FD.io VPP documents reviewed the VPP repository should be cloned with ssh. You should be logged into Gerrit Code Review as noted above.
29 Create your public and private ssh key with:
31 .. code-block:: console
35 $ cat ~/.ssh/id_rsa.pub
37 Copy **all** the contents of the public key (id_rsa.pub) output by the above **cat** command. Then go to your `SSH Public keys settings page <https://gerrit.fd.io/r/#/settings/ssh-keys>`_, click **Add Key ...**, paste your public key, and finally click **Add**.
46 .. code-block:: console
48 $ git clone ssh://gerrit.fd.io:29418/vpp
51 This will only work if the name of the user on your system matches your Gerrit username.
53 Otherwise, clone with:
55 .. code-block:: console
57 $ git clone ssh://YOUR_GERRIT_USERNAME@gerrit.fd.io:29418/vpp
60 When attempting to clone the repo it will ask if you want to add the Server Host Key to the list of known hosts. Type **yes** and hit enter.
65 The VPP documents use the gerrit server and git review for submitting and fetching patches.
71 When working with new patch use the following to get your patch reviewed.
73 Make sure you have modified the correct files with:
75 .. code-block:: console
80 Then add and commit the patch. You may want to add a tag to the commit comments.
81 For example for document only patches you should add the tag **DOCS:**.
83 .. code-block:: console
86 $ git commit -s -m "<*TAG*>: <*COMMIT_MESSAGE*>"
89 If you are creating a draft, meaning you do not want your changes reviewed yet, do the following:
91 .. code-block:: console
95 After submitting a review, reset where the HEAD is pointing to with:
97 .. code-block:: console
99 $ git reset --hard origin/master
102 -----------------------
104 The "change number" used below is in the URL of the review.
106 After clicking an individual review, the change number can be found in the URL at "https://gerrit.fd.io/r/#/c/<*CHANGE_NUMBER*>/"
108 To view an existing patch:
110 .. code-block:: console
112 $ git review -d <change number>
118 If you have made changes and do "git review -d <change number>", your current
119 changes will try to be stashed so that the working tree can change to the review branch
120 you specified. If you want to make sure you don't lose your changes, clone another Gerrit
121 repo into a new directory using the cloning steps shown in :ref:`clone-ssh`, and perform
122 "git review -d <change number>" in this new directory.
124 To modify an existing patch, make sure you modified the correct files, and apply the patch with:
126 .. code-block:: console
128 $ git review -d <change number>
136 When you're done viewing or modifying a branch, get back to the master branch with:
138 .. code-block:: console
140 $ git reset --hard origin/master
141 $ git checkout master
144 --------------------------------
146 If a change has a conflict it should be resolved with the following:git-review -d <Gerrit change #>
148 .. code-block:: console
150 $ git rebase origin/master
153 $ git rebase --continue