Skip to content

Instantly share code, notes, and snippets.

@tawman
Created June 29, 2012 05:26
Show Gist options
  • Save tawman/3015966 to your computer and use it in GitHub Desktop.
Save tawman/3015966 to your computer and use it in GitHub Desktop.
Flavor your git repository with some bacon!
#!/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&paras=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