diff --git a/components/engine/CONTRIBUTING.md b/components/engine/CONTRIBUTING.md index 1d1daaf83e..7e190009f7 100644 --- a/components/engine/CONTRIBUTING.md +++ b/components/engine/CONTRIBUTING.md @@ -208,18 +208,16 @@ By making a contribution to this project, I certify that: Then you just add a line to every git commit message: - Docker-DCO-1.1-Signed-off-by: Joe Smith (github: github_handle) + Signed-off-by: Joe Smith Using your real name (sorry, no pseudonyms or anonymous contributions.) -One way to automate this, is customize your git `commit.template` by adding -a `prepare-commit-msg` hook to your Docker repository: +If you set your `user.name` and `user.email` git configs, you can sign your +commit automatically with `git commit -s`. -``` -curl -sSL -o .git/hooks/prepare-commit-msg https://raw.githubusercontent.com/docker/docker/master/contrib/prepare-commit-msg.hook && chmod +x .git/hooks/prepare-commit-msg -``` - -* Note: the above script expects to find your GitHub user name in `git config --get github.user` +Note that the old-style `Docker-DCO-1.1-Signed-off-by: ...` format is still +accepted, so there is no need to update outstanding pull requests to the new +format right away, but please do adjust your processes for future contributions. #### Small patch exception diff --git a/components/engine/contrib/prepare-commit-msg.hook b/components/engine/contrib/prepare-commit-msg.hook deleted file mode 100644 index c9389fb6d2..0000000000 --- a/components/engine/contrib/prepare-commit-msg.hook +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# Auto sign all commits to allow them to be used by the Docker project. -# see https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work -# -GH_USER=$(git config --get github.user) -SOB=$(git var GIT_AUTHOR_IDENT | sed -n "s/^\(.*>\).*$/Docker-DCO-1.1-Signed-off-by: \1 \(github: $GH_USER\)/p") -grep -qs "^$SOB" "$1" || { - echo - echo "$SOB" -} >> "$1" diff --git a/components/engine/hack/make/validate-dco b/components/engine/hack/make/validate-dco index 8f3bfc317a..1c75d91bfa 100644 --- a/components/engine/hack/make/validate-dco +++ b/components/engine/hack/make/validate-dco @@ -13,8 +13,8 @@ notDocs="$(validate_diff --numstat | awk '$3 !~ /^docs\// { print $3 }')" githubUsernameRegex='[a-zA-Z0-9][a-zA-Z0-9-]+' # https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work -dcoPrefix='Docker-DCO-1.1-Signed-off-by:' -dcoRegex="^$dcoPrefix ([^<]+) <([^<>@]+@[^<>]+)> \\(github: ($githubUsernameRegex)\\)$" +dcoPrefix='Signed-off-by:' +dcoRegex="^(Docker-DCO-1.1-)?$dcoPrefix ([^<]+) <([^<>@]+@[^<>]+)>( \\(github: ($githubUsernameRegex)\\))?$" check_dco() { grep -qE "$dcoRegex"