A command line tool to help manage projects using the Developer Certificate of Origin contributor workflow.
To install:
gem install dco
To enable auto-sign-off for all commits in a repository:
cd /my/repository
dco enable
The dco enable
command turns on auto-sign-off for all future commits in a
repository. This means any commit message that does not have Signed-off-by:
will have the declaration added. This is equivalent to always using git commit -s
even in git tools that do not support it.
The auto-sign-off is implemented using a commit-msg
hook to rewrite the log
message as needed. Unlike git alias commit "commit -s"
, this will work with
any Git interface, including GUIs and IDE integration.
The dco disable
command turns off auto-sign-off, removing the hook script
created by dco enable
.
The dco sign
command retroactively applies the sign-off commit message to
every commit in a branch. By default it will update the current branch, but you
can provide a branch name via dco sign BRANCH
. If you want to use something other
than master
as the base branch, pass --base BRANCH
.
This can also be used to sign-off a branch on the behalf of another contributor.
You must provide a link to a public declaration that the user is agreeing to the
DCO: dco sign --behalf 'https://github.com/me/myproject/pulls/1#issuecomment-238042611'
.
When signing on the behalf of another user, you will get a comment like:
Signed-off-by: Alan Smithee <[email protected]>
Sign-off-executed-by: Commiter McCommiterface <[email protected]>
Approved-at: https://github.com/me/myproject/pulls/1#issuecomment-238042611
The dco check
verifies the DCO sign-off for all commits in a branch. By default
it also checks that the sign-off for each commit matches that commit's author.
Development sponsored by Bloomberg.
Copyright 2016, Noah Kantrowitz
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.