Skip to content

Instantly share code, notes, and snippets.

@rurban
Created August 7, 2012 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rurban/3287531 to your computer and use it in GitHub Desktop.
Save rurban/3287531 to your computer and use it in GitHub Desktop.
smoke-parrot shell script
#!/bin/sh
cd /usr/src/parrot/parrot-git || exit
branch=${1:-master}
# stash changes if dirty or detached head
if git symbolic-ref -q HEAD
then
if git status|grep " Changes " 2>/dev/null
then
git stash save "smoke `date +%F` `git name-rev --name-only HEAD`"
fi
fi
fbranch=smoked."`echo $branch|sed -e's,/,_,'`"
git fetch origin $branch
git checkout -b $branch
git clean -dxf || git clean -d -x
git reset --hard
git pull origin $branch
git reset --hard
oldrev="`cat ../$fbranch`"
newrev="`git rev-parse $branch`"
if [ x$oldrev = x$newrev ]
then
echo "no changes for $branch $newrev"
else
perl Configure.pl --optimize
make
make smolder_test
git rev-parse $branch && echo $newrev >../$fbranch
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment