Skip to content

chore: add local DCO sign-off check - #1359

Closed
gjermundgaraba wants to merge 12 commits into
mainfrom
gjermund/fou-1168-commit-signoff-hook
Closed

gjermundgaraba wants to merge 12 commits into
mainfrom
gjermund/fou-1168-commit-signoff-hook

Conversation

@gjermundgaraba

@gjermundgaraba gjermundgaraba commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add an optional commit-msg hook that rejects non-merge commits without the committer's DCO sign-off
  • install only the DCO hook so existing hooks, including Git LFS, remain intact
  • document intentional sign-off and recovery for an existing commit
  • run the hook regression script in the existing license-header workflow

Why

The repository's DCO check reports missing sign-offs after a push. This hook gives contributors the same feedback before creating a commit without automatically making the legal attestation for them.

Verification

  • .githooks/test-commit-msg
  • real Git commits with a --- divider and custom trailer.separators
  • unsigned local merge commit
  • shellcheck .githooks/commit-msg .githooks/test-commit-msg
  • make check-license-headers
  • git diff --check

Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
@linear-code

linear-code Bot commented Aug 12, 2026

Copy link
Copy Markdown

FOU-1168

@gjermundgaraba gjermundgaraba changed the title FOU-1168: Add automatic commit sign-off hook chore: add automatic commit sign-off hook Aug 12, 2026
Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
@gjermundgaraba gjermundgaraba changed the title chore: add automatic commit sign-off hook chore: add local DCO sign-off check Aug 12, 2026
Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
@gjermundgaraba
gjermundgaraba marked this pull request as ready for review August 12, 2026 20:43
@gjermundgaraba
gjermundgaraba requested a review from a team as a code owner August 12, 2026 20:43
@greptile-apps

greptile-apps Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds an optional local DCO commit hook, regression coverage in CI, and contributor installation and recovery instructions.

  • Adds commit-message validation for author or committer sign-off while exempting merge commits.
  • Adds a shell regression script and runs it in the license-header workflow.
  • Documents manual hook installation and commit repair.

Confidence Score: 4/5

The PR is not yet safe to merge because the documented installation can silently leave the DCO hook inactive for contributors using core.hooksPath.

The updated command fixes the linked-worktree case but still copies into the common Git directory even when Git is configured to execute hooks from another path.

Files Needing Attention: spec/CONTRIBUTING.md

Important Files Changed

Filename Overview
.githooks/commit-msg Adds the DCO trailer check and merge-commit exemption without an identified blocking defect.
.githooks/test-commit-msg Covers accepted author and committer trailers, unrelated and absent trailers, dividers, custom separators, and merges.
.github/workflows/license-headers.yml Runs the new hook regression script in the existing workflow.
spec/CONTRIBUTING.md Updates installation to support linked worktrees, but the command still ignores a configured core.hooksPath and can leave the hook inactive.

Reviews (2): Last reviewed commit: "docs: support worktrees when installing ..." | Re-trigger Greptile

Comment thread spec/CONTRIBUTING.md Resolved
Signed-off-by: Gjermund Garaba <gjermund@garaba.net>
Comment thread spec/CONTRIBUTING.md Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant