bug#81520: Add pre-receive hook to Savannah to reject LLM-encumbered commits
Eli Zaretskii <[email protected]> Thu, 30 Jul 2026 09:15:50 +0300
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
> Cc: [email protected] > Date: Wed, 29 Jul 2026 18:54:13 -0700 > From: Jim Porter <[email protected]> > > # This hook runs before receiving commits from a client and checks that > # none of the commits contain any LLM attributions. Specifically, this > # checks that none of the author, committer, or the Co-Authored-By or > # Co-Developed-By fields contain an email address associated with an > # LLM. Additionally, it rejects all commits with Assisted-By or > # AI-Assisted fields. > > ### Code: > > # A list of LLM-associated email addresses to reject. > BAD_EMAILS="\ > [email protected] > [email protected] > [email protected]" IMNSHO, this is not the best way of doing this, far from it. We don't want to start an "arms race" of having all the LLM-based agents in our hooks, definitely not based on their email addresses, which can change without notice. > # Get a list of all the SHAs not reachable from some already-present > # commit and validate them. > git rev-list $new_oid --not --all | \ > awk -v bad_emails="$BAD_EMAILS" -v ref="$ref_name" $' > function check_email(email_line) { > # Returns non-zero if the line contains a bad email address. > for (i in BAD_EMAILS) { > if (index(email_line, BAD_EMAILS[i])) Using 'index' can easily cause false positives, as it only matches the prefix of a string. If we are going to look for specific addresses (which I hope we won't), we will need as more accurate method of matching. > if (status == 0) { > print("LLM-encumbered commits found in \'" ref "\'") > print("Please remove the following commits and try again:") This should be worded differently, something like Commits found in $REF seem to be LLM-assisted It should also show the specific lines that caused this conclusion, since the user doesn't (and shouldn't) know what are the patterns we look for, and there seems to be no simple way to identify the parts of the commit that trigger the rejection. Bonus points for having some way of asking for the phrases or strings which should not appear in the log message. Thanks.