39 | | == Conventions == |
40 | | |
41 | | All ''patches'', regardless of their type need to be created following a few rules: |
42 | | |
43 | | * Must be sent as unified diff (diff -u) or preferably generated by ''git format-patch'' |
44 | | * Patches must have a short but descriptive one-line summary of the change, followed by a more descriptive text explaining in plain English why and how the patch is written. This description should ''not'' be too technical, as the patch itself will reveal technical details. More on [http://who-t.blogspot.com/2009/12/on-commit-messages.html writing good commit messages here] |
45 | | * Patches should contain a 'Signed-off-by:' line at the end (git commit --signoff). If missing, it will be added with the sender of the patch as the signed-off person. |
| 39 | OpenVPN 2.4 uses the Allman style: |
| 40 | |
| 41 | * Indentation is 4 spaces, no tabs ever. |
| 42 | * Opening and closing brackets get their own line, and must match indentation. |
| 43 | * Line length is 80 characters. |
| 44 | * C99 is allowed. E.g. for (int i = 0; i < max; i++). |
| 45 | * Only use /* */-style comments |
| 46 | |
| 47 | Full documentation of the 2.4 style is on the [wiki:CodeStyle CodeStyle] page. |
| 48 | |
| 49 | == Commit message == |
| 50 | |
| 51 | Patches must have a short but descriptive one-line summary of the change, followed by a more descriptive text explaining in plain English why and how the patch is written. This description should ''not'' be too technical, as the patch itself will reveal the technical details. The patch should also conform to these rules (adapted from [http://chris.beams.io/posts/git-commit/#seven-rules here]): |
| 52 | |
| 53 | * Separate subject from body with a blank line |
| 54 | * Limit the subject line to 50 characters |
| 55 | * '''NOTE:''' this limit is under discussion |
| 56 | * Capitalize the subject line |
| 57 | * Do not end the subject line with a period |
| 58 | * Use the imperative mood in the subject line |
| 59 | * Wrap the body at 72 characters |
| 60 | * '''NOTE:''' this limit is under discussion |
| 61 | * Use the body to explain "what" and "why" |
| 62 | |
| 63 | In addition |
| 64 | |
| 65 | * Patches should contain a 'Signed-off-by:' line at the end (git commit --signoff). |