git-conventions.md
-
* fix * doc(end2end): detail test users * doc(all): update docker tag update docker image name from 0.2.0 to 0.3.0 use "docker compose" everywhere instead of "docker-compose" improve table of content fix layout * doc(all): improve docs add logo to readme add table of content rewording complete * doc(all): fix typos
* fix * doc(end2end): detail test users * doc(all): update docker tag update docker image name from 0.2.0 to 0.3.0 use "docker compose" everywhere instead of "docker-compose" improve table of content fix layout * doc(all): improve docs add logo to readme add table of content rewording complete * doc(all): fix typos
Duniter git conventions
TL;DR summary of this page, workflow instructions
The summary gives an overview of the rules described below. Reading it will help you to dive into the details.
- draft work must be prefixed by "WIP" (work in progress)
- the naming of final commits must comply with the template
type(scope): action subject
- one should communicate with developers through dedicated spaces
- integrating a contribution can only be done via a merge request on our gitlab option and since the following critera are fullfilled
- branch up to date with
master
branch (except hotfixes, see the hotfix section) - idiomatic code formatting, automated tests passed successfully
- clean commit history, understandable and concise
- contribution approved by a reviewer
- branch up to date with
Naming commits
Every commit must comply with conventional commit specification v1.0.0.
The commit name has to be meaningful in the context of commit history reread. It should not make reference to a specific MR or discussion. Among other, commit history is used in changlogs and to track the project progress, that's why it has to be self-explanatory. If you have a new need, please contact the main developers to add a type together.
Update strategy
We only use rebases, merges are strictly fordbidden !
Every time the master
branch is updated, you must rebase each of your working branch on it. For each of them:
- Go on your branch
- Rebase on master with
git rebase master
- If you see conflicts, fix them by editing the sources. Once it is done, you must:
- commit the files that were in conflict
- continue the rebase with
git rebase --continue
- Keep doing until you don't have any more conflict after
git rebase --continue
.
To prevent accidental merge commits, we recommend to force the --ff-only
option on the merge command:
git config --global merge.ff only
When to push
Ideally, you should push when you are about to shut down your computer, so about once a day.
You must prefix your commit with wip:
when it is a work in progress.
But why push if I am not done ?
Pushing is no big deal and prevents you from loosing work in case of any problem with your material.
Before requesting proofreading of your merge request
After complying with the above criteria in your commits, you should check that your branch is up to date with the target branch (master
in this example). As this branch is moving forward frequently, it is possible that new commits may have occurred while you were working on your branch (named YOUR_BRANCH, here). If this is the case or in case of doubt, to update your branch with respect to master
, do the following: