IP/Copyright requirements for Eclipse Foundation Projects
This page explains steps required to contribute code to the projects in the eclipse/deeplearning4j GitHub repository: https://github.com/eclipse/deeplearning4j
Contributors (anyone who wants to commit code to the repository) need to do two things, before their code can be merged:
- 1.Sign the Eclipse Contributor Agreement (once)
- 2.Sign commits (each time)
These two requirements must be satisfied for all Eclipse Foundation projects, not just DL4J and ND4J. A full list of Eclipse Foundation Projects can be found here: https://projects.eclipse.org/
By signing the ECA, you are essentially asserting that the code you are submitting is something that either you wrote, or that you have the right to contribute to the project. This is a necessary legal protection to avoid copyright issues.
By signing your commits, you are asserting that the code in that particular commit is your own.
You only need to sign the Eclipse Contributor Agreement (ECA) once. Here's the process:
Step 1: Sign up for an Eclipse account
Note: You must register using the same email as your GitHub account (the GitHub account you want to submit pull requests from).
Step 2: Sign the ECA
There are a few ways to sign commits. Note that you can use any of these aoptions.
Option 1: Use
-sWhen Committing on Command Line
Signing commits here is simple:
git commit -s -m "My signed commit"
Note the use of
-s(lower case s) - upper-case S (i.e.,
-S) is for GPG signing (see below).
Option 2: Set up Bash Alias (or Windows cmd Alias) for Automated Signing
For example, you could set up the following alias in Bash:
alias gcm='git commit -s -m'
Then committing would be done with the following:
gcm "My Commit"
One simple way is to create a
gcm.batfile with the following contents, and add it to your system path:
git commit -s -m %*
You can then commit using the same process as above (i.e.,
gcm "My Commit")
Option 3: Use GPG Signing
Note that this option can be combined with aliases (above), as in
alias gcm='git commit -S -m'- note the upper case
-Sfor GPG signing.
Option 4: Commit using IntelliJ with Auto Signing
IntelliJ can be used to perform git commits, including through signed commits. See this page for details.
After performing a commit, you can check in a few different ways. One way is to use
git log --show-signature -1to show the signature for the last commit (use -5 to show the last 5 commits, for example)
The output will look like:
$ git log --show-signature -2
commit 81681455918371e29da1490d3f0ca3deecaf0490 (HEAD -> commit_test_branch)
Date: Fri Jun 21 22:27:50 2019 +1000
This commit is unsigned
Date: Fri Jun 21 21:42:38 2019 +1000
My signed commit
Signed-off-by: YourName <[email protected]>
The top commit is unsigned, and the bottom commit is signed (note the presence of the
If you forgot to sign the last commit, you can use the following command:
git commit --amend --signoff
Suppose your branch has 3 new commits, all of which are unsigned:
$ git log -4 --oneline
4b164026 (HEAD -> commit_test_branch) Your new commit 3
d7799615 Your new commit 2
6bb6113a Your new commit 1
ef09606c This commit already exists
One simple way is to squash and sign these commits. To do this for the last 3 commits, use the following: (note you might want to make a backup first)
git reset --soft HEAD~3
git commit -s -m "Squashed and signed"
$ git log -2 --oneline
31658e11 (HEAD -> commit_test_branch) Squashed and signed
ef09606c This commit already exists
You can confirm that the commit is signed using
git log -1 --show-signatureas shown earlier.
Note that your commits will be squashed once they are merged to master anyway, so the loss of the commit history does not matter.
If you are updating an existing PR, you may need to force push using
git push X -f).