From 7b9bdd154b5af2b3ef230450693cff4193cdc9c1 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Sat, 18 Dec 2021 15:47:12 +0100 Subject: [PATCH] docs: added sign-off guide to CONTRIBUTING.md This should help contributors, which are not familiar with DCOs. Fixes #1919 Signed-off-by: Philip Molares Signed-off-by: Tilman Vatteroth Signed-off-by: Philip Molares --- CONTRIBUTING.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c09f121e5..06bd5742b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,9 +67,52 @@ If you can certify it, then just add a line to every git commit message: Use your real name (sorry, no pseudonyms or anonymous contributions). -If you set your `user.name` and `user.email` git configs, you can sign your commit automatically with `git commit -s`. -You can also use git [aliases](https://git-scm.com/book/tr/v2/Git-Basics-Git-Aliases) -like `git config --global alias.ci 'commit -s'`. Now you can commit with `git ci` and the commit will be signed. +### How to sign-off commits + +The sign-off message can either be added by hand to your commit message or automatically by git. + +This is accomplished by using the `-s` or `--signoff` option on your regular commit command. + +e.g. +```bash +git commit -s +``` +or +```bash +git commit --signoff +``` + +This will use the name and email you configured in git. + +Find out how you can change your name and email in this guide from [GitHub](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/setting-your-commit-email-address#setting-your-commit-email-address-in-git) + +#### How to amend a sign-off + +The last commit on any given branch can be amended to include the sign-off message like this: + +```bash +git commit --amend --signoff +``` + +#### Amend a sign-off to multiple commits + +Assuming you have the upstream hedgedoc repo as `upstream`: + +Run `git fetch upstream` to get the latest content from the upstream repository +and then use `git rebase --signoff upstream/master` or `git rebase --signoff upstream/develop` +to rebase all commits in your current branch, that are different from upstream you try to merge with, and sign them off. + +If you've already pushed these commits to GitHub, you'll need to force push your branch after this with `git push --force-with-lease`. + +## Changelog snippets + +PRs that fix a bug or add a new feature or enhancement should add a corresponding changelog entry. +The changelog can be found at `public/docs/release-notes.md`. If there is no section for the next release yet, just add +one using `## 1.x.x UNRELEASED`. The version and date will +be filled later by the maintainers. +Add a short description for your change in the `Features`, `Enhancements` or `Bugfixes` section, creating the section +if needed. Have a look at previous entries for inspiration. +You are welcome to add a `(by [@your_username](https://github.com/your_username))` note to your entry. ## Submitting a Pull Request