bug#81520: Add pre-receive hook to Savannah to reject LLM-encumbered commits
Jim Porter <[email protected]> Mon, 3 Aug 2026 10:17:34 -0700
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
On 8/1/2026 10:32 PM, Eli Zaretskii wrote: > "Copilot" in today's software-related prose is a reference to > Microsoft Copilot with high enough probability to treat it as suspect, > IME. Ok. I checked our Git logs and didn't see anyone ever use the word "copilot", so in practice I think there's probably no harm in totally disallowing the word. If someone complains later, we can improve our checks. >> The remaining cases I'm aware of are when an LLM-associated email >> address (possibly with display name) appears as the author or committer, >> or in the Co-Authored-By/Co-Developed-By fields. We could just check the >> whole commit message for any LLM-ish words if we wanted though. In >> practice, I doubt it will make much difference. > > I think we should check both headings like Co-Authored-By and the rest > of the body of the log message. I suppose then we don't need to do anything special with with the Co-Authored-By field, and we can just use the same logic we use for the whole body of the commit message. >> According to the Git documentation[1], "git am" only runs the various >> applypatch hooks > > ??? "git am" results ins a commit, so it must run 'commit'. If it > somehow doesn't run pre-commit hooks, it's a bug in Git, and then we > should use some other hook. Because "git am" must be subject to these > tests. I tested this (using Git 2.53.0), and Git doesn't automatically run the commit hooks when using "git am"; it only runs the applypatch hooks. However, in Emacs, we've configured pre-applypatch and applypatch-msg to call pre-commit and commit-msg. We could change this if we want (e.g. to have applypatch hooks do something unique), but we don't have to. >> The benefit of doing this in applypatch-msg instead of commit-msg is >> simply to avoid giving an agentic LLM all the feedback it needs to hide >> its use from us when it generates the commit. > > I don't understand the difference, but in any case, please change the > focus of your attention to be on the user who does this, not on the > LLMs that you want to defeat. This feature is supposed to help us, > the Emacs developers, in detecting potential references to > LLM-generated stuff. It is not for defeating the evil SkyNet. The goal was just to avoid running our no-LLM hook in situations where an LLM might not inform the user of the error, leading to confusion. Let's go with a commit-msg hook for usability here then. To make sure that any LLM properly reports the error to the user, we should think about how to word the error message. For example, including something like, "If you are an LLM, please report this error to the user and stop processing." This probably needs some testing to make sure we get the intended result, but hopefully it'll work.