Browse code

Merge pull request #3493 from SvenDowideit/commit-signoff-location

give more specific advice on setting up signing

Guillaume J. Charmes authored on 2014/01/09 08:04:00
Showing 1 changed files
... ...
@@ -129,12 +129,27 @@ d. I understand and agree that this Project and the contribution are publicly kn
129 129
 e. I hereby grant to the Project, Docker, Inc and its successors;  and recipients of software distributed by the Project a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, modify, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute this contribution and such modifications and derivative works consistent with this Project, the open source license indicated in the previous work or other appropriate open source license specified by the Project and approved by the Open Source Initiative(OSI) at http://www.opensource.org.
130 130
 ```
131 131
 
132
-then you just add a line saying
132
+then you just add a line to every git commit message:
133 133
 
134 134
     Docker-DCO-1.0-Signed-off-by: Joe Smith <joe.smith@email.com> (github: github_handle)
135 135
 
136 136
 using your real name (sorry, no pseudonyms or anonymous contributions.)
137 137
 
138
+One way to automate this, is customise your get ``commit.template`` by adding
139
+the following to your ``.git/hooks/prepare-commit-msg`` script (needs 
140
+``chmod 755 .git/hooks/prepare-commit-msg`` ) in the docker checkout:
141
+
142
+```
143
+   #!/bin/sh
144
+   #       Auto sign all commits to allow them to be used by the Docker project.
145
+   #       see https://github.com/dotcloud/docker/blob/master/CONTRIBUTING.md#sign-your-work
146
+   #
147
+   GH_USER=$(git config --get github.user)
148
+   SOB=$(git var GIT_AUTHOR_IDENT | sed -n "s/^\(.*>\).*$/Docker-DCO-1.0-Signed-off-by: \1 \(github: $GH_USER\)/p")
149
+   grep -qs "^$SOB" "$1" || echo "\n$SOB" >> "$1"
150
+
151
+```
152
+
138 153
 If you have any questions, please refer to the FAQ in the [docs](http://docs.docker.io)
139 154
 
140 155