CLA or DCO? Two Ways a Package Can Accept Outside Code

Once strangers start sending pull requests, a maintainer eventually wonders what legal footing those contributions stand on. Two broad answers dominate open source: a contributor licence agreement (CLA) or the Developer Certificate of Origin (DCO). They solve overlapping problems with very different amounts of friction. This page lays out both fairly; it is general background, not legal advice.

What each one is

A CLA is a document a contributor signs, usually once, before their first contribution is merged. It typically grants the project or a sponsoring organisation a broad licence to the contribution, sometimes including the right to relicense it, and may include a patent grant. The Apache Software Foundation's individual CLA is a well-known example, and many companies that sponsor open source projects use their own versions.

The DCO is a short statement, maintained by the Linux Foundation and used by the Linux kernel, in which a contributor certifies that they have the right to submit the code under the project's licence. Contributors agree to it per commit by adding a sign-off line, which Git produces with the -s flag:

git commit -s -m "Fix off-by-one in range parser"

# produces a trailer like:
Signed-off-by: Contributor B <contributor-b@example.org>

Under a DCO the contribution is licensed under the project's existing licence, inbound equals outbound, with no separate grant to anyone.

Side by side

CLADCO
Contributor effortRead and sign a document, sometimes employer approvalAdd a sign-off to each commit
Rights grantedWhatever the agreement says, often broadOnly the project's licence
Relicensing laterOften possible for the holderRequires consent from contributors
ToolingA bot that checks a signature recordA check that every commit has a sign-off
Common objectionFeels one-sided; deters drive-by fixesForgotten sign-offs block merges

The arguments people actually make

Supporters of CLAs value certainty. A company that may need to dual-license, defend the project in court or move it to a foundation wants clear paperwork. Critics reply that a CLA asymmetrically lets one party relicense everyone's work, possibly to a proprietary licence, and that the signing step discourages exactly the small contributions that keep libraries healthy.

DCO supporters like that it is lightweight and symmetrical: everyone, including the sponsor, is bound by the same licence. Critics note that it provides less explicit patent coverage than some CLAs, although licences such as Apache-2.0 already include a patent grant of their own.

Picking for a small package

Whatever you choose, state it in CONTRIBUTING.md before the first pull request arrives. If licence choice itself is still open, start with our permissive vs copyleft overview, and for complex situations consult a lawyer familiar with open source.