Skip to content

Instantly share code, notes, and snippets.

@pboissonneault
pboissonneault / svn-grep
Created November 17, 2015 18:30 — forked from lapo-luchini/svn-grep
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