bug#81520: Add pre-receive hook to Savannah to reject LLM-encumbered commits
Eli Zaretskii <[email protected]> Mon, 03 Aug 2026 20:40:04 +0300
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
> Date: Mon, 3 Aug 2026 10:17:34 -0700 > Cc: [email protected], [email protected] > From: Jim Porter <[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. Right. > > ??? "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. Good, thanks. > 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. These hooks will definitely need some tuning.