bug#81520: Add pre-receive hook to Savannah to reject LLM-encumbered commits
Eli Zaretskii <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
> Date: Mon, 17 Aug 2026 13:07:30 -0700 > Cc: [email protected] > From: Jim Porter <[email protected]> > > On 8/9/2026 2:26 AM, Sean Whitton wrote: > > Fine with me, if I'm understanding you correctly. > > Ok, here's a patch for this at last. I've added a first draft of error > messages and CONTRIBUTE guidelines, but the wording is subject to > revision of course. Hopefully the logic in the hooks is roughly what we > want, though we can change it further if I've missed something. Thanks. I agree with everything Sean wrote in his review, and have in addition the following minor comments: > +# Check for fields that commonly indicate LLM usage. > +tolower($0) ~ /^(assisted-by|ai-assisted):/ { report_error($0) } > +tolower($0) ~ /^claude-session:/ { report_error($0) } > + > +# Check for common LLMs/harnesses. We purposefully exclude "Claude" > +# here because it's also a human name. > +tolower($0) ~ /openai/ { report_error($0) } > +tolower($0) ~ /anthropic/ { report_error($0) } > +tolower($0) ~ /copilot/ { report_error($0) } I think I'd prefer to have these in a single list, not as separate tests. That would make it easier to add/remove/modify the regular expressions as needed. I also wonder how should we test these before we release them into the wild. Is it reasonable to write a script that will run the detection code on a large chunk, say the last few years, of the commit messages in our repository? I'm especially bothered by any false positives, of course, because if there are too many of them, people will disable the hooks.