Monday, April 4, 2011

Searching SVN for Commits by User

From time to time, you find yourself needing to research changes committed by a user in SVN. Usually, this means you execute a command like the following:
svn log http://svn-host/repo | grep username
Unfortunately, this only outputs something like following:
r3776 | username | 2006-12-27 17:32:22 -0500 (Wed, 27 Dec 2006) | 1 line
r3752 | username | 2006-12-15 10:38:51 -0500 (Fri, 15 Dec 2006) | 1 line
r3751 | username | 2006-12-14 21:38:52 -0500 (Thu, 14 Dec 2006) | 1 line
r3750 | username | 2006-12-14 20:56:47 -0500 (Thu, 14 Dec 2006) | 2 lines
r3744 | username | 2006-12-13 17:19:13 -0500 (Wed, 13 Dec 2006) | 1 line
r3743 | username | 2006-12-13 17:05:42 -0500 (Wed, 13 Dec 2006) | 1 line
r3670 | username | 2006-11-21 16:36:10 -0500 (Tue, 21 Nov 2006) | 1 line
r3667 | username | 2006-11-21 15:34:29 -0500 (Tue, 21 Nov 2006) | 1 line
r3606 | username | 2006-11-09 15:16:25 -0500 (Thu, 09 Nov 2006) | 1 line
r3605 | username | 2006-11-09 15:14:08 -0500 (Thu, 09 Nov 2006) | 1 line
r3603 | username | 2006-11-09 10:32:16 -0500 (Thu, 09 Nov 2006) | 1 line
r3595 | username | 2006-11-05 21:44:06 -0500 (Sun, 05 Nov 2006) | 1 line
r3584 | username | 2006-11-01 14:21:28 -0500 (Wed, 01 Nov 2006) | 1 line
r3579 | username | 2006-11-01 13:52:56 -0500 (Wed, 01 Nov 2006) | 1 line
r3512 | username | 2006-10-04 15:43:10 -0400 (Wed, 04 Oct 2006) | 1 line
r3511 | username | 2006-10-04 14:29:59 -0400 (Wed, 04 Oct 2006) | 1 line
r3510 | username | 2006-10-04 14:17:47 -0400 (Wed, 04 Oct 2006) | 1 line
You then have to research each revision to see the user comments, etc. A much quicker svn search by user can be done as follows:
svn log http://svn-host/repo | sed -n '/username/,/-----$/ p'
This will output something like the following:
r3776 | username | 2006-12-27 17:32:22 -0500 (Wed, 27 Dec 2006) | 1 line

Fixing unit test
------------------------------------------------------------------------
r3752 | username | 2006-12-15 10:38:51 -0500 (Fri, 15 Dec 2006) | 1 line

Changing DAO Implementation

No comments:

Post a Comment