Created
June 29, 2012 05:26
-
-
Save tawman/3015966 to your computer and use it in GitHub Desktop.
Flavor your git repository with some bacon!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -d $1/.git ] | |
then | |
echo "usage : $0 <repository root directory>" | |
exit | |
fi | |
declare -a baconbits=($(curl -s 'http://baconipsum.com/api/?type=all-meat¶s=5&start-with-lorem=1' | sed s/[^\ a-zA-Z\-]//g)) | |
bitsize=${#baconbits[@]} | |
idx=0 | |
cd $1 | |
git log | grep ^commit | awk '{print $2}' | while read sha | |
do | |
let flavor=$idx%$bitsize | |
echo $sha > .git/refs/heads/${baconbits[$flavor]}-$idx | |
let idx=$idx+1 | |
done | |
echo "Seasoning complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment