Using the command line, I'd like to see all changesets made by a particular user. Is this possible? I've looked at the documentation for svn log
but can't see how to do this.
views:
70answers:
3I don't know of any way to do this using pure Subversion. But you can do it with sed
:
svn log | sed -n '/username/,/-----$/ p'
This finds each instance of the username, and then prints everything up to the dashed line which marks the end of a record in the log.
The search pattern is very flexible - you can easily modify it to search for other things. For example,
svn log | sed -n '/Dec 2009/,/-----$/ p'
Would return all commits made in December (by any author).
Edit: If you don't want the actual commit message, but just the summary metadata, then you can just use grep
, in an analogous way to William Leara's Windows answer:
svn log | grep username
Windows version:
svn log | find "William_Leara"
The output looks like:
r11506 | William_Leara | 2009-12-23 19:29:12 -0600 (Wed, 23 Dec 2009) | 12 lines
r11505 | William_Leara | 2009-12-23 15:18:37 -0600 (Wed, 23 Dec 2009) | 12 lines
r11504 | William_Leara | 2009-12-22 19:16:12 -0600 (Tue, 22 Dec 2009) | 12 lines
r11503 | William_Leara | 2009-12-22 19:04:15 -0600 (Tue, 22 Dec 2009) | 12 lines
r11502 | William_Leara | 2009-12-22 18:49:33 -0600 (Tue, 22 Dec 2009) | 12 lines
r11501 | William_Leara | 2009-12-22 18:26:45 -0600 (Tue, 22 Dec 2009) | 12 lines
r11500 | William_Leara | 2009-12-22 18:05:04 -0600 (Tue, 22 Dec 2009) | 12 lines
r11499 | William_Leara | 2009-12-22 17:25:25 -0600 (Tue, 22 Dec 2009) | 12 lines
r11498 | William_Leara | 2009-12-22 17:03:18 -0600 (Tue, 22 Dec 2009) | 12 lines
r11497 | William_Leara | 2009-12-22 16:54:59 -0600 (Tue, 22 Dec 2009) | 12 lines
r11494 | William_Leara | 2009-12-21 14:36:20 -0600 (Mon, 21 Dec 2009) | 12 lines
r11491 | William_Leara | 2009-12-19 12:48:49 -0600 (Sat, 19 Dec 2009) | 12 lines
etc.
If you don't mind reading log in XML format, here's how with XML Starlet:
svn log --xml --verbose <directory> | xmlstarlet sel -t -m "/log/logentry/author[text()='<wanted author>']/.." -c "."
If you don't want those files to be listed, remove --verbose
.
Here's example output without verbose.
$ svn log --xml zfce | xmlstarlet sel -t -m "/log/logentry/author[text()='pekka.jarvinen']/.." -c "."
<logentry revision="157">
<author>pekka.jarvinen</author>
<date>2009-09-26T19:23:40.060050Z</date>
<msg>fix</msg>
</logentry><logentry revision="156">
<author>pekka.jarvinen</author>
<date>2009-09-25T20:40:01.823746Z</date>
<msg>Dojo files are now downloaded from Google. Also some XHTML JS fixes (CDATA to <script>).</msg>
</logentry><logentry revision="155">
<author>pekka.jarvinen</author>
<date>2009-09-25T17:28:14.501392Z</date>
<msg>Added spans</msg>
</logentry><logentry revision="154">
<author>pekka.jarvinen</author>
<date>2009-09-25T17:21:17.375304Z</date>
<msg>Changed behavior: default.css is now not used as base. CSS in .INI configuration is always loaded.</msg>
</logentry><logentry revision="151">
<author>pekka.jarvinen</author>
<date>2009-04-10T00:24:41.683379Z</date>
<msg>Added more PHP and Apache information</msg>
</logentry>
...