File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -110,3 +110,18 @@ commit-msg:
110110 echo " full guide: https://www.conventionalcommits.org/"
111111 exit 1
112112 fi
113+
114+ strip-co-authored-by :
115+ run : |
116+ # Strip Co-authored-by: trailers that AI tools (Claude, Cursor, etc.) add.
117+ # This enforces the rule that commits list only the human author.
118+ sed '/^[Cc]o-[Aa]uthored-[Bb]y:/d' "{1}" > "{1}.tmp" && mv "{1}.tmp" "{1}"
119+
120+ # ---------------------------------------------------------------------------
121+ # prepare-commit-msg — strip AI co-author trailers after tools inject them.
122+ # ---------------------------------------------------------------------------
123+ prepare-commit-msg :
124+ commands :
125+ strip-co-authored-by :
126+ run : |
127+ sed '/^[Cc]o-[Aa]uthored-[Bb]y:/d' "{1}" > "{1}.tmp" && mv "{1}.tmp" "{1}"
You can’t perform that action at this time.
0 commit comments