Skip to content

Instantly share code, notes, and snippets.

@lapo-luchini
Created January 28, 2014 11:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lapo-luchini/8666153 to your computer and use it in GitHub Desktop.
Save lapo-luchini/8666153 to your computer and use it in GitHub Desktop.
A script to grep the whole SVN history of a file.
#!/bin/sh
FILE="$1"
shift
PARAM="$@"
svn log -q "$FILE" | egrep '^r[0-9]+' | while read REV ALL; do
OUT=`svn cat -r $REV "$FILE" | egrep -n "$PARAM"`
if [ $? -eq 0 ]; then
echo "====> $REV $ALL"
echo "$OUT"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment