| 1 |
CONTENTS |
| 2 |
Sending Patches |
| 3 |
Patching Process |
| 4 |
Email Format |
| 5 |
Coding Style |
| 6 |
Options |
| 7 |
Various Notes |
| 8 |
Standards Compliance |
| 9 |
|
| 10 |
Sending Patches |
| 11 |
|
| 12 |
* send your patches to the mailing list (see ../README) or by |
| 13 |
github.com pull request. |
| 14 |
|
| 15 |
* email is accepted as an inline patch with, or without, a git pull |
| 16 |
request. Pull request emails need to include the patch set for review |
| 17 |
purposes. See howto-pull-request.txt and ../README for git repository |
| 18 |
instructions. |
| 19 |
|
| 20 |
* email attachments are difficult to review and not recommended. |
| 21 |
Hint: use git send-email. |
| 22 |
|
| 23 |
* one patch per email. |
| 24 |
See Email Format. |
| 25 |
|
| 26 |
* many small patches are preferred over a single large patch. Split |
| 27 |
patch sets based upon logical functionality. For example: #endif mark |
| 28 |
ups, compiler warnings, and exit code fixes should all be individual |
| 29 |
small patches. |
| 30 |
|
| 31 |
* don't include generated (autotools) files in your patches. |
| 32 |
Hint: use 'git clean -Xd'. |
| 33 |
|
| 34 |
* don't include po/ (translations) changes to the upstream patches. |
| 35 |
The po/ stuff is maintained on https://translationproject.org/domain/util-linux.html |
| 36 |
and updated always before the next release. |
| 37 |
|
| 38 |
* neutrality: the files in util-linux should be distribution-neutral. |
| 39 |
Packages like RPMs, DEBs, and the rest, are not provided. They should |
| 40 |
be available from the distribution. |
| 41 |
|
| 42 |
Repositories & Branches |
| 43 |
|
| 44 |
* Primary repository is on kernel.org: |
| 45 |
git clone git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git |
| 46 |
|
| 47 |
* Backup repository at github.com: |
| 48 |
git clone https://github.com/util-linux/util-linux.git |
| 49 |
|
| 50 |
We use this repository to backup kernel.org and for PULL REQUESTS, |
| 51 |
issues tracking. The master and stable branches are always pushed to |
| 52 |
the both repositories in the same time. |
| 53 |
|
| 54 |
It's recommended to use github.com for development. |
| 55 |
|
| 56 |
* Branches: |
| 57 |
|
| 58 |
master - continuous development |
| 59 |
stable/vX.Y - stable releases |
| 60 |
|
| 61 |
Since version 2.40, the "master" branch remains continuously open and is |
| 62 |
never subjected to feature freezes. The stabilization process for |
| 63 |
the upcoming release is exclusively conducted within the "stable/" branches. |
| 64 |
Upon branching from "master" to "stable/vX.Y," a new tag vX.Y+1-devel |
| 65 |
is generated to serve as placeholder for git-based versioning (refer to |
| 66 |
tools/git-version-gen). Subsequently, changes specific to the new release |
| 67 |
(such as po/ updates) are selectively cherry-picked from "stable/vX.Y" to |
| 68 |
"master" after the final release. |
| 69 |
|
| 70 |
Patching Process |
| 71 |
|
| 72 |
* announce it on the mailing list when you are going to work with some |
| 73 |
particular piece of code for a long time. This helps others to avoid |
| 74 |
massive merge conflicts. Small or quick work, does not need to be |
| 75 |
announced. |
| 76 |
|
| 77 |
* make sure that after applying your patch the file(s) will compile |
| 78 |
without errors. |
| 79 |
|
| 80 |
* test that the previously existing program behavior is not altered. If |
| 81 |
the patch intentionally alters the behavior explain what changed, and |
| 82 |
the reason for it, in the changelog/commit message. |
| 83 |
|
| 84 |
* only submit changes that you believe are ready to merge. To post a |
| 85 |
patch for peer review only, state it clearly in the email and use |
| 86 |
the Subject: [PATCH RFC] ... |
| 87 |
|
| 88 |
* incorporate reviewer comments in the patches. Resubmitting without |
| 89 |
changes is neither recommended nor polite. |
| 90 |
|
| 91 |
* resubmission can be partial or complete. If only a few alterations are |
| 92 |
needed then resubmit those particular patches. When comments cause a |
| 93 |
greater effect then resubmit the entire patch set. |
| 94 |
|
| 95 |
* When resubmitting use the email Subject: [PATCH v2] ... |
| 96 |
Hint: use the --subject-prefix='PATCH v2' option with 'git format-patch' |
| 97 |
|
| 98 |
* using a git repository for (re)submissions can make life easier. |
| 99 |
See howto-pull-request.txt and ../README. |
| 100 |
|
| 101 |
* all patch submissions are either commented, rejected, or accepted. |
| 102 |
If the maintainer rejects a patch set it is pointless to resubmit it. |
| 103 |
|
| 104 |
Email Format |
| 105 |
|
| 106 |
* Subject: [PATCH] subsystem: description. |
| 107 |
|
| 108 |
* Start the message body with an explanation of the patch, that is, a |
| 109 |
changelog/commit entry. |
| 110 |
|
| 111 |
* if someone else wrote the patch, they should be credited (and |
| 112 |
blamed) for it. To communicate this, add a line like: |
| 113 |
|
| 114 |
From: John Doe <[email protected]> |
| 115 |
|
| 116 |
* add a Signed-off-by line. |
| 117 |
Hint: use git commit -s |
| 118 |
|
| 119 |
The sign-off is a simple line at the end of the explanation for the |
| 120 |
patch; which certifies that you wrote it or otherwise have the |
| 121 |
right to pass it on as an open-source patch. The rules are pretty |
| 122 |
simple; if you can certify the following: |
| 123 |
|
| 124 |
By making a contribution to this project, I certify that: |
| 125 |
|
| 126 |
(a) The contribution was created in whole or in part by me and I |
| 127 |
have the right to submit it under the open source license |
| 128 |
indicated in the file; or |
| 129 |
|
| 130 |
(b) The contribution is based upon previous work that, to the best |
| 131 |
of my knowledge, is covered under an appropriate open source |
| 132 |
license and I have the right under that license to submit that |
| 133 |
work with modifications, whether created in whole or in part |
| 134 |
by me, under the same open source license (unless I am |
| 135 |
permitted to submit under a different license), as indicated |
| 136 |
in the file; or |
| 137 |
|
| 138 |
(c) The contribution was provided directly to me by some other |
| 139 |
person who certified (a), (b) or (c) and I have not modified |
| 140 |
it. |
| 141 |
|
| 142 |
(d) I understand and agree that this project and the contribution |
| 143 |
are public and that a record of the contribution (including |
| 144 |
all personal information I submit with it, including my |
| 145 |
sign-off) is maintained indefinitely and may be redistributed |
| 146 |
consistent with this project or the open source license(s) |
| 147 |
involved. |
| 148 |
|
| 149 |
Then you just add a line like: |
| 150 |
|
| 151 |
Signed-off-by: Random J Developer <[email protected]> |
| 152 |
|
| 153 |
Use your real name (sorry, no pseudonyms or anonymous contributions.) |
| 154 |
|
| 155 |
* Next a single line beginning with three hyphen-minus characters (---) |
| 156 |
and nothing else. |
| 157 |
|
| 158 |
* Followed by the unified diff patch. |
| 159 |
|
| 160 |
Note: the mailing list will reject certain content. See ../README. |
| 161 |
|
| 162 |
Coding Style |
| 163 |
|
| 164 |
* the preferred coding style is based on the linux kernel coding-style. |
| 165 |
Available here: |
| 166 |
|
| 167 |
https://docs.kernel.org/process/coding-style.html |
| 168 |
|
| 169 |
* use 'FIXME:' with a good description, if you want to inform others |
| 170 |
that something is not quite right, and you are unwilling to fix the |
| 171 |
issue in the submitted change. |
| 172 |
|
| 173 |
* do not use `else' after non-returning functions. For |
| 174 |
example: |
| 175 |
|
| 176 |
if (this) |
| 177 |
err(EXIT_FAIL, "this failed"); |
| 178 |
else |
| 179 |
err(EXIT_FAIL, "that failed"); |
| 180 |
|
| 181 |
Is wrong and should be written: |
| 182 |
|
| 183 |
if (this) |
| 184 |
err(EXIT_FAIL, "this failed"); |
| 185 |
err(EXIT_FAIL, "that failed"); |
| 186 |
|
| 187 |
* when you use 'if' short-shorthand make sure it does not wrap into |
| 188 |
multiple lines. In case the shorthand does not look good on one line |
| 189 |
use the normal "if () else" syntax. |
| 190 |
|
| 191 |
* To avoid whitespace errors, consider installing an EditorConfig plugin |
| 192 |
(https://editorconfig.org/) into your favorite editor or IDE. |
| 193 |
|
| 194 |
Options |
| 195 |
|
| 196 |
* The rule of thumb for options is that once they exist, you may not |
| 197 |
change them, nor change how they work, nor remove them. |
| 198 |
|
| 199 |
* The following options are well-known, and should not be used for any |
| 200 |
other purpose: |
| 201 |
|
| 202 |
-h, --help display usage and exit |
| 203 |
-V, --version display version and exit |
| 204 |
|
| 205 |
* Some commands use peculiar options and arguments. These will continue |
| 206 |
to be supported, but anything like them will not be accepted as new |
| 207 |
additions. A short list of examples: |
| 208 |
|
| 209 |
Characters other than '-' to start an option. See '+' in 'more'. |
| 210 |
|
| 211 |
Using a number as an option. See '-<number>' in 'more'. |
| 212 |
|
| 213 |
Long options that start with a single '-'. See 'setterm'. |
| 214 |
|
| 215 |
'-?' is not a synonym for '--help', but is an unknown option |
| 216 |
resulting in a suggestion to try --help due to a getopt failure. |
| 217 |
|
| 218 |
Various Notes |
| 219 |
|
| 220 |
* util-linux does not use kernel headers for file system super |
| 221 |
blocks structures. |
| 222 |
|
| 223 |
* patches relying on kernel features that are not in Linus Torvalds's |
| 224 |
tree are not accepted. |
| 225 |
|
| 226 |
Standards Compliance |
| 227 |
|
| 228 |
Some of the commands maintained in this package have Open Group |
| 229 |
requirements. These commands are: |
| 230 |
|
| 231 |
cal |
| 232 |
col |
| 233 |
ipcrm |
| 234 |
ipcs |
| 235 |
kill |
| 236 |
line |
| 237 |
logger |
| 238 |
mesg |
| 239 |
more |
| 240 |
newgrp |
| 241 |
pg |
| 242 |
renice |
| 243 |
|
| 244 |
If you change these tools please make sure it does not create a conflict |
| 245 |
with the latest standard. For example, it is not recommended to add |
| 246 |
short command line options before they are part of the standard. |
| 247 |
Introducing new long options is acceptable. |
| 248 |
|
| 249 |
The Single UNIX(TM) Specification, Version 2 |
| 250 |
Copyright (C) 1997 The Open Group |
| 251 |
|
| 252 |
https://pubs.opengroup.org/onlinepubs/7908799/xcuix.html |
| 253 |
|