Skip to content

fix: Add the Signed-off-by trailer with git interpret-trailers - #283

Merged
gabelton merged 4 commits into
mainfrom
fix/signed-off-by-trailer
Nov 18, 2026
Merged

gabelton merged 4 commits into
mainfrom
fix/signed-off-by-trailer

Conversation

@joshwong-cs

@joshwong-cs joshwong-cs commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The commit-msg hook deleted every line starting with "Signed-off-by" including contributors' sign-offs and body text. It split existing trailer blocks with a blank line and added a blank line on every run. Appending the trailer at the end hid it from the PR check after a "---" line and with a custom comment character left it below the scissors line where git discarded it. Now git adds the trailer only when it's missing.

A known limitation remains. With a custom comment character set only in global git config and no -v, each amend adds another trailer paragraph but the PR check still passes.

Signed-off-by: BIST pre-commit check

Description

For a combined summary, please see #282

Contributors

Let's acknowledge the people who contributed to the work.

Type of change

  • Refactoring (made code better without changing its behaviour)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How this has been tested

Please describe the tests that you ran to verify your changes.

If they are not automated tests please explain why and provide screenshots and/or instructions so they can reproduced.

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Reviewer Checklist

  • I have reviewed the PR and ensured no secret or sensitive values are present

The commit-msg hook deleted every line starting with "Signed-off-by"
including contributors' sign-offs and body text. It split existing
trailer blocks with a blank line and added a blank line on every run.
Appending the trailer at the end hid it from the PR check after a "---"
line and with a custom comment character left it below the scissors
line where git discarded it. Now git adds the trailer only when it's
missing.

A known limitation remains. With a custom comment character set only
in global git config and no -v, each amend adds another trailer
paragraph but the PR check still passes.

Signed-off-by: BIST pre-commit check

@gabelton gabelton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion on the test, but not a blocker

Co-authored-by: Gabe Naughton <gabriel.naughton@digital.trade.gov.uk>
Signed-off-by: BIST pre-commit check
@joshwong-cs
joshwong-cs force-pushed the fix/signed-off-by-trailer branch from b0112e4 to 56002e1 Compare November 18, 2026 09:13
@gabelton
gabelton merged commit 156436d into main Nov 18, 2026
20 checks passed
@gabelton
gabelton deleted the fix/signed-off-by-trailer branch November 18, 2026 09:29
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.

2 participants