summaryrefslogtreecommitdiffstats
path: root/git-blame.html
diff options
context:
space:
mode:
authorJunio C Hamano <junio@hera.kernel.org>2006-11-09 07:37:50 +0000
committerJunio C Hamano <junio@hera.kernel.org>2006-11-09 07:37:50 +0000
commite1aa7476a40f0b9c883804792ec811b7e8790f7c (patch)
tree6d520043377bc8d1eb612837310a41222803cbf9 /git-blame.html
parent0d3c81546c38713ca17817d884eed8f9ae6ae88b (diff)
downloadgit-htmldocs-e1aa7476a40f0b9c883804792ec811b7e8790f7c.tar.gz
Autogenerated HTML docs for v1.4.4-rc1-gacca
Diffstat (limited to 'git-blame.html')
-rw-r--r--git-blame.html87
1 files changed, 84 insertions, 3 deletions
diff --git a/git-blame.html b/git-blame.html
index 235506d64..7ab2937e4 100644
--- a/git-blame.html
+++ b/git-blame.html
@@ -272,12 +272,15 @@ git-blame(1) Manual Page
</div>
<h2>SYNOPSIS</h2>
<div class="sectionbody">
-<p><em>git-blame</em> [-c] [-l] [-t] [-f] [-n] [-p] [-S &lt;revs-file&gt;] [--] &lt;file&gt; [&lt;rev&gt;]</p>
+<div class="verseblock">
+<div class="content"><em>git-blame</em> [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S &lt;revs-file&gt;]
+ [-M] [-C] [-C] [--since=&lt;date&gt;] [&lt;rev&gt;] [--] &lt;file&gt;</div></div>
</div>
<h2>DESCRIPTION</h2>
<div class="sectionbody">
<p>Annotates each line in the given file with information from the revision which
last modified the line. Optionally, start annotating from the given revision.</p>
+<p>Also it can limit the range of lines annotated.</p>
<p>This report doesn't tell you anything about lines which have been deleted or
replaced; you need to use a tool such as <a href="git-diff.html">git-diff(1)</a> or the "pickaxe"
interface briefly mentioned in the following paragraph.</p>
@@ -305,6 +308,17 @@ ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output</tt></pre>
</p>
</dd>
<dt>
+-L n,m
+</dt>
+<dd>
+<p>
+ Annotate only the specified line range (lines count from
+ 1). The range can be specified with a regexp. For
+ example, <tt>-L <em>/<sup>sub esc_html /,/</sup>}$/</em></tt> limits the
+ annotation only to the body of <tt>esc_html</tt> subroutine.
+</p>
+</dd>
+<dt>
-l, --long
</dt>
<dd>
@@ -355,6 +369,34 @@ ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output</tt></pre>
</p>
</dd>
<dt>
+-M
+</dt>
+<dd>
+<p>
+ Detect moving lines in the file as well. When a commit
+ moves a block of lines in a file (e.g. the original file
+ has A and then B, and the commit changes it to B and
+ then A), traditional <em>blame</em> algorithm typically blames
+ the lines that were moved up (i.e. B) to the parent and
+ assigns blame to the lines that were moved down (i.e. A)
+ to the child commit. With this option, both groups of
+ lines are blamed on the parent.
+</p>
+</dd>
+<dt>
+-C
+</dt>
+<dd>
+<p>
+ In addition to <tt>-M</tt>, detect lines copied from other
+ files that were modified in the same commit. This is
+ useful when you reorganize your program and move code
+ around across files. When this option is given twice,
+ the command looks for copies from all other files in the
+ parent for the commit that creates the file in addition.
+</p>
+</dd>
+<dt>
-h, --help
</dt>
<dd>
@@ -417,13 +459,52 @@ the first line of the commit log message ("summary").
header, prefixed by a TAB. This is to allow adding more
header elements later.</p>
</div>
+<h2>SPECIFIYING RANGES</h2>
+<div class="sectionbody">
+<p>Unlike <tt>git-blame</tt> and <tt>git-annotate</tt> in older git, the extent
+of annotation can be limited to both line ranges and revision
+ranges. When you are interested in finding the origin for
+ll. 40-60 for file <tt>foo</tt>, you can use <tt>-L</tt> option like this:</p>
+<div class="literalblock">
+<div class="content">
+<pre><tt>git blame -L 40,60 foo</tt></pre>
+</div></div>
+<p>When you are not interested in changes older than the version
+v2.6.18, or changes older than 3 weeks, you can use revision
+range specifiers similar to <tt>git-rev-list</tt>:</p>
+<div class="literalblock">
+<div class="content">
+<pre><tt>git blame v2.6.18.. -- foo
+git blame --since=3.weeks -- foo</tt></pre>
+</div></div>
+<p>When revision range specifiers are used to limit the annotation,
+lines that have not changed since the range boundary (either the
+commit v2.6.18 or the most recent commit that is more than 3
+weeks old in the above example) are blamed for that range
+boundary commit.</p>
+<p>A particularly useful way is to see if an added file have lines
+created by copy-and-paste from existing files. Sometimes this
+indicates that the developer was being sloppy and did not
+refactor the code properly. You can first find the commit that
+introduced the file with:</p>
+<div class="literalblock">
+<div class="content">
+<pre><tt>git log --diff-filter=A --pretty=short -- foo</tt></pre>
+</div></div>
+<p>and then annotate the change between the commit and its
+parents, using <tt>commit^!</tt> notation:</p>
+<div class="literalblock">
+<div class="content">
+<pre><tt>git blame -C -C -f $commit^! -- foo</tt></pre>
+</div></div>
+</div>
<h2>SEE ALSO</h2>
<div class="sectionbody">
<p><a href="git-annotate.html">git-annotate(1)</a></p>
</div>
<h2>AUTHOR</h2>
<div class="sectionbody">
-<p>Written by Fredrik Kuivinen &lt;freku045@student.liu.se&gt;.</p>
+<p>Written by Junio C Hamano &lt;junkio@cox.net&gt;</p>
</div>
<h2>GIT</h2>
<div class="sectionbody">
@@ -431,7 +512,7 @@ header elements later.</p>
</div>
<div id="footer">
<div id="footer-text">
-Last updated 25-Oct-2006 22:55:21 UTC
+Last updated 09-Nov-2006 07:37:40 UTC
</div>
</div>
</body>