Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Created December 8, 2011 10:08
Show Gist options
  • Save commuterjoy/1446621 to your computer and use it in GitHub Desktop.
Save commuterjoy/1446621 to your computer and use it in GitHub Desktop.
Graphing a pattern in your subversion history
# Today I wanted to draw a graph of the growth of our Cucumber scenarios in our
# ./feature directory since it's inception. It's in subversion, which provides
# rubbish history search support. Rubbish as in none whatsoever.
export REPO=http://path/to/your/features/directory
svn log $REPO |
egrep '^r[0-9]{1,}' |
cut -d ' ' -f 1 |
awk -v repo=$REPO '{print "svn export --force -" $1 " " repo " " $1 " 2>&1"}' |
/bin/sh |
egrep -o 'r[0-9]{1,}' |
sort |
uniq |
xargs grep -Ri "Scenario" {} | <--- do whatever you want here - egrep, find ...
cut -d '/' -f 1 |
uniq -c |
sed "s/^[ ]*//"
# So, you end up with something like this, with the _grep_ pattern counts in the left
# column and the corresponding svn revision in the second column. Drop it in to something
# that will draw a graph.
1 r566392
2 r580349
2 r583308
7 r593852
9 r595020
10 r597830
12 r611429
13 r611990
21 r612830
27 r617732
31 r621204
...
@commuterjoy
Copy link
Author

it's almost like git grep didn't exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment