I still see many pull requests with a failing DCO Check and sometimes questions why this check fails or if its even necessary for the small change.
Instead of repeating my answers on github again and again i would like to write a short FAQ on dco check and the usage in the openhab-docs repository.
Two thing in advance
- The check is automated and runs for every pull request.
- It doesn’t know or look on the contents you are trying to contribute.
It just looks for your sign-off paragraph.
So what can i do to handle DCO check better.
There are two options:
- If you know you have a small changed introduced which doesn’t need a sign-off statement,
the reviewer (this is mostly myself at the time of writing this Post) will take care of it and override it if its reasonable.
- You can always do a correct sign-off and the problem is solved immediately
I have chosen the second option some time ago.
For me it is the easiest way of dealing with sign-off.
I don’t have to think about whether a pull request is small enough for an exception or not.
It turned to an automatism and is done very fast.
Yeah fine, but how is this done correct?
On the commandline
This is really straight forward if you are already working with the git command line.
You just have to configure your credentials one time with:
$ git config --global user.name "John Doe" $ git config --global user.email firstname.lastname@example.org
(Of course with your name and email.)
You can then sign off a commit with the
$ git commit -s -m "This is my commit message"
That’s it. Git will add the correct paragraph at the end of your commit message.
In the GitHub web editor
This is also not difficult, but unfortunately there is no native way to automate this.
(I think GitHub should have come up with a native solution long ago, but thats how it is currently…)
When you use the web editor, you have some form at the bottom of the edit page.
You can add your
sign-off-statement in the extended description.
Make sure that it is the last sentence of your commit.
DCO Check will recognise it and should pass.
(Maybe there can be other problems with your github account configuration, but mostly it should work now.)