Thursday, July 1, 2010

Find my commits SVN script

This script finds all log messages for commits that you've done in (or below) the current SVN-controlled directory.

#!/bin/bash
#
# svn_my_commits_here.sh
#
# Find all my commits _ever_ in this level of the repository (and below).

repo_url=`svn info | sed -n 's/^URL: *//p'`
# Multiple usernames can be given, separated by \|
username='joesmith\|jsmith'

for revision in `svn log -q $repo_url | sed -n "s/r\([0-9]*\) | \($username\) |.*/\1/p"`
do
svn log -vr $revision $repo_url
done

4 comments:

Harold L. said...

Thanks for working out the sed code for that!

naton said...

Excuse a newbie question, but how would this be if I wanted to do a "show all my commits for today"? BTW, can I run this in the /Sites/ folder, where I keep all my projects?

Kees Hink said...

naton, maybe this helps: http://keeshink.blogspot.com/2010/06/daily-svn-report-script.html

naton said...

Kees: Super. Thanks!

(heh, that was a really belated reply! :)