-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Run DCO checker with commit hooks #2281
Copy link
Copy link
Closed
Labels
Milestone
Description
Title: Run DCO checker with commit hooks
Description:
CONTRIBUTING.md specifies that commits should contain a DCO signoff. It's easy to forget this, and a pain to rebase when you do commit.
A better option is to automatically signoff using git's commit hooks API.
Mesos uses the following workflow to support this across the entire contributor base:
- When you first clone the repository, you run bootstrap, a shell script in the project root.
- This (among other things) causes the git commit hooks in support/hooks to be copied into the user's local
.gitfolder. - Then, when the user attempts to commit, various checks and associated processing is done. (e.g., they run linters, formatters, validate the commit message, and so on).
The major gotcha to this approach is to have a graceful error path. In Mesos's approach, if you fail to format the commit message correctly, it will abort, and unless you know that your commit message is squirreled away in places like .git/COMMIT_EDITMSG, you might think you have to type it all over again. In this case I believe this can be avoided.
Reactions are currently unavailable