diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-16 01:31:36 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-16 01:31:36 -0500 |
| commit | 8d45e049fc178d4982c31d466b47ba2199bba9e9 (patch) | |
| tree | dfae3bd9cced45bc93d681ad6e32d15d043a7e6c /githooks/pre-commit | |
| parent | 401a839e718c21d4a78bc839d9dfb7427bd072d7 (diff) | |
| download | dotemacs-8d45e049fc178d4982c31d466b47ba2199bba9e9.tar.gz dotemacs-8d45e049fc178d4982c31d466b47ba2199bba9e9.zip | |
fix(ai-config): hook gptel-magit wiring per-feature, not on magit
The wiring keyed on `with-eval-after-load 'magit` fires while two
of its three references are still undefined. `magit.el` calls
`(provide 'magit)` BEFORE its `cl-eval-when (load eval)` block
requires `magit-commit` and `magit-stash`. At that moment the
`magit-commit` transient prefix doesn't exist, and
`transient-append-suffix` silently no-ops on missing prefixes
(default `transient-error-on-insert-failure` is nil). The "g
Generate commit" and "x Explain" suffixes never landed. Only the
M-g binding worked, because `git-commit` IS required before
provide.
Three per-feature hooks replace the single `'magit` hook: one each
on `git-commit`, `magit-commit`, and `magit-diff`. Each hooks the
exact dependency the wiring needs, side-stepping the load-order
race entirely.
The companion test was rewritten to check `after-load-alist`
registration rather than drive the hooks through `provide`. Emacs
30 batch mode doesn't fire registered `eval-after-load` callbacks
on `provide` alone -- only an actual `load` does. Inspecting the
registration is the stronger guard anyway: the regression is "a
single `'magit` hook," and the right shape of that check is "no
entry under `magit`, entries under `git-commit`, `magit-commit`,
`magit-diff`."
Diffstat (limited to 'githooks/pre-commit')
0 files changed, 0 insertions, 0 deletions
