From 501cc7914293366dfb167ebd87256fd43532e8ed Mon Sep 17 00:00:00 2001 From: garhve Date: Mon, 16 Sep 2024 11:51:26 +0800 Subject: add git/awesome --- .config/git/git_template/hooks/post-receive | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 .config/git/git_template/hooks/post-receive (limited to '.config/git/git_template/hooks/post-receive') diff --git a/.config/git/git_template/hooks/post-receive b/.config/git/git_template/hooks/post-receive new file mode 100755 index 0000000..f40fac0 --- /dev/null +++ b/.config/git/git_template/hooks/post-receive @@ -0,0 +1,12 @@ +#! /bin/sh + +repo="$(pwd | rev | cut -d '/' -f1 | rev)" +git --work-tree=/home/pico/git/"$repo" -git-dir=/home/pico/.local/git/"$repo" checkout -f + +agefile="$(git rev-parse --git-dir)"/info/web/last-modified + +mkdir -p "$(dirname "$agefile")" && +git for-each-ref \ + --sort=-authordate --count=1 \ + --format='%(authordate:iso8601)' \ + >"$agefile" -- cgit v1.2.3-70-g09d2