DevOps Zone is brought to you in partnership with:

Jessica Thornsby is the Technical and Creative Copywriter at WANdisco, where she writers regular tutorials on Apache Subversion, TortoiseSVN, uberSVN, and all things version control. She spends her spare time editing the CD reviews section at www.leedsmusicscene.net, contributing to A Short Fanzine About Rocking, and researching her family tree. You can find her on Twitter @jthornsby Jessica is a DZone MVB and is not an employee of DZone and has posted 29 posts at DZone. You can read more from them at their website. View Full User Profile

Subversion’s SVN Annotate Command

03.14.2013
| 3617 views |
  • submit to reddit

Apache Subversion’s ‘svn annotate’ command allows users to view a line-by-line breakdown of all the changes that have been applied to a human-readable file in your working copy. This information is printed alongside details on:

  • The person responsible for each change
  • The revision number where each change occurred

Note that this line-by-line attribution is based on the file as it currently appears within the working copy.

To run ‘svn annotate’ on a file, enter:

svn annotate (working-copy-location)/file-being-examined

In this example, we’re examining all the changes for the ‘Changelog’ file, which is located inside the trunk of our working copy.

svn annotate

If you need a more comprehensive printout, the -verbose (-v) switch adds the full datestamp to each line.

svn annotate 2

The –force Switch

The ‘svn annotate’ command uses Multipurpose Internet Mail Extensions (MIME) types to automatically detect whether a file is human-readable. By default, ‘svn annotate’ will block any file that’s non human-readable. If you attempt to perform an ‘svn annotate’ on a file that Subversion judges not to be readable, you’ll get an error message.

svn annotate 3

If you want to go ahead regardless, you can add the –force switch. Of course, this may result in a screen full of strange symbols if the file truly is non human-readable!

svn annotate 4

Published at DZone with permission of Jessica Thornsby, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)