From 386f9035825b4183f1cd370f3db4a0a6bcf01687 Mon Sep 17 00:00:00 2001 From: Anirudh Oppiliappan Date: Fri, 23 May 2025 14:20:05 +0300 Subject: [PATCH] docs: add DCO info and tips on signing-off commits Signed-off-by: Anirudh Oppiliappan --- docs/contributing.md | 54 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/docs/contributing.md b/docs/contributing.md index 3933030..7630a4e 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -77,3 +77,57 @@ In the description, explain: We'll use the issue thread to discuss and refine the idea before moving forward. + +## developer certificate of origin (DCO) + +We require all contributors to certify that they have the right to +submit the code they're contributing. To do this, we follow the +[Developer Certificate of Origin +(DCO)](https://developercertificate.org/). + +By signing your commits, you're stating that the contribution is your +own work, or that you have the right to submit it under the project's +license. This helps us keep things clean and legally sound. + +To sign your commit, just add the `-s` flag when committing: + +```sh +git commit -s -m "your commit message" +``` + +This appends a line like: + +``` +Signed-off-by: Your Name +``` + +We won't merge commits if they aren't signed off. If you forget, you can +amend the last commit like this: + +```sh +git commit --amend -s +``` + +If you're submitting a PR with multiple commits, make sure each one is +signed. + +For [jj](https://jj-vcs.github.io/jj/latest/) users, you can add this to +your jj config: + +``` +ui.should-sign-off = true +``` + +and to your `templates.draft_commit_description`, add the following `if` +block: + +``` + if( + config("ui.should-sign-off").as_boolean() && !description.contains("Signed-off-by: " ++ author.name()), + "\nSigned-off-by: " ++ author.name() ++ " <" ++ author.email() ++ ">", + ), +``` + +Refer to the [jj +documentation](https://jj-vcs.github.io/jj/latest/config/#default-description) +for more information. -- 2.51.2