Pārlūkot izejas kodu

Merge pull request #7380 from tiborvass/merge-7368

Accept vanilla Linux Foundation signoffs (Closes 7368)
Michael Crosby 11 gadi atpakaļ
vecāks
revīzija
bec676e2de
3 mainītis faili ar 8 papildinājumiem un 20 dzēšanām
  1. 6 8
      CONTRIBUTING.md
  2. 0 10
      contrib/prepare-commit-msg.hook
  3. 2 2
      hack/make/validate-dco

+ 6 - 8
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:
 Then you just add a line to every git commit message:
 
 
-    Docker-DCO-1.1-Signed-off-by: Joe Smith <joe.smith@email.com> (github: github_handle)
+    Signed-off-by: Joe Smith <joe.smith@email.com>
 
 
 Using your real name (sorry, no pseudonyms or anonymous contributions.)
 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
 #### Small patch exception
 
 

+ 0 - 10
contrib/prepare-commit-msg.hook

@@ -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"

+ 2 - 2
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-]+'
 githubUsernameRegex='[a-zA-Z0-9][a-zA-Z0-9-]+'
 
 
 # https://github.com/docker/docker/blob/master/CONTRIBUTING.md#sign-your-work
 # 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() {
 check_dco() {
 	grep -qE "$dcoRegex"
 	grep -qE "$dcoRegex"