From cde1a604b464234b6a01f5c7696e797d1b80c9a8 Mon Sep 17 00:00:00 2001 From: Dominic Reich Date: Wed, 1 Jan 2025 12:26:51 +0100 Subject: [PATCH] reset pre-commit git hook back to "normal" it automaticalle replaces lastmod with an actual date and time but removes the possibility to select hunks (did not work properly anyway) JUST DONT SELECT HUNKS FOR COMMITS AS THE WHOLE FILE WILL BE COMMITED AGAIN! --- .githooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index 169814b..ddad515 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -9,6 +9,6 @@ git diff --cached --name-status | grep -E -i "^(A|M).*\.(md)$" | while read a b; (grep -E "^---$" $b > /dev/null) && (cat $b | sed "/---.*/,/---.*/s/^lastmod:.*$/lastmod: $(date -u "+%Y-%m-%dT%H:%M:%S%z")/" > tmp) (grep -E "^\+\+\+$" $b > /dev/null) && (cat $b | sed "/+++.*/,/+++.*/s/^lastmod.*$/lastmod = '$(date -u "+%Y-%m-%dT%H:%M:%S%z")'/" > tmp) mv tmp $b - git add -p $b + git add $b done