Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DCO and commit-message.md #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions commit-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Guidelines to create great commit messages


We use [GitCop](https://gitcop.com) to check that commit messages are
properly written. The rules are the following:

* The first line of a commit message, called the subject line should
not be more than 80 characters long.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought it was supposed to be:

  • first line max 50 chars
  • all other lines, soft max of 72 chars (links break this, for example)

what does the git project use?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think GitHub warns at 50 characters for the subject but accepts more than that.
In fact I think it accepts anything when you push.

The guidelines for the Git project are 80 characters for everything I think (code, comments, commit messages).


* The commit message should end with the following trailers:

```
Licence: MIT
Signed-off-by: User Name <email@address>
```

where "User Name" is the author's real name and email@address one of
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe author's real (legal) name ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I will use that.

the author's valid email addresses.

These trailers mean that the author agrees with the following
document (which comes from http://developercertificate.org/):

[developer-certificate-of-origin](./developer-certificate-of-origin)

and with licensing the work under the MIT license available in the
following file:

[LICENSE](./LICENSE)

To help you automatically add these trailers, you can run the
following script:

[setup_commit_msg_hook.sh](./setup_commit_msg_hook.sh)

which will setup a Git commit-msg hook that will add the above
trailers to all the commit messages you write.
35 changes: 35 additions & 0 deletions developer-certificate-of-origin
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA

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.
13 changes: 13 additions & 0 deletions setup_commit_msg_hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

cat >.git/hooks/commit-msg <<'EOF'
#!/bin/sh

grep "^License:" "$1" || {
echo >>"$1"
echo "License: MIT" >>"$1"
echo "Signed-off-by: $(git config user.name) <$(git config user.email)>" >>"$1"
}
EOF
chmod +x .git/hooks/commit-msg