How to update patches with dependent changes 84/9384/5
authorThanh Ha <thanh.ha@linuxfoundation.org>
Sun, 11 Mar 2018 05:06:12 +0000 (00:06 -0500)
committerJessica Wagantall <jwagantall@linuxfoundation.org>
Mon, 12 Mar 2018 20:18:06 +0000 (20:18 +0000)
Add details on how to update patches that have dependent
changes in Gerrit.

Issue: https://jira.opendaylight.org/browse/DOCS-21
Change-Id: Id4cd47bcb6e6aee08ae64a2d6e19153e14c3c5f4
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
docs/gerrit.rst

index 2b05a47..266f449 100644 (file)
@@ -312,6 +312,32 @@ You will receive 2 emails from Gerrit Code Review: the first indicating that a b
 to incorporate your changes has started; and the second indicating the creation of the
 build.
 
+Update a patch with dependent changes
+=====================================
+
+In the case where a patch depends on another in review Gerrit patch, we will
+need to rebase the commit against the latest patchset of the dependent change
+in Gerrit. The best way to do this is to retrieve the latest version of the
+dependent change and then cherry-pick our patch on top of the change.
+
+#. Fetch latest parent patch set
+
+   .. code-block:: bash
+
+      git review -d <parent-gerrit-id>
+
+#. Cherry-pick out patch on top
+
+   .. code-block:: bash
+
+      git review -x <patch-gerrit-id>
+
+#. Push patch back up to Gerrit
+
+   .. code-block:: bash
+
+      git review -R
+
 Code Review
 ===========