|
1 | 1 | # Contribution Guide
|
2 | 2 |
|
3 |
| -- respect the [eccenca Git Working Policy](https://confluence.brox.de/display/ECCGMBH/Git+Working+Policy) |
4 |
| -- esp. use [Semantic Versioning](http://semver.org/) |
5 |
| -- use [Keep A Changelog's Format](http://keepachangelog.com/) |
| 3 | +tl;dr |
| 4 | + |
| 5 | +- use [Semantic Versioning](http://semver.org/) |
| 6 | +- use the [Keep A Changelog's Format](http://keepachangelog.com/) |
| 7 | +- respect the Ontology Modelling Guidelines (see below) |
| 8 | +- respect the Git Working Policy (see below) |
| 9 | + |
| 10 | +# Ontology Modelling Guidelines |
| 11 | + |
| 12 | +## Do not use construction with auxiliary verbs to form properties |
| 13 | + |
| 14 | +* Wrong: `mv:hasCapacity` |
| 15 | +* Correct: `mv:capacity` |
| 16 | + |
| 17 | +# Git Working Policy |
| 18 | + |
| 19 | +## Commits |
| 20 | + |
| 21 | +### Requirements |
| 22 | + |
| 23 | +Good commits serve at least these important purposes: |
| 24 | + |
| 25 | +* To speed up the reviewing process |
| 26 | +* To help us write a good release note |
| 27 | +* To help the future maintainers and developers to find out why a particular change was made to the code or why a specific feature was added |
| 28 | +* generate changelog automatically |
| 29 | + |
| 30 | +## Meta Data |
| 31 | + |
| 32 | +Please create commits with valid meta data only. This means, you have to configure your name and mail address like this: |
| 33 | + |
| 34 | +``` |
| 35 | +git config --global user.name "$name" |
| 36 | +git config --global user.email "$email" |
| 37 | +``` |
| 38 | + |
| 39 | +## Structure |
| 40 | + |
| 41 | +Format of the commit message |
| 42 | + |
| 43 | +``` |
| 44 | +<subject> |
| 45 | + |
| 46 | +<body> |
| 47 | + |
| 48 | +<footer> |
| 49 | +``` |
| 50 | + |
| 51 | +* subject: a short summary of changes |
| 52 | +* body: includes motivation for the change and contrasts with previous behavior |
| 53 | +* footer: referencing issues, breaking changes |
| 54 | + |
| 55 | +Example commit message |
| 56 | + |
| 57 | +``` |
| 58 | +a short (50 chars or less) summary of changes |
| 59 | + |
| 60 | +Body of the commit message, a more detailed explanatory text, if necessary. |
| 61 | +Wrap it to about 72 characters or so. In some contexts, the first |
| 62 | +line is treated as the subject of an email and the rest of the text |
| 63 | +as the body. The blank line separating the summary from the body is |
| 64 | +critical (unless you omit the body entirely); tools like rebase |
| 65 | +can get confused if you run the two together. |
| 66 | + |
| 67 | +Further paragraphs come after blank lines. |
| 68 | + |
| 69 | +- Bullet points are okay, too |
| 70 | +- a hyphen is used for the bullet, preceded by a single space, with blank lines in between |
| 71 | +``` |
| 72 | + |
| 73 | +## Style |
| 74 | + |
| 75 | +Basic recommendations are: |
| 76 | + |
| 77 | +* Write the subject line of what you have done in the imperative mode, that is as if you were commanding someone. |
| 78 | +* Write "fix", "add", "change" instead of "fixed", "added", "changed". |
| 79 | +* Don't end the subject line with a period - it's a title and titles don't end with a period. |
| 80 | +* Don't add parentheses or other stylish elements to the subject line. |
| 81 | +* Always leave the second line blank (the line between the subject line and the body) |
| 82 | +* Line break the commit message at about 72 chars (to make the commit message readable without having to scroll horizontally |
| 83 | +* Add a newline at the end of every document/file which is part of the repository |
| 84 | + |
| 85 | +A properly formed git commit subject line should always be able to complete the following sentence: |
| 86 | + |
| 87 | +* If applied, this commit will your subject line here |
| 88 | + |
| 89 | +For example: |
| 90 | + |
| 91 | +* If applied, this commit will `refactor subsystem X for readability` |
| 92 | +* If applied, this commit will `update getting started documentation` |
| 93 | +* If applied, this commit will `remove deprecated methods` |
| 94 | +* If applied, this commit will `release version 1.0.0` |
| 95 | +* If applied, this commit will `merge pull request #123 from user/branch` |
| 96 | + |
| 97 | +Notice how this doesn't work for the other non-imperative forms: |
| 98 | + |
| 99 | +* If applied, this commit will `fixed bug with Y` |
| 100 | +* If applied, this commit will `changing behavior of X` |
| 101 | +* If applied, this commit will `more fixes for broken stuff` |
| 102 | +* If applied, this commit will `sweet new API methods` |
| 103 | + |
| 104 | +Use of the imperative is important only in the subject line. You can relax this restriction when you're writing the body. |
| 105 | + |
| 106 | +If it seems difficult to summarize what your commit does, it may be because it includes several logical changes or bug fixes, and are better split up into several commits using `git add -p`. |
| 107 | + |
| 108 | +## Branching Model |
| 109 | + |
| 110 | +The branching model defines the basic workflow for different activities in the repository. These activities include: |
| 111 | + |
| 112 | +* add a new feature |
| 113 | +* fix a bug and provide this fix on different versions |
| 114 | +* prepare and release a version |
| 115 | + |
| 116 | +## Requirements |
| 117 | + |
| 118 | +* we want to use git describe in order to get valid version identifiers on every commit checkout |
| 119 | + * more accurate, we want to use `git describe --always --dirty` |
| 120 | +* we want to manage all of our versions with tags, including full versions, release candidates, customer specific versions ... |
| 121 | + |
| 122 | +## Feature Branches |
| 123 | + |
| 124 | +* Every new feature will be developed in its own feature branch off from develop |
| 125 | +* Each feature will follow this naming: feature/featureName (where feature name is some descriptive feature name, 2 words most, camel case) |
| 126 | +* Regularly push your work to the same named feature branch on the server |
| 127 | +* If you need newest changes from develop merge it into your feature branch using git merge --no-ff |
| 128 | +* Avoid cross-merging of other feature branches |
| 129 | +* CONVENTION: merge your feature branch into develop by opening a merge request using GitLab, see Code Reviews / Merge Requests |
| 130 | + * Always merge your feature branch into develop using git merge --no-ff |
| 131 | + * BEWARE: Do not execute git config --global --add merge.ff false! Once you have this parameter as a default, it will provoke merge commits even when updating a branch (pull). |
| 132 | + |
| 133 | +## Bugfix Branches |
| 134 | + |
| 135 | +* Same procedure as with feature branches. The only difference is the naming policy: |
| 136 | + * `bugfix/bugfixName` (where bugfix name is some descriptive name for the fixed problem, 2 words most, camel case) |
0 commit comments