From b0e83e2ee3fc328e55119ee7c1f09ad7ed20a635 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Fri, 5 Jun 2026 11:06:02 +0100 Subject: Move more host tooling to Nix --- dot_config/git/hooks/executable_commit-msg | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'dot_config/git/hooks/executable_commit-msg') diff --git a/dot_config/git/hooks/executable_commit-msg b/dot_config/git/hooks/executable_commit-msg index e484ccb..628ac94 100755 --- a/dot_config/git/hooks/executable_commit-msg +++ b/dot_config/git/hooks/executable_commit-msg @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env dash # Strip Co-authored-by trailers whose identity looks like a coding agent # (Copilot, Claude, Codex, ChatGPT, Cursor, Aider, Devin, ...). Various # tools — GitHub Copilot CLI, VS Code chat, etc. — append these @@ -58,7 +58,11 @@ esac # Collapse any trailing blank lines produced by the removal so we don't # leave a dangling blank trailer block. -sed -e :a -e '/^$/{$d;N;ba' -e '}' "$tmp" >"$msg_file" +awk ' + NF { last = NR } + { lines[NR] = $0 } + END { for (i = 1; i <= last; i++) print lines[i] } +' "$tmp" >"$msg_file" printf 'commit-msg: stripped AI Co-authored-by trailer(s).\n' >&2 exit 0 -- cgit v1.3.1