|
Packit |
51d0f7 |
How to Submit Patches to the NetLabel Tools Project
|
|
Packit |
51d0f7 |
===============================================================================
|
|
Packit |
51d0f7 |
https://github.com/netlabel/netlabel_tools
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
This document is intended to act as a guide to help you contribute to the
|
|
Packit |
51d0f7 |
NetLabel Tools project. It is not perfect, and there will always be exceptions
|
|
Packit |
51d0f7 |
to the rules described here, but by following the instructions below you
|
|
Packit |
51d0f7 |
should have a much easier time getting your work merged with the upstream
|
|
Packit |
51d0f7 |
project.
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
* Test Your Code
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
Unfortunately, we do not have a test suite for the NetLabel Tools probject,
|
|
Packit |
51d0f7 |
but please test your code manually, as much as possible. Make sure it works on
|
|
Packit |
51d0f7 |
new systems, make sure it works on old systems. Try your best not to break
|
|
Packit |
51d0f7 |
anything, and if you break something, make sure you have a good reason, and
|
|
Packit |
51d0f7 |
make sure you tell us about it when you post your patch.
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
In addition to functional and regression testing, you should also verify that
|
|
Packit |
51d0f7 |
yoour patch is consistent with the formatting and coding style of the project.
|
|
Packit |
51d0f7 |
You can do this by running the following command:
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
# make check-syntax
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
... if there are any problems with your changes a diff/patch will be shown
|
|
Packit |
51d0f7 |
which indicates the problems and how to fix them.
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
* Generate the Patch(es)
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
Depending on how you decided to work with the code base and what tools you are
|
|
Packit |
51d0f7 |
using there are different ways to generate your patch(es). However, regardless
|
|
Packit |
51d0f7 |
of what tools you use, you should always generate your patches using the
|
|
Packit |
51d0f7 |
"unified" diff/patch format and the patches should always apply to the NetLabel
|
|
Packit |
51d0f7 |
Tools source tree using the following command from the top directory of the
|
|
Packit |
51d0f7 |
sources repository:
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
# patch -p1 < changes.patch
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
If you are not using git, stacked git (stgit), or some other tool which can
|
|
Packit |
51d0f7 |
generate patch files for you automatically, you may find the following command
|
|
Packit |
51d0f7 |
helpful in generating patches, where "netlabel_tools.orig/" is the unmodified
|
|
Packit |
51d0f7 |
source code directory and "netlabel_tools/" is the source code directory with
|
|
Packit |
51d0f7 |
your changes:
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
# diff -purN netlabel_tools.orig/ netlabel_tools/
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
When in doubt please generate your patch and try applying it to an unmodified
|
|
Packit |
51d0f7 |
copy of the NetLabel Tools sources; if it fails for you, it will fail for the
|
|
Packit |
51d0f7 |
rest of us.
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
* Explain Your Work
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
At the top of every patch you should include a description of the problem you
|
|
Packit |
51d0f7 |
are trying to solve, how you solved it, and why you chose the solution you
|
|
Packit |
51d0f7 |
implemented. If you are submitting a bug fix, it is also incredibly helpful
|
|
Packit |
51d0f7 |
if you can describe/include a reproducer for the problem in the description as
|
|
Packit |
51d0f7 |
well as instructions on how to test for the bug and verify that it has been
|
|
Packit |
51d0f7 |
fixed.
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
* Sign Your Work
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
The sign-off is a simple line at the end of the patch description, which
|
|
Packit |
51d0f7 |
certifies that you wrote it or otherwise have the right to pass it on as an
|
|
Packit |
51d0f7 |
open-source patch. The "Developer's Certificate of Origin" pledge is taken
|
|
Packit |
51d0f7 |
from the Linux Kernel and the rules are pretty simple:
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
Developer's Certificate of Origin 1.1
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
By making a contribution to this project, I certify that:
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
(a) The contribution was created in whole or in part by me and I
|
|
Packit |
51d0f7 |
have the right to submit it under the open source license
|
|
Packit |
51d0f7 |
indicated in the file; or
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
(b) The contribution is based upon previous work that, to the best
|
|
Packit |
51d0f7 |
of my knowledge, is covered under an appropriate open source
|
|
Packit |
51d0f7 |
license and I have the right under that license to submit that
|
|
Packit |
51d0f7 |
work with modifications, whether created in whole or in part
|
|
Packit |
51d0f7 |
by me, under the same open source license (unless I am
|
|
Packit |
51d0f7 |
permitted to submit under a different license), as indicated
|
|
Packit |
51d0f7 |
in the file; or
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
(c) The contribution was provided directly to me by some other
|
|
Packit |
51d0f7 |
person who certified (a), (b) or (c) and I have not modified
|
|
Packit |
51d0f7 |
it.
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
(d) I understand and agree that this project and the contribution
|
|
Packit |
51d0f7 |
are public and that a record of the contribution (including all
|
|
Packit |
51d0f7 |
personal information I submit with it, including my sign-off) is
|
|
Packit |
51d0f7 |
maintained indefinitely and may be redistributed consistent with
|
|
Packit |
51d0f7 |
this project or the open source license(s) involved.
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
... then you just add a line to the bottom of your patch description, with
|
|
Packit |
51d0f7 |
your real name, saying:
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
Signed-off-by: Random J Developer <random@developer.example.org>
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
* Email Your Patch(es)
|
|
Packit |
51d0f7 |
|
|
Packit |
51d0f7 |
Finally, you will need to email your patches to the mailing list so they can
|
|
Packit |
51d0f7 |
be reviewed and potentially merged into the main repository. When sending
|
|
Packit |
51d0f7 |
patches to the mailing list it is important to send your email in text form,
|
|
Packit |
51d0f7 |
no HTML mail please, and ensure that your email client does not mangle your
|
|
Packit |
51d0f7 |
patches. It should be possible to save your raw email to disk and apply it
|
|
Packit |
51d0f7 |
directly to the NetLabel Tools source code; if that fails then you likely have
|
|
Packit |
51d0f7 |
a problem with your email client. When in doubt try a test first by sending
|
|
Packit |
51d0f7 |
yourself an email with your patch and attempting to apply the emailed patch to
|
|
Packit |
51d0f7 |
the repository; if it fails for you, it will fail for the rest of us trying to
|
|
Packit |
51d0f7 |
test your patch.
|