This page documents how to use Git with the Asterisk project.
- Submitters cannot +2 a change without a +1
- Submitters cannot +2 a change that they +1'd, when they are the only person who put a +1 on a review
- Topics should be the ASTERISK issue (if available)
- All cherry-picks must use the same topic (-t option)
- All testsuite tests should use the same topic as the underlying Asterisk changes (-t option)
- Cherry picks can be done after a +2, but the code change must not be submitted until all branches have cherry-picks
- Don't use
For basic instructions on using Gerrit with the Asterisk project, see Gerrit Usage.
Patches being submitted to the project must be cherry-picked to other branches when either:
- The patch is a bug fix. In this case, the patch should be cherry-picked to all supported branches that have the bug.
The patch is a new feature or improvement, and tests have been written to cover the new feature or improvement. In that case, the patch may be submitted to other supported branches.
Cherry-picking can be done either when a patch is first proposed, or it may be done when the patch has been reviewed but prior to it being submitted. If you plan on cherry-picking after an initial review, please indicate so in a comment on the review.
Cherry-Picking in Gerrit
If your patch applies cleanly to a branch, you can cherry-pick directly in Gerrit. On your review, select the Cherry-Pick button:
In the resulting dialog, enter the branch you want to cherry-pick to, then select Cherry Pick Change.
If the change merges cleanly, a new review will be opened with your cherry-picked change. If the change could not be merged, and error will appear and you will need to use one of the manual methods listed below.
If you have already submitted a patch for review, you may cherry pick to a new branch using
As an example, if we previously posted for review a code change for Asterisk 11, and the Gerrit Review ID is 30, we might use the following for Asterisk 13:
You may cherry pick using
git cherry-pick as well. When performing the cherry-pick using git, make sure that the
Change-Id header is the same between all branches.
As an example, if we committed the following to Asterisk 13:
We could then cherry pick this back to Asterisk 11 using the following:
The resulting commit must have the same Change-Id as the Asterisk 13 commit for Gerrit to recognize that this is a cherry-picked commit:
When posting it for review to Gerrit, you should also use the same topic as the original patch. Generally, this is the ASTERISK issue.