aboutsummaryrefslogtreecommitdiff
path: root/githooks
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-16 01:48:59 -0500
committerCraig Jennings <c@cjennings.net>2026-05-16 01:48:59 -0500
commit69ffd583ea579d5881f8b256d890bbb3c7d32a61 (patch)
tree802c0e876c258433b7553f915f347a3459bbd2e9 /githooks
parent1fa469d0f070dc098a1c128b451f2fa1f2805e47 (diff)
downloaddotemacs-69ffd583ea579d5881f8b256d890bbb3c7d32a61.tar.gz
dotemacs-69ffd583ea579d5881f8b256d890bbb3c7d32a61.zip
feat(ai-quick-ask): add cj/gptel-quick-ask one-shot command
New module `modules/ai-quick-ask.el`. Bound to `C-; a q` via `cj/ai-keymap` ("quick ask"). `cj/gptel-quick-ask` reads a prompt in the minibuffer, creates a transient `*GPTel-Quick*` buffer in `cj/gptel-quick-mode` (a special-mode derivative with `q` / `escape` / `c` bindings), inserts "Q: <prompt>" plus a response marker, then calls `gptel-request` with `:stream t` so the answer streams into the buffer. Doesn't touch `*AI-Assistant*`, doesn't autosave. Two follow-up commands work in the buffer: - `cj/gptel-quick-dismiss` (`q` / `escape`): delete the window and kill the buffer. Idempotent when the buffer is absent. - `cj/gptel-quick-continue` (`c`): extract the prompt + response, seed them into `*AI-Assistant*` under proper org headings (matching the `cj/gptel--fresh-org-prefix` shape), display the side window, then dismiss the quick buffer. 13 tests cover the pure helpers (initial-text shape, response extraction across normal / multi-line / no-marker / empty inputs, seed-text shape), the ask path (buffer created in right mode, prompt recorded, gptel-request called, empty-prompt error), the dismiss path (kills buffer / no-op when absent), and the continue path (seeds `*AI-Assistant*`, dismisses quick buffer, errors outside a quick buffer). `gptel-request` is stubbed in tests so nothing hits the network.
Diffstat (limited to 'githooks')
-rwxr-xr-xgithooks/pre-commit2
1 files changed, 1 insertions, 1 deletions
diff --git a/githooks/pre-commit b/githooks/pre-commit
index 909cde22b..252921df0 100755
--- a/githooks/pre-commit
+++ b/githooks/pre-commit
@@ -9,7 +9,7 @@ cd "$REPO_ROOT"
# --- 1. Secret scan ---
# Patterns for common credentials. Scans only added lines in the staged diff.
-SECRET_PATTERNS='(AKIA[0-9A-Z]{16}|sk-[a-zA-Z0-9_-]{20,}|-----BEGIN (RSA|DSA|EC|OPENSSH|PGP)( PRIVATE)?( KEY| KEY BLOCK)?-----|(api[_-]?key|api[_-]?secret|auth[_-]?token|secret[_-]?key|bearer[_-]?token|access[_-]?token|password)[[:space:]]*[:=][[:space:]]*["'"'"'][^"'"'"']{16,}["'"'"'])'
+SECRET_PATTERNS='(AKIA[0-9A-Z]{16}|(^|[^a-zA-Z0-9])sk-[a-zA-Z0-9_-]{20,}|-----BEGIN (RSA|DSA|EC|OPENSSH|PGP)( PRIVATE)?( KEY| KEY BLOCK)?-----|(api[_-]?key|api[_-]?secret|auth[_-]?token|secret[_-]?key|bearer[_-]?token|access[_-]?token|password)[[:space:]]*[:=][[:space:]]*["'"'"'][^"'"'"']{16,}["'"'"'])'
secret_hits="$(git diff --cached -U0 --diff-filter=AM \
| grep '^+' | grep -v '^+++' \