Skip to content

chore(git): keep Co-Authored-By trailers out of commits made with the beads hooks - #45

Merged
GeiserX merged 2 commits into
mainfrom
chore/beads-commit-msg-hook
Oct 3, 2026
Merged

GeiserX merged 2 commits into
mainfrom
chore/beads-commit-msg-hook

Conversation

@GeiserX

@GeiserX GeiserX commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Clones of this repo set core.hooksPath to .beads/hooks so the tracker's hooks run. That setting turns off the machine-wide git hooks, and one of those removed Co-Authored-By trailers from commit messages. With the tracker hooks on, nothing removed them any more.

This adds one commit-msg hook beside the tracker's wrappers. It deletes lines that start with Co-Authored-By: and the blank lines left at the end. A mention inside a sentence stays.

The hook cannot lose a message. A message without such a line is never touched. Otherwise the cleaned text is written to a fresh temporary file, checked against a second run, and renamed over the message only when every step worked. On any failure the message stays as it was and the commit stops.

Tested before it went anywhere: 780 message, shell, awk and locale combinations, a really full disk, signals arriving mid-run, and 28 real git scenarios. Without the hook the trailer stays.

Summary by CodeRabbit

  • Chores
    • Commit messages now omit standalone co-author attribution lines, including lines with leading whitespace or different capitalization. Trailing blank lines are also removed when an attribution is stripped; mentions within sentences remain unchanged.
    • Commits stop if the message cannot be safely read or updated, and the original message is preserved when an update fails before replacement.

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: GeiserX/Wayback-Diff/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9b2967f6-babd-42ca-a484-70bcbe0d79f9
📥 Commits

Reviewing files that changed from the base of the PR and between c4e6b3f and 27558ad.

📒 Files selected for processing (1)
  • .beads/hooks/commit-msg

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The new commit-message hook removes matching Co-Authored-By trailer lines and trailing blank lines. It verifies cleaned output before replacing the message. Failures stop the commit.

Changes

Commit Message Hook

Layer / File(s) Summary
Commit message filtering and replacement
.beads/hooks/commit-msg
The hook removes matching Co-Authored-By trailer lines and trailing blank lines. It writes the cleaned message to a temporary file and verifies a second cleanup produces the same output before replacing the original. Messages without a matching trailer remain unchanged. Read, temporary-file, rewrite, or replacement failures stop the commit.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 27558

The hook can be merged after normal checks; no material failure was established.

Architecture Summary

Architecture risk: 🔵 Low · up to 27558

The changed surface does not map to a changed system, dependency edge, entrypoint, or external dependency.

Changed systems: None identified.

Architecture concerns
No architecture-level concerns identified.

Review details

Before / after behavior

  • observed — Modified behavior in .beads/hooks/commit-msg: Adds the commit-msg hook, which detects and removes Co-Authored-By trailer lines, trims trailing blank lines, and replaces the message only after temporary-file creation and output verification succeed. Messages without a matching trailer are untouched; failures report an error and stop the commit.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: removing Co-Authored-By trailers from commits made with the beads hooks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@GeiserX
GeiserX merged commit 239c026 into main Oct 3, 2026
11 checks passed
@GeiserX
GeiserX deleted the chore/beads-commit-msg-hook branch October 3, 2026 19:22
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