summaryrefslogtreecommitdiff
path: root/bin/post-commit
blob: 6b72bd2c8d0522644e1f46668ea72e35569926ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash

branch=$(git name-rev --name-only HEAD)
if [[ $branch == master ]]; then

	stash=false
	if [[ -n "$(git status --porcelain)" ]]; then
		stash=true
		git add .
		git stash
	fi

	git checkout pre-generated
	git merge master -m 'bogus'
	rm -rf out
	make --always-make -j12
	git add .
	git commit --amend -m "make: $(git log -n1 master --pretty=format:%B)"
	git checkout master

	if $stash; then
		git stash pop
	fi

fi