Skip to content

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

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

GeiserX merged 1 commit 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

  • Commit Messages
    • Lines beginning with Co-Authored-By: are now removed automatically from commit messages, including lines with leading spaces and regardless of capitalization. Mentions within regular sentences are left unchanged, and messages without these lines are unaffected.
    • If the message cannot be safely updated, the commit is stopped and an error is reported.

@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.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: GeiserX/statix/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f9703523-1760-42d5-83ed-b5da26d7c9d1
📥 Commits

Reviewing files that changed from the base of the PR and between a2aebd0 and 93e1421.

📒 Files selected for processing (1)
  • .beads/hooks/commit-msg
 _________________________________________________
< Keeping your code so clean, you can eat off it. >
 -------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ 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 efb94f0 into main Oct 3, 2026
3 of 4 checks passed
@GeiserX
GeiserX deleted the chore/beads-commit-msg-hook branch October 3, 2026 20:36
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