Skip to content

Commit

Permalink
chore: DCO (#706)
Browse files Browse the repository at this point in the history
Part of #508
  • Loading branch information
iliapolo committed Oct 4, 2021
1 parent f9095c1 commit b9acbe1
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -232,6 +232,13 @@ release. Therefore please following these guidelines to the letter:
- If this is a breaking change, the last paragraph should describe the
breaking change with the prefix `BREAKING CHANGE: xxxxxx`.

#### Developer Certificate Of Origin (DCO)

Every commit should be signed-off in compliance with the [Developer Certificate Of Origin](./DCO).
You can sign your commits by using the `git commit -s` command.

> To configure automatic signoff, see [git-hooks](./git-hooks/README.md).
## Documentation

Documentation is rendered from markdown using
Expand Down
34 changes: 34 additions & 0 deletions DCO
@@ -0,0 +1,34 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
9 changes: 9 additions & 0 deletions git-hooks/README.md
@@ -0,0 +1,9 @@
# Git Hooks

This directory contains git hooks that the core team uses for various tasks.

- Commit signoff for automatic compliance of the [DCO](../CONTRIBUTING.md#developer-certificate-of-origin-dco).

## Setup

To setup these git hooks, run `./git-hooks/setup.sh` from the root directory of the project.
18 changes: 18 additions & 0 deletions git-hooks/prepare-commit-msg
@@ -0,0 +1,18 @@
#!/bin/sh

NAME=$(git config user.name)
EMAIL=$(git config user.email)

if [ -z "$NAME" ]; then
echo "empty git config user.name"
exit 1
fi

if [ -z "$EMAIL" ]; then
echo "empty git config user.email"
exit 1
fi

git interpret-trailers --if-exists doNothing --trailer \
"Signed-off-by: $NAME <$EMAIL>" \
--in-place "$1"
10 changes: 10 additions & 0 deletions git-hooks/setup.sh
@@ -0,0 +1,10 @@
#!/bin/bash

##############################################
# Setup shared .git hooks for this project.
#

hooksdir="$(cd $(dirname $0) && pwd)"

git config core.hooksPath ${hooksdir}
echo "Configured core.hooksPath to ${hooksdir}"

0 comments on commit b9acbe1

Please sign in to comment.