From cf0c06f9dc19006b303ec2c2165ee40f20c0c18d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 17:09:16 -1000 Subject: Replace a read-only age file without asking mv asks before replacing a file it cannot write when stdin is a terminal, and the age hook sends the question to /dev/null. git always gives a hook a pipe, but a hook run by hand from a terminal waited on an answer no one could see and then kept the old date. --- custom/hooks/post-receive.cgit-age | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'custom/hooks') diff --git a/custom/hooks/post-receive.cgit-age b/custom/hooks/post-receive.cgit-age index 5fdffa9..243a655 100755 --- a/custom/hooks/post-receive.cgit-age +++ b/custom/hooks/post-receive.cgit-age @@ -44,4 +44,4 @@ mkdir -p "$(dirname "$agefile")" 2>/dev/null || exit 0 tmpfile="$agefile.$$" trap 'rm -f "$tmpfile"' EXIT { printf '%s\n' "$date" >"$tmpfile"; } 2>/dev/null || exit 0 -mv "$tmpfile" "$agefile" 2>/dev/null || : +mv -f "$tmpfile" "$agefile" 2>/dev/null || : -- cgit 2.12.1