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!
This commit is contained in:
Dominic Reich 2025-01-01 12:26:51 +01:00
parent a35b8927af
commit cde1a604b4
Signed by: dominic
GPG key ID: 0B5787DB23049C45

View file

@ -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