From 1f6dc84f68b4631e77ebc11a452cb0b03eecde57 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Tue, 19 May 2026 16:45:17 +0100 Subject: feat(git): commit-msg hook strips AI Co-authored-by trailers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Various agentic tools (Copilot CLI, VS Code chat, etc.) auto-append `Co-authored-by: Copilot <...>` / Claude / Codex trailers, which then trip the pre-push hook's agent-coauthor check and force a manual amend before the push goes through. Scrub at commit time instead. Uses the same agent-substring list as executable_pre-push (kept in sync by comment). Triggered as commit-msg (not pre-commit — pre-commit runs before the message exists). Drops matching trailers in-place, collapses trailing blanks, and is a no-op otherwise. Also symlinks the new hook in the remote-dev home-manager config so it deploys on the Ubuntu VM. Bypass: `git commit --no-verify`. --- remote-dev/home.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'remote-dev/home.nix') diff --git a/remote-dev/home.nix b/remote-dev/home.nix index 926aadb..5dc55d0 100644 --- a/remote-dev/home.nix +++ b/remote-dev/home.nix @@ -161,6 +161,7 @@ in # so map each hook to its stripped name explicitly. The executable bit # comes from the working-tree file mode (git resolves the symlink). "git/hooks/pre-push".source = link "dot_config/git/hooks/executable_pre-push"; + "git/hooks/commit-msg".source = link "dot_config/git/hooks/executable_commit-msg"; }; # ── Rootless podman config ────────────────────────────────────────────────── -- cgit v1.3.1