docs: Update contributing guide
[lttng-ust.git] / CONTRIBUTING.md
CommitLineData
e03d7c66
MJ
1<!--
2SPDX-FileCopyrightText: 2016 Philippe Proulx <pproulx@efficios.com>
3
4SPDX-License-Identifier: CC-BY-4.0
5-->
6
8f6a68ab
PP
7# LTTng-UST contributor's guide
8
9Being an open source project, the LTTng-UST project welcomes
10contributions from anyone. This guide walks you through the process
11of contributing a patch to LTTng-UST.
12
13
14## Getting the source code
15
16The LTTng-UST project uses [Git](https://git-scm.com/) for version
17control. The upstream Git repository URL is:
18
19 git://git.lttng.org/lttng-ust.git
20
21
22## Coding standard
23
24LTTng-UST uses the
eb038798 25[Linux kernel coding style](https://www.kernel.org/doc/html/latest/process/coding-style.html).
8f6a68ab
PP
26
27Although the LTTng-UST code base is primarily written in C, it does
28contain shell, Perl, and Python code as well. There is no official coding
29standard for these languages. However, using a style consistent with the
30rest of the code written in that language is strongly encouraged.
31
32
33## Creating and sending a patch
34
d6c33741
KS
35LTTng-UST's development flow is primarily based on
36[Gerrit Code Review](https://review.lttng.org/q/project:lttng-ust), although
37we also accept e-mail based patch series on the
38[`lttng-dev` mailing list](https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev)
39and pull requests on our [GitHub mirror](https://github.com/lttng/lttng-ust).
40If you're going to create GitHub pull requests, make sure you still follow the
8f6a68ab
PP
41guidelines below.
42
d6c33741
KS
43The mailing list is also used to share and comment on
44<abbr title="Request for Comments">RFC</abbr>s and answer
8f6a68ab
PP
45user questions.
46
d6c33741
KS
47Once your changes have been comitted to your local branch, you may use the
48[git-review](https://opendev.org/opendev/git-review) plugin to submit them
49dirrectly to [Gerrit](https://review.lttng.org) using the following command:
50
51 git review
52
53Please note that you will need to create an account on [Gerrit](https://review.lttng.org)
54and add an SSH public key.
55
56For e-mail based patches you may use Git's
57[`format-patch`](https://git-scm.com/docs/git-format-patch) command
8f6a68ab
PP
58to generate a patch file. The following command line generates a
59patch from the latest commit:
60
61 git format-patch -N1 -s --subject-prefix="PATCH lttng-ust"
62
63The custom `PATCH lttng-ust` subject prefix is mandatory when
64submitting patches that apply to the LTTng-UST project.
65
66The patch's subject (the commit message's first line) should:
67
68 * begin with an uppercase letter
69 * be written in the present tense
70 * _not_ exceed 72 characters in length
71 * _not_ end with a period
72 * be prefixed with `Fix:` if the commit fixes a bug
73
74The commit message's body should be as detailed as possible and explain
75the reasons behind the proposed change. Any related
76[bug report(s)](https://bugs.lttng.org/projects/lttng-ust/issues)
77should be mentioned at the end of the message using the `#123` format,
78where `123` is the bug number:
79
80 * Use `Refs: #123` if the patch is related to bug 123, but does not
81 fix it yet.
82 * Use `Fixes: #123` to signify that this patch fixes the bug.
83
84Make sure to **sign-off** your submitted patches (the `-s` argument to
85Git's `commit` and `format-patch` commands).
86
87Here's a complete example:
88
89~~~ text
90Fix: use this instead of that in some context
91
92Ball tip jowl beef ribs shankle, leberkas venison turducken tail pork
93chop t-bone meatball tri-tip. Tongue beef ribs corned beef ball tip
94kevin ground round sausage rump meatloaf pig meatball prosciutto
95landjaeger strip steak. Pork pork belly beef.
96
97Biltong turkey porchetta filet mignon corned beef. T-bone bresaola
98shoulder meatloaf tongue kielbasa.
99
100Fixes: #321
101Refs: #456
102Refs: #1987
103
104Signed-off-by: Jeanne Mance <jmeance@lttng.org>
105~~~
106
107Please note that patches should be **as focused as possible**. Do not,
108for instance, fix a bug and correct the indentation of an unrelated
109block of code as part of the same patch.
110
111Once you are confident your patch meets the required guidelines,
112you may use Git's [`send-email`](https://git-scm.com/docs/git-send-email)
113command to send your patch to the mailing list:
114
115 git send-email --suppress-cc=self --to lttng-dev@lists.lttng.org *.patch
116
117Make sure you are
118[subscribed](http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev)
119to the mailing list to follow and take part in discussions about your
120changes. You may join the file to an email as an attachment if you can't
121send the patch directly using <code>git&nbsp;send&#8209;email</code>.
122
123
124## Reviews
125
126Once your patch has been posted to the mailing list or as a GitHub
127pull request, other contributors may propose modifications.
128This is completely normal. This collaborative code review is an integral
129part of the open source development process in general and LTTng-UST
130makes no exception.
131
132Keep in mind that reviewing patches is a time-consuming process and,
133as such, may not be done right away. The delays may be affected by the
134current release cycle phase and the complexity of the proposed changes.
135If you think your patch might have been forgotten, please mention it on
136the [`#lttng`](irc://irc.oftc.net/lttng) IRC channel rather than
137resubmitting.
138
139
140## Release cycle
141
142The LTTng-UST project follows a release cycle that alternates between
143development and release candidate (RC) phases. The master branch is
144feature-frozen during RC phases: only bug fixes are accepted during
145this period. However, patches adding new functionality may still be
146submitted and reviewed during the RC. The upcoming features and release
147dates are posted in a monthly digest on the mailing list.
This page took 0.033158 seconds and 4 git commands to generate.