Skip to content

Instantly share code, notes, and snippets.

@andynu
Created January 21, 2010 05:20
Show Gist options
  • Save andynu/282602 to your computer and use it in GitHub Desktop.
Save andynu/282602 to your computer and use it in GitHub Desktop.
# zsh function
svnhistgrep () {
term=$1
file=$2
versions=($(svn log $file | perl -ne 'print "$1 " if (/r(\d+)/)'))
for r in $versions
do
echo "$file r$r"
svn cat -r$r $file | egrep -C 3 -n $term
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment