# tag the svn revisions in the git repository # defaults to tagging the newest 25, use -a to tag all, or a number to tag that many sftag() { if [[ $# == 1 ]] then count=$1 else count=32 fi pushd /home/chris/programs/synfig/git > /dev/null echo -n deleting old tags... git tag -l | grep '^r[1-9][0-9]*' | while read x; do git tag -d $x > /dev/null done echo "[done]" echo -n "new tags: " current=$(git-svn log --oneline | head -1 | awk '{print $1}' | cut -c2-) # highest=$(git tag -l | grep '^r[0-9][0-9]*' | cut -c2- | sort -n | tail -1) if [[ $count == "-a" ]]; then highest="all" flags= else highest=$((current-count)) flags="--revision=$current:$highest" fi if [[ $current != $highest ]] then git-svn log $flags --show-commit --oneline | awk '{printf("%s %s\n", $1, $3)}' | while read x y do echo -n "$(echo $x | cut -c2-) " git tag $x $y done echo fi popd > /dev/null }