|
| 1 | +# Contributing |
| 2 | + |
| 3 | +## Coding Style |
| 4 | + |
| 5 | +Try and adhere to the [kernel coding style](https://www.kernel.org/doc/html/latest/process/coding-style.html) with the exception of using 4 spaces instead of 8 for indentation. |
| 6 | + |
| 7 | +## Reporting Bugs |
| 8 | + |
| 9 | +Open an issue. Please include as much code / logging / output / information as |
| 10 | +possible to help diagnose your issue. |
| 11 | + |
| 12 | +## Proposing Changes |
| 13 | + |
| 14 | +Open a pull request using a branch based on **master**. Read the [branches |
| 15 | +section](#branches) for an overview of the workflow. |
| 16 | + |
| 17 | +If it's a major change, open an issue to gauge interest before putting in too |
| 18 | +much effort. |
| 19 | + |
| 20 | +The following subsections inspired by the [git patch guidelines](https://github.com/git/git/blob/master/Documentation/SubmittingPatches). |
| 21 | + |
| 22 | +### Commits |
| 23 | + |
| 24 | +Make separate commits for logically separate changes |
| 25 | + |
| 26 | +The title for the commit should start with the file or subsection it is |
| 27 | +changing. |
| 28 | + |
| 29 | +Give an explanation for the change(s) that is detailed enough so that people |
| 30 | +can judge if it is good thing to do, without reading the actual patch text to |
| 31 | +determine how well the code does what the explanation promises to do. |
| 32 | + |
| 33 | +If your description starts to get too long, that's a sign that you probably |
| 34 | +need to split up your commit to finer grained pieces. That being said, patches |
| 35 | +which plainly describe the things that help reviewers check the patch, and |
| 36 | +future maintainers understand the code, are the most beautiful patches. |
| 37 | +Descriptions that summarize the point in the subject well, and describe the |
| 38 | +motivation for the change, the approach taken by the change, and if relevant |
| 39 | +how this differs substantially from the prior version, are all good things to |
| 40 | +have. |
| 41 | + |
| 42 | +### Basing your branch |
| 43 | + |
| 44 | +In general, always base your work on the oldest branch that your change is |
| 45 | +relevant to. |
| 46 | + |
| 47 | +- A bugfix should be based on **master** in general. For a bug that's not yet |
| 48 | + in **master**, find the topic that introduces the regression, and base your |
| 49 | + work on the tip of the topic. |
| 50 | + |
| 51 | +- A new feature should be based on **master** in general. If the new feature |
| 52 | + depends on a topic that is in **test**, but not in **master**, base your |
| 53 | + work on the tip of that topic. |
| 54 | + |
| 55 | +* Corrections and enhancements to a topic not yet in **master** should be based |
| 56 | + on the tip of that topic. If the topic has not been merged to **next**, it's |
| 57 | + alright to add a note to squash minor corrections into the series. |
| 58 | + |
| 59 | +* In the exceptional case that a new feature depends on several topics not in |
| 60 | + **master**, start working on **next** or **test** privately and send out |
| 61 | + patches for discussion. Before the final merge, you may have to wait until |
| 62 | + some of the dependent topics graduate to **master**, and rebase your work. |
| 63 | + |
| 64 | +To find the tip of a topic branch, run `git log --first-parent master..test` |
| 65 | +and look for the merge commit. The second parent of this commit is the tip of |
| 66 | +the topic branch. |
| 67 | + |
| 68 | +## Branches |
| 69 | + |
| 70 | +Usage inspired by the [git branch workflow](https://github.com/git/git/blob/master/Documentation/howto/maintain-git.txt). |
| 71 | + |
| 72 | +### master |
| 73 | + |
| 74 | +- All new features and changes should be based on this branch |
| 75 | +- Is meant to be more stable than any tagged releases, and users are encouraged |
| 76 | + to follow it |
| 77 | +- Tagged for releases |
| 78 | + |
| 79 | +### next |
| 80 | + |
| 81 | +- Used to publish changes (both enhancements and fixes) that (1) have |
| 82 | + worthwhile goal, (2) are in a fairly good shape suitable for everyday use, |
| 83 | + (3) but have not yet demonstrated to be regression free. |
| 84 | +- Contains all new proposed changes for the next release |
| 85 | +- Users are encouraged to use it to test for regressions and bugs before they |
| 86 | + get merged for release |
| 87 | +- Periodically rebased on to **master**, usually after a tagged release |
| 88 | + |
| 89 | +### test |
| 90 | + |
| 91 | +- Branch is used to publish other proposed changes that do not yet pass the |
| 92 | + criteria set for **next**. |
| 93 | +- Contains all seen proposed feature / enhancement requests |
| 94 | +- Most unstable branch |
| 95 | +- Regularly rebased on to **master** |
| 96 | + |
| 97 | +### [initials]/[branch-name] |
| 98 | + |
| 99 | +- Name based on the author's initials and topic of the branch. For example |
| 100 | + *mc/fix-bug-in-foo* |
| 101 | +- Based on **master**, unless it requires code from another feature, in which |
| 102 | + case base it on that feature branch |
| 103 | +- Contains a proposed feature / enhancement / bug fix wanting to be merged |
| 104 | +- It will first get merged into **test**, then **next**, and finally **master** |
| 105 | + when it's ready |
| 106 | + |
| 107 | +## Versioning |
| 108 | + |
| 109 | +Version numbers follow [Semantic Versioning](https://semver.org/). |
0 commit comments