Thursday, December 4, 2008

SVN -- recursive diffs

It's odd that svn (source control) doesn't have an easy way to see the entire evolution of a file. Since I'm usually wondering how and when something was changed, or just want to see the progression of the changes.

So I just wrote a quick shell script to do this:


#!/bin/bash

# 2008 GPL

if [[ $1 == "" ]]
then

echo "SVN RECURSIVE DIFF"
echo ""
echo "This script will list all svn changes to a file"
echo "the first and last file in the repository"
echo "and a series of diffs that connect them."
echo "IE, you can see the complete evolution of the file."
echo "It's probably best to pipe the output to a file."
echo ""
echo "USE"
echo " svnrdiff "
echo ""
echo "EXAMPLE"
echo " svnrdiff Model/ModelExample.cs > somefile.txt"
echo ""
echo "NOTES"
echo ""
echo "If your log is out of date, use"
echo ""
echo " svn up"
echo ""
echo "If you just want to see who last touched a line, use"
echo ""
echo " svn praise "
exit

fi

v1=""
v2=""
show_current="0"

while read log
do

echo ===================================================================
echo $log
echo ===================================================================

# grab revision numbers of file
v1=$( echo $log | sed -e 's/^r//' -e 's/ .*//' -e 's/-//g' )

if [[ $v2 != "" ]]
then

# print succesive diffs
svn diff -r $v2:$v1 $1

show_current="1"

else

# print first file
svn cat -r $v1 $1

fi

v2=$v1

# list in cronological order (tac)
done < <( svn log $1 | grep -E -e "^r[0-9]+ \| " | tac )

# print last file (if haven't already)
echo ===================================================================
echo "Current snapshot:"
echo ===================================================================
if [[ $show_current == "1" ]]
then
svn cat $1
else
echo "Same as above."
fi

Monday, May 19, 2008

Screaming frog?!

Hmmm ... I didn't know frogs could scream :)

Thursday, April 3, 2008

Elephant paints self-portrait

Wow this elephant is terrible. He draws the feet directly on top of the ground rather than inset. Doesn't he know anything about linear perspective???? :)

Friday, March 21, 2008

giant starfish found

From
http://www.cnn.com/2008/TECH/science/03/21/antarctic.search.ap/index.html


Looks like a giant species of star fish has been found. These guys would look better with faces. I propose that we tattoo faces on all star fish: