summaryrefslogtreecommitdiff
path: root/post-commit
blob: d3a81bafb7b31d467db268416d0b423bb5c4708f (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
#!/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'
	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