diff options
author | Parabola git <git@parabola.nu> | 2016-07-08 00:55:19 +0000 |
---|---|---|
committer | Parabola git <git@parabola.nu> | 2016-07-08 00:55:19 +0000 |
commit | 3eb16d93bf95b2a7d40fb1607622cab1e2f4b81e (patch) | |
tree | 6b971400f294f1b5b5bfd34ef93924715bdd7c75 /.config/git/hooks | |
parent | 4fe7bac236d7c1895271bf15bdb9dda1253ec230 (diff) |
redo hooks infrastructure (yay git 2.9 core.hooksPath)
Diffstat (limited to '.config/git/hooks')
l--------- | .config/git/hooks/post-receive | 1 | ||||
-rwxr-xr-x | .config/git/hooks/post-receive.d/agefile | 9 | ||||
l--------- | .config/git/hooks/post-update | 1 | ||||
l--------- | .config/git/hooks/pre-receive | 1 | ||||
-rwxr-xr-x | .config/git/hooks/run-parts.sh | 9 | ||||
l--------- | .config/git/hooks/update | 1 |
6 files changed, 22 insertions, 0 deletions
diff --git a/.config/git/hooks/post-receive b/.config/git/hooks/post-receive new file mode 120000 index 0000000..081071a --- /dev/null +++ b/.config/git/hooks/post-receive @@ -0,0 +1 @@ +run-parts.sh
\ No newline at end of file diff --git a/.config/git/hooks/post-receive.d/agefile b/.config/git/hooks/post-receive.d/agefile new file mode 100755 index 0000000..10fc253 --- /dev/null +++ b/.config/git/hooks/post-receive.d/agefile @@ -0,0 +1,9 @@ +#!/bin/bash +set -x +agefile="$(git rev-parse --git-dir)"/info/web/last-modified + +mkdir -p "$(dirname "$agefile")" && +git for-each-ref \ + --sort=-committerdate --count=1 \ + --format='%(committerdate:iso8601)' \ + > "$agefile" diff --git a/.config/git/hooks/post-update b/.config/git/hooks/post-update new file mode 120000 index 0000000..081071a --- /dev/null +++ b/.config/git/hooks/post-update @@ -0,0 +1 @@ +run-parts.sh
\ No newline at end of file diff --git a/.config/git/hooks/pre-receive b/.config/git/hooks/pre-receive new file mode 120000 index 0000000..081071a --- /dev/null +++ b/.config/git/hooks/pre-receive @@ -0,0 +1 @@ +run-parts.sh
\ No newline at end of file diff --git a/.config/git/hooks/run-parts.sh b/.config/git/hooks/run-parts.sh new file mode 100755 index 0000000..c42173a --- /dev/null +++ b/.config/git/hooks/run-parts.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +if [[ -d "$0.d" ]]; then + run-parts "${@/#/--arg=}" -- "$0.d" +fi +file="$GIT_DIR/hooks/${0##*/}" +if [[ -x "$file" && -f "$file" ]]; then + "$file" +fi diff --git a/.config/git/hooks/update b/.config/git/hooks/update new file mode 120000 index 0000000..081071a --- /dev/null +++ b/.config/git/hooks/update @@ -0,0 +1 @@ +run-parts.sh
\ No newline at end of file |