Skip to content

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

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

  • Chores
    • Commit messages are now cleaned to remove Co-Authored-By: trailer lines while preserving mentions elsewhere in the message. If cleanup fails, the commit is stopped and the original message is left unchanged.

@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/web-mirror/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9d091bc7-bc48-4189-839e-34fd5170609a
📥 Commits

Reviewing files that changed from the base of the PR and between f78c738 and cb8f6ae.

📒 Files selected for processing (1)
  • .beads/hooks/commit-msg
 _________________________________________________
< Because, even your code needs a second opinion. >
 -------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ 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 91d93ca into main Oct 3, 2026
6 of 7 checks passed
@GeiserX
GeiserX deleted the chore/beads-commit-msg-hook branch October 3, 2026 20:42
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