summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
authorParabola git <git@parabola.nu>2016-07-08 00:55:19 +0000
committerParabola git <git@parabola.nu>2016-07-08 00:55:19 +0000
commit3eb16d93bf95b2a7d40fb1607622cab1e2f4b81e (patch)
tree6b971400f294f1b5b5bfd34ef93924715bdd7c75 /.config
parent4fe7bac236d7c1895271bf15bdb9dda1253ec230 (diff)
redo hooks infrastructure (yay git 2.9 core.hooksPath)
Diffstat (limited to '.config')
-rw-r--r--.config/git/config5
l---------.config/git/hooks/post-receive1
-rwxr-xr-x.config/git/hooks/post-receive.d/agefile9
l---------.config/git/hooks/post-update1
l---------.config/git/hooks/pre-receive1
-rwxr-xr-x.config/git/hooks/run-parts.sh9
l---------.config/git/hooks/update1
-rw-r--r--.config/git/ignore13
8 files changed, 40 insertions, 0 deletions
diff --git a/.config/git/config b/.config/git/config
new file mode 100644
index 0000000..2144347
--- /dev/null
+++ b/.config/git/config
@@ -0,0 +1,5 @@
+[user]
+ name = Parabola git
+ email = git@parabola.nu
+[core]
+ hooksPath = /srv/git/.config/git/hooks
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
diff --git a/.config/git/ignore b/.config/git/ignore
new file mode 100644
index 0000000..006a323
--- /dev/null
+++ b/.config/git/ignore
@@ -0,0 +1,13 @@
+# Things in /srv/git directly to ignore
+/.??*
+!/.config/
+
+# General files to ignore
+*~
+*.sample
+
+# Ignore most of the things in git repos
+**/*.git/*
+!**/*.git/config
+!**/*.git/description
+!**/*.git/hooks/