1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
\r
4 <article lang="en" id="git-annotate(1)">
\r
6 <title>git-annotate(1)</title>
\r
8 <primary>git-annotate(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-annotate - Annotate file lines with commit info</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
17 <simpara><emphasis>git annotate</emphasis> [options] file [revision]</simpara>
\r
19 <simplesect id="_description">
\r
20 <title>DESCRIPTION</title>
\r
21 <simpara>Annotates each line in the given file with information from the commit
\r
22 which introduced the line. Optionally annotate from a given revision.</simpara>
\r
23 <simpara>The only difference between this command and <xref linkend="git-blame(1)"/> is that
\r
24 they use slightly different output formats, and this command exists only
\r
25 for backward compatibility to support existing scripts, and provide more
\r
26 familiar command name for people coming from other SCM systems.</simpara>
\r
28 <simplesect id="_options">
\r
29 <title>OPTIONS</title>
\r
37 Show blank SHA-1 for boundary commits. This can also
\r
38 be controlled via the <literal>blame.blankboundary</literal> config option.
\r
48 Do not treat root commits as boundaries. This can also be
\r
49 controlled via the <literal>blame.showroot</literal> config option.
\r
59 Include additional statistics at the end of blame output.
\r
65 -L <start>,<end>
\r
69 Annotate only the given line range. <start> and <end> can take
\r
77 <simpara>If <start> or <end> is a number, it specifies an
\r
78 absolute line number (lines count from 1).</simpara>
\r
84 <simpara>This form will use the first line matching the given
\r
85 POSIX regex. If <end> is a regex, it will search
\r
86 starting at the line given by <start>.</simpara>
\r
92 <simpara>This is only valid for <end> and will specify a number
\r
93 of lines before or after the line given by <start>.</simpara>
\r
104 Show long rev (Default: off).
\r
114 Show raw timestamp (Default: off).
\r
120 -S <revs-file>
\r
124 Use revs from revs-file instead of calling <xref linkend="git-rev-list(1)"/>.
\r
137 Show in a format designed for machine consumption.
\r
147 Show the result incrementally in a format designed for
\r
148 machine consumption.
\r
154 --encoding=<encoding>
\r
158 Specifies the encoding used to output author names
\r
159 and commit summaries. Setting it to <literal>none</literal> makes blame
\r
160 output unconverted data. For more information see the
\r
161 discussion about encoding in the <xref linkend="git-log(1)"/>
\r
168 --contents <file>
\r
172 When <rev> is not specified, the command annotates the
\r
173 changes starting backwards from the working tree copy.
\r
174 This flag makes the command pretend as if the working
\r
175 tree copy has the contents of the named file (specify
\r
176 <literal>-</literal> to make the command read from the standard input).
\r
186 Detect moving lines in the file as well. When a commit
\r
187 moves a block of lines in a file (e.g. the original file
\r
188 has A and then B, and the commit changes it to B and
\r
189 then A), traditional <emphasis>blame</emphasis> algorithm typically blames
\r
190 the lines that were moved up (i.e. B) to the parent and
\r
191 assigns blame to the lines that were moved down (i.e. A)
\r
192 to the child commit. With this option, both groups of lines
\r
193 are blamed on the parent.
\r
195 <simpara><num> is optional but it is the lower bound on the number of
\r
196 alphanumeric characters that git must detect as moving
\r
197 within a file for it to associate those lines with the parent
\r
207 In addition to <literal>-M</literal>, detect lines copied from other
\r
208 files that were modified in the same commit. This is
\r
209 useful when you reorganize your program and move code
\r
210 around across files. When this option is given twice,
\r
211 the command looks for copies from all other files in the
\r
212 parent for the commit that creates the file in addition.
\r
214 <simpara><num> is optional but it is the lower bound on the number of
\r
215 alphanumeric characters that git must detect as moving
\r
216 between files for it to associate those lines with the parent
\r
235 <simplesect id="_see_also">
\r
236 <title>SEE ALSO</title>
\r
237 <simpara><xref linkend="git-blame(1)"/></simpara>
\r
239 <simplesect id="_author">
\r
240 <title>AUTHOR</title>
\r
241 <simpara>Written by Ryan Anderson <<ulink url="mailto:ryan@michonline.com">ryan@michonline.com</ulink>>.</simpara>
\r
243 <simplesect id="_git">
\r
245 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r