Skip to content

Commit 95b6c1c

Browse files
committed
all: add a CONTRIBUTING.md doc
Signed-off-by: Paul Moore <[email protected]>
1 parent a6096e2 commit 95b6c1c

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

CONTRIBUTING.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
How to Contribute to The SELinux Notebook
2+
===============================================================================
3+
https://github.com/SELinuxProject/selinux-notebook
4+
5+
This document is intended to act as a guide to help you contribute to the
6+
The SELinux Notebook. It is not perfect, and there will always be exceptions
7+
to the rules described here, but by following the instructions below you
8+
should have a much easier time getting your work merged with the upstream
9+
project.
10+
11+
## Make Sure Your Changes Render Correctly
12+
13+
The SELinux Notebook can be viewed in three different formats: Markdown, HTML,
14+
and PDF. Your changes need to render correctly in all three formats. The
15+
HTML and PDF formatted notebooks can be created using the included Makefile
16+
and Markdown can be viewed directly via the GitHub source browser or any
17+
number of Markdown viewers.
18+
19+
## Explain Your Work
20+
21+
At the top of every patch you should include a description of the change you
22+
are making as well as your motivation.
23+
24+
## Sign Your Work
25+
26+
The sign-off is a simple line at the end of the patch description, which
27+
certifies that you wrote it or otherwise have the right to pass it on as an
28+
open-source patch. The "Developer's Certificate of Origin" pledge is taken
29+
from the Linux Kernel and the rules are pretty simple:
30+
31+
Developer's Certificate of Origin 1.1
32+
33+
By making a contribution to this project, I certify that:
34+
35+
(a) The contribution was created in whole or in part by me and I
36+
have the right to submit it under the open source license
37+
indicated in the file; or
38+
39+
(b) The contribution is based upon previous work that, to the best
40+
of my knowledge, is covered under an appropriate open source
41+
license and I have the right under that license to submit that
42+
work with modifications, whether created in whole or in part
43+
by me, under the same open source license (unless I am
44+
permitted to submit under a different license), as indicated
45+
in the file; or
46+
47+
(c) The contribution was provided directly to me by some other
48+
person who certified (a), (b) or (c) and I have not modified
49+
it.
50+
51+
(d) I understand and agree that this project and the contribution
52+
are public and that a record of the contribution (including all
53+
personal information I submit with it, including my sign-off) is
54+
maintained indefinitely and may be redistributed consistent with
55+
this project or the open source license(s) involved.
56+
57+
... then you just add a line to the bottom of your patch description, with
58+
your real name, saying:
59+
60+
Signed-off-by: Random J Developer <[email protected]>
61+
62+
You can add this to your commit description in `git` with `git commit -s`
63+
64+
## Post Your Patches Upstream
65+
66+
The SELinux Notebook accepts both GitHub pull requests and patches sent via
67+
the SELinux developers mailing list. GitHub pull requests are preferred. The
68+
sections below explain how to contribute via either method. Please read each
69+
step and perform all steps that apply to your chosen contribution method.
70+
71+
### Submitting via Email
72+
73+
Depending on how you decided to work with the notebook sources and what
74+
tools you are using there are different ways to generate your patch(es).
75+
However, regardless of what tools you use, you should always generate your
76+
patches using the "unified" diff/patch format and the patches should always
77+
apply to the notebook source tree using the following command from the top
78+
directory of the notebook sources:
79+
80+
% patch -p1 < changes.patch
81+
82+
If you are not using git, stacked git (stgit), or some other tool which can
83+
generate patch files for you automatically, you may find the following command
84+
helpful in generating patches, where "selinux-notebook.orig/" is the unmodified
85+
source code directory and "selinux-notebook/" is the source code directory with your
86+
changes:
87+
88+
% diff -purN selinux-notebook.orig/ selinux-notebook/
89+
90+
When in doubt please generate your patch and try applying it to an unmodified
91+
copy of the notebook sources; if it fails for you, it will fail for the rest
92+
of us.
93+
94+
Finally, you will need to email your patches to the mailing list so they can
95+
be reviewed and potentially merged into the main notebook repository. When
96+
sending patches to the mailing list it is important to send your email in text
97+
form, no HTML mail please, and ensure that your email client does not mangle
98+
your patches. It should be possible to save your raw email to disk and apply
99+
it directly to the notebook sources; if that fails then you likely have
100+
a problem with your email client. When in doubt try a test first by sending
101+
yourself an email with your patch and attempting to apply the emailed patch to
102+
the notebook repository; if it fails for you, it will fail for the rest of
103+
us.
104+
105+
### Submitting via GitHub
106+
107+
See [this guide](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) if you've never done this before.

0 commit comments

Comments
 (0)