summaryrefslogtreecommitdiff
path: root/bin/post-commit
diff options
context:
space:
mode:
Diffstat (limited to 'bin/post-commit')
-rwxr-xr-xbin/post-commit38
1 files changed, 0 insertions, 38 deletions
diff --git a/bin/post-commit b/bin/post-commit
deleted file mode 100755
index 489181f..0000000
--- a/bin/post-commit
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2016-2017 Luke Shumaker
-set -e
-
-main() {
- branch=$(git name-rev --name-only HEAD)
- if [[ $branch == master ]]; then
- gitdir="$(git rev-parse --git-dir)"
- workdir="${gitdir}/pre-generated"
- exec 8>"${workdir}.lock"
- flock 8
-
- rm -rf -- "$workdir"
- git worktree prune
- git branch -D pre-generated.tmp &>/dev/null || true
-
- git worktree add -b pre-generated.tmp "${gitdir}/pre-generated" master
- (
- unset GIT_DIR GIT_WORK_TREE
- cd "$workdir"
- msg="$(git log -n1 master --pretty=format:%B)"
-
- make -j1
- echo '!/out/' >> .gitignore
-
- git add .
- git commit -m "make: $msg"
- git merge --no-edit -s ours pre-generated
- git checkout pre-generated
- git merge pre-generated.tmp
- git branch -d pre-generated.tmp
- )
- rm -rf -- "$workdir"
- git worktree prune
- fi
-}
-
-main &>/dev/tty &