<?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>svn blame (praise, annotate, ann)</title> <link rel="stylesheet" type="text/css" href="styles.css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /> <style type="text/css"> body { background-image: url('images/draft.png'); background-repeat: no-repeat; background-position: top left; /* The following properties make the watermark "fixed" on the page. */ /* I think that's just a bit too distracting for the reader... */ /* background-attachment: fixed; */ /* background-position: center center; */ }</style> <link rel="home" href="index.html" title="Version Control with Subversion [DRAFT]" /> <link rel="up" href="svn.ref.svn.html" title="svn Reference—Subversion Command-Line Client" /> <link rel="prev" href="svn.ref.svn.c.add.html" title="svn add" /> <link rel="next" href="svn.ref.svn.c.cat.html" title="svn cat" /> </head> <body> <div xmlns="" id="vcws-version-notice"> <p>This text is a work in progress—highly subject to change—and may not accurately describe any released version of the Apache™ Subversion® software. Bookmarking or otherwise referring others to this page is probably not such a smart idea. Please visit <a href="http://www.svnbook.com/">http://www.svnbook.com/</a> for stable versions of this book.</p> </div> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">svn blame (praise, annotate, ann)</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="svn.ref.svn.c.add.html">Prev</a> </td> <th width="60%" align="center">svn Reference—Subversion Command-Line Client</th> <td width="20%" align="right"> <a accesskey="n" href="svn.ref.svn.c.cat.html">Next</a></td> </tr> </table> <hr /> </div> <div class="refentry" title="svn blame (praise, annotate, ann)"> <a id="svn.ref.svn.c.blame"></a> <div class="titlepage"></div> <a id="idp20037216" class="indexterm"></a> <div class="refnamediv"> <h2>Name</h2> <p>svn blame (praise, annotate, ann) — Show author and revision information inline for the specified files or URLs.</p> </div> <div class="refsynopsisdiv" title="Synopsis"> <h2>Synopsis</h2> <p> <code class="literal">svn blame TARGET[@REV]...</code> </p> </div> <div class="refsect1" title="Description"> <a id="idp20041840"></a> <h2>Description</h2> <p>Show author and revision information inline for the specified files or URLs. Each line of text is annotated at the beginning with the author (username) and the revision number for the last change to that line.</p> </div> <div class="refsect1" title="Options"> <a id="idp20043648"></a> <h2>Options</h2> <div class="informalexample"> <pre class="screen"> <a class="xref" href="svn.ref.svn.html#svn.ref.svn.sw.extensions"><code class="option">--extensions</code> (<code class="option">-x</code>) <em class="replaceable"><code>ARG</code></em></a> <a class="xref" href="svn.ref.svn.html#svn.ref.svn.sw.force"><code class="option">--force</code></a> <a class="xref" href="svn.ref.svn.html#svn.ref.svn.sw.incremental"><code class="option">--incremental</code></a> <a class="xref" href="svn.ref.svn.html#svn.ref.svn.sw.revision"><code class="option">--revision</code> (<code class="option">-r</code>) <em class="replaceable"><code>REV</code></em></a> <a class="xref" href="svn.ref.svn.html#svn.ref.svn.sw.use_merge_history"><code class="option">--use-merge-history</code> (<code class="option">-g</code>)</a> <a class="xref" href="svn.ref.svn.html#svn.ref.svn.sw.verbose"><code class="option">--verbose</code> (<code class="option">-v</code>)</a> <a class="xref" href="svn.ref.svn.html#svn.ref.svn.sw.xml"><code class="option">--xml</code></a> </pre> </div> </div> <div class="refsect1" title="Examples"> <a id="idp20051008"></a> <h2>Examples</h2> <p>If you want to see blame-annotated source for <code class="filename">readme.txt</code> in your test repository:</p> <div class="informalexample"> <pre class="screen"> $ svn blame http://svn.red-bean.com/repos/test/readme.txt 3 sally This is a README file. 5 harry Don't bother reading it. The boss is a knucklehead. 3 sally … </pre> </div> <p>Now, just because <span class="command"><strong>svn blame</strong></span> says that Harry last modified <code class="filename">readme.txt</code> in revision 5, understand that this subcommand is by default very picky about what constitutes a change. Before clubbing Harry over the head for what appears to be insubordination, first consider that perhaps the change he made to the file might have been only to its specific character content, not to its overall semantic meaning. Perhaps his changes were the result of blindly running a whitespace cleanup script on this file. You might need to examine the specific differences and related log message to understand exactly what Harry did to this file in revision 5.</p> <div class="informalexample"> <pre class="screen"> $ svn log -c 5 http://svn.red-bean.com/repos/test/readme.txt ------------------------------------------------------------------------ r5 | harry | 2008-05-29 07:26:12 -0600 (Thu, 29 May 2008) | 1 line Commit the results of 'double-space-after-period.sh'. ------------------------------------------------------------------------ $ svn diff -c 5 http://svn.red-bean.com/repos/test/readme.txt Index: http://svn.red-bean.com/repos/test/readme.txt =================================================================== --- http://svn.red-bean.com/repos/test/readme.txt (revision 4) +++ http://svn.red-bean.com/repos/test/readme.txt (revision 5) @@ -1,5 +1,5 @@ This is a README file. -Don't bother reading it. The boss is a knucklehead. +Don't bother reading it. The boss is a knucklehead. INSTRUCTIONS ============ $ </pre> </div> <p>Sure enough, Harry only changed the whitespace in that line. Fortunately, the <code class="option">--extensions</code> (<code class="option">-x</code>) option can help you better determine the last time that a <span class="emphasis"><em>meaningful</em></span> change was made to a given line of text. For example, here's how you can see the annotation information while disregarding mere whitespace changes:</p> <div class="informalexample"> <pre class="screen"> $ svn blame -x -b http://svn.red-bean.com/repos/test/readme.txt 3 sally This is a README file. 4 jess Don't bother reading it. The boss is a knucklehead. 3 sally … </pre> </div> <p>If you use the <code class="option">--xml</code> option, you can get XML output describing the blame annotations, but not the contents of the lines themselves:</p> <div class="informalexample"> <pre class="screen"> $ svn blame --xml http://svn.red-bean.com/repos/test/readme.txt <?xml version="1.0"?> <blame> <target path="readme.txt"> <entry line-number="1"> <commit revision="3"> <author>sally</author> <date>2008-05-25T19:12:31.428953Z</date> </commit> </entry> <entry line-number="2"> <commit revision="5"> <author>harry</author> <date>2008-05-29T13:26:12.293121Z</date> </commit> </entry> <entry line-number="3"> … </entry> </target> </blame> $ </pre> </div> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="svn.ref.svn.c.add.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="svn.ref.svn.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="svn.ref.svn.c.cat.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">svn add </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> svn cat</td> </tr> </table> </div> <div xmlns="" id="vcws-footer"> <hr /> <img src="images/cc-by.png" style="float: right;" /> <p>You are reading <em>Version Control with Subversion</em> (for Subversion 1.8), by Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato.</p> <p>This work is licensed under the <a href="http://creativecommons.org/licenses/by/2.0/">Creative Commons Attribution License v2.0</a>.</p> <p>To submit comments, corrections, or other contributions to the text, please visit <a href="http://www.svnbook.com/">http://www.svnbook.com/</a>.</p> </div> </body> </html>