Skip to content

Commit

Permalink
docs: added DCO explanations + how to sign off
Browse files Browse the repository at this point in the history
Signed-off-by: Ethan Perruzza <ethan.perruzza@gmail.com>
  • Loading branch information
EthanPERRUZZA committed Sep 5, 2024
1 parent 1300496 commit 8ba0d1a
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
title: "Commit style"
linkTitle: "Commit style"
title: "Commit conventions"
linkTitle: "Commit conventions"
weight: 4
description: "A few advises and rules about commit messages"
---

## Commit style

The overall format for git commits is as follows:

```
Expand Down Expand Up @@ -46,4 +48,32 @@ Welcome to ease review, but do not merge:
- `fixup! previous commit`: an [autosquash](../share-changes) must be run before the merge
- `Revert "previous commit of the same PR"`: both commits must be dropped before merging

## The Developer Certificate of Origin (DCO)

All of OSRD's projects use the DCO (Developer Certificate of Origin) to address
legal matters. The DCO helps confirm that you have the rights to the code you
contribute. For more on the history and purpose of the DCO, you can read [The
Developer Certificate of Origin](https://bssw.io/blog_posts/the-developer-certificate-of-origin)
by Roscoe A. Bartlett.

To comply with the DCO, **all commits must include a Signed-off-by line**.

### How to sign a commit using git in a shell ?

To sign off a commit, simply add the `-s` flags to your `git commit` command,
like so:

```bash
git commit -s -m "Your commit message"
```
This also applies when using the `git revert` command.

### How to do sign a commit using git in Visual Studio Code (VS Code) ?

Now, go in `Files` -> `Preferences` -> `Settings` and search for **Always Sign
Off**. (This only has to be done once per repository.)

Finally, when you'll commit your changes via the VS Code interface, your commits
will automaticaly be signed-off.

*[Continue towards sharing your changes ‣]({{< ref "share-changes">}})*
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
title: "Style des commits"
linkTitle: "Style des commits"
title: "Conventions de commits"
linkTitle: "Conventions de commits"
weight: 4
description: "Quelques bonnes pratiques et règles pour les messages de commits"
---

## Style de commits

Le format général des commits est le suivant :

```
Expand Down Expand Up @@ -45,4 +47,34 @@ Bienvenus pour faciliter la relecture, mais ne pas merger:
- `fixup! previous commit` : un [autosquash](../share-changes) devra être lancé avant le merge
- `Revert "previous commit of the same PR"` : les deux commits devront être retirés avant merge

## Le Developer Certificate of Origin (DCO)

Tous les projets d'OSRD utilisent le DCO (certificat du développeur d'orgine)
pour des raisons légales. Le DCO permet de confirmer que vous avez les droits
sur le code que vous contribuez. Pour en savoir plus sur l'histoire et
l'objectif du DCO, vous pouvez lire [The Developer Certificate of Origin](https://bssw.io/blog_posts/the-developer-certificate-of-origin)
de Roscoe A. Bartlett.

Pour se conformer au DCO, **tous les commits doivent inclure une ligne
Signed-off-by**.

### Comment signer un commit avec Git dans un terminal ?

Pour signer un commit, il suffit d'ajouter l'option `-s` à votre commande `git
commit`, comme ceci :

```bash
git commit -s -m "Your commit message"
```
Cela s'applique également lors de l'utilisation de la commande `git revert`.

### Comment signer un commit avec Git dans Visual Studio Code (VS Code) ?

Allez dans `Fichiers` -> `Préférences` -> `Paramètres`, puis recherchez
**Always Sign Off**. (Cette configuration ne doit être faite qu'une seule fois
par dépôt git.)

Ensuite, lorsque vous ferez un commit via l'interface de VS Code, ils seront
automatiquement signés.

*[Continuer vers le partage des changements ‣]({{< ref "share-changes">}})*

0 comments on commit 8ba0d1a

Please sign in to comment.