Overview
This page documents how to use Git with the Asterisk project.
Proposed Policies
- Submitting
- 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
-R
.
Gerrit
Instructions
Branch Cherry-Picking
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 using git review
If you have already submitted a patch for review, you may cherry pick to a new branch using git review
:
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:
Cherry-Picking using git cherry-pick
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.
Mirrors