Tell HN: Git hook to keep LLM signatures out of your commit history

3 points by akktor ↗ HN
I’ve noticed a trend where LLMs append Co-authored-by: [AI Name] to the end of commit messages. Even if you try to prompt it away, context drift or new sessions eventually lead to one slipping through into the codebase.

I’m using a git hook to prevent any of that from reaching my commits instead of relying on LLMs.

  #!/bin/sh
  if grep -qi "co-authored-by" "$1"; then
    echo "error: commit message contains 'Co-authored-by'. Commit rejected." >&2
    exit 1
  fi

1 comment

[ 3.2 ms ] story [ 21.0 ms ] thread
why do you want to hide the attribution unless you are forbidden from using LLM and trying to hide it from someone?! we have opposite rule, if LLM attributed any work on a commit the attribution must be added. if I saw this hook I would suspect some shaddy shit going on