Return to Snippet

Revision: 25833
at April 11, 2010 19:53 by zingo


Initial Code
#!/bin/sh
pattern=$1
shift
 
for file in [email protected]; 
do
  svn log -q "$file" 2>/dev/null | perl -ne 'print "$1\n" if /^r(\d+)/' | 
  while read r 
  do
    match=`svn cat -r $r "$file" | grep "$pattern"`
    result=$?
    if [ $result -eq 0 ]
    then
      /bin/echo -n "$file @r$r: "
      /bin/echo $match;
    elif [ $result -ne 1 ]
    then
      exit 2
    fi
  done
done;

Initial URL
http://atastypixel.com/blog/2010/03/09/searching-through-subversion-history/

Initial Description
grep through all history from within a Subversion working directory, like:

$ svngrep SecItemCopyMatching *

Initial Title
Searching through Subversion history

Initial Tags
svn, search

Initial Language
Bash