1 Backporting changes for OpenAFS
2 ===============================
4 This page describes the procedure for contributing code changes to the OpenAFS
5 stable release series. Generally, only security fixes, bug fixes, and
6 non-disruptive features are accepted on stable branches.
8 Contributions to the OpenAFS code base are generally first targeted to the git
9 `master` branch, which is considered the in-progress development branch. These
10 changes will be included in a future release when the OpenAFS release team
11 creates a stable branch point for a new major release. Changes for the current
12 stable branches generally require a backporting process. This is intended to
13 reduce the chance of losing important changes between the branches.
15 OpenAFS contributions are submitted to and reviewed on the [gerrit][1] review
16 system. See [[GitDevelopers]] for information on submitting changes to gerrit.
17 Note that unlike most git based projects, OpenAFS developers have adopted a
18 linear commit history. Merge commits are generally avoided, and developers
19 generally run git rebase frequently before submitting changes to gerrit.
21 An optional set of wrapper scripts called [[GitGerrit]] are available to search
22 gerrit from command line, fetch commits by the legacy gerrit number, and to
23 assist in cherry picking commits to stable branches.
25 Master branch inclusion
26 -----------------------
28 Generally, changes are accepted on a stable branch only after they have
29 been merged onto the master branch. Follow the instructions on
30 [[GitDevelopers]] for information on how to submit changes to the master
34 Stable branch backport
35 ----------------------
37 Once a change has been merged on the master branch, the change may be submitted
38 to gerrit for the most recent stable branch (currently `openafs-stable-1_8_x`).
40 The change should be cherry-picked from the master branch (not gerrit). For
41 changes which consist of multiple commits, each commit must be cherry-picked in
42 the same order in which they were merged onto the master branch.
44 When cherry-picking commits, be sure to use the `-x` option so git will include
45 the commit number in the new commit message, and use the `-e` option to open an
46 editor during the cherry-pick to remove the Change-ID of the master branch
52 git checkout origin/openafs-stable-1_8_x
53 git cherry-pick -e -x origin/master~<number>
54 <remove old Change-Id in the editor>
57 <verify a new Change-Id has been added.>
59 Run `git commit --amend` immediately after each cherry-pick to verify the
60 cherry-pick command has a new Change-ID.
62 Alternately, the [[GitGerrit]] git-gerrit-cherry-pick tool can be used to
63 cherry pick by gerrit number and will automatically update the Change-Id
64 in the commit message:
69 git checkout origin/openafs-stable-1_8_x
70 git gerrit-cherry-pick <gerrit-number>
72 In the event the cherry-pick fails, due to code skew between the branches,
73 it may be necessary to manually fix the merge conflict and run `git cherry-pick --continue`
74 to complete the cherry pick. In this case, the `(cherry picked from commit...)`
75 line will be missing and has to be added manually using `git commit --amend`.
77 After building and testing, the commit can be submitted to gerrit for the
82 git push gerrit HEAD:refs/for/openafs-stable-1_8_x
84 Old Stable branch backport
85 --------------------------
87 Once a change has been merged to the stable branch, the change may be submitted
88 to gerrit for the old stable branch (currently `openafs-stable-1_6_x`).
90 Cherry pick the commit from the stable branch, not master, and not from gerrit.
95 git checkout origin/openafs-stable-1_6_x
96 git cherry-pick -e -x origin/openafs-stable-1_8_x~<number>
98 Example with [[GitGerrit]]:
101 git checkout origin/openafs-stable-1_6_x
102 git gerrit-cherry-pick <gerrit-number> --branch origin/openafs-stable-1_8_x
104 In the event the cherry-pick fails, due to code skew between the branches,
105 it may be necessary to manually fix the merge conflict and run `git check-pick --continue`
106 to complete the cherry pick. In this case, the `(cherry picked from commit...)`
107 line will be missing and has to be added manually using `git commit --amend`.
109 After building and testing, the commit can be submitted to gerrit for the
114 git push gerrit HEAD:refs/for/openafs-stable-1_6_x
116 Avoiding Path Conflicts
117 -----------------------
119 Due to the way gerrit is configured, it may claim that one of your commits has a "Merge conflict" if it modifies any file that also has changes in other gerrits under review for that branch. That's even true if the changes are completely independent, and a cherry-pick does not flag any conflicts.
121 Before submitting, check the other open gerrits for that branch for modifications to the same files you are modifying. If you find any, please base your change on top of those open changes before submission.
123 Alternatively, help get the "conflicting" change merged (or abandoned) before pushing your commit.
125 Your efforts in avoiding "Merge conflicts" in this way will make the life of the release manager/guardian/gatekeeper in charge of your change significantly easier. Thank you!
128 [1]: https://gerrit.openafs.org/