bug#81520: Add pre-receive hook to Savannah to reject LLM-encumbered commits
Sean Whitton <[email protected]> Tue, 04 Aug 2026 12:17:27 +0100
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
Eli Zaretskii [03/Aug 8:40pm +03] wrote: >> 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. All these points sound good to me too. Though I'd rather we didn't say "please" to a machine :) -- Sean Whitton