1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE sect2 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <sect2 lang="en" id="git-annotate(1)">
\r
5 <title>git-annotate(1)</title>
\r
7 <primary>git-annotate(1)</primary>
\r
9 <simplesect id="git-annotate(1)__name">
\r
11 <simpara>git-annotate - Annotate file lines with commit information</simpara>
\r
13 <simplesect id="git-annotate(1)__synopsis">
\r
14 <title>SYNOPSIS</title>
\r
16 <literallayout><emphasis>git annotate</emphasis> [options] file [revision]</literallayout>
\r
19 <simplesect id="git-annotate(1)__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 annotates 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 a more
\r
26 familiar command name for people coming from other SCM systems.</simpara>
\r
28 <simplesect id="git-annotate(1)__options">
\r
29 <title>OPTIONS</title>
\r
37 Show blank SHA-1 for boundary commits. This can also
\r
38 be controlled via the <emphasis>blame.blankboundary</emphasis> config option.
\r
48 Do not treat root commits as boundaries. This can also be
\r
49 controlled via the <emphasis>blame.showroot</emphasis> 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 revisions from revs-file instead of calling <xref linkend="git-rev-list(1)" />.
\r
134 Walk history forward instead of backward. Instead of showing
\r
135 the revision in which a line appeared, this shows the last
\r
136 revision in which a line has existed. This requires a range of
\r
137 revision like START..END where the path to blame exists in
\r
151 Show in a format designed for machine consumption.
\r
161 Show the porcelain format, but output commit information for
\r
162 each line, not just the first time a commit is referenced.
\r
163 Implies --porcelain.
\r
173 Show the result incrementally in a format designed for
\r
174 machine consumption.
\r
180 --encoding=<encoding>
\r
184 Specifies the encoding used to output author names
\r
185 and commit summaries. Setting it to <emphasis>none</emphasis> makes blame
\r
186 output unconverted data. For more information see the
\r
187 discussion about encoding in the <xref linkend="git-log(1)" />
\r
194 --contents <file>
\r
198 When <rev> is not specified, the command annotates the
\r
199 changes starting backwards from the working tree copy.
\r
200 This flag makes the command pretend as if the working
\r
201 tree copy has the contents of the named file (specify
\r
202 <emphasis>-</emphasis> to make the command read from the standard input).
\r
208 --date <format>
\r
212 The value is one of the following alternatives:
\r
213 {relative,local,default,iso,rfc,short}. If --date is not
\r
214 provided, the value of the blame.date config variable is
\r
215 used. If the blame.date config variable is also not set, the
\r
216 iso format is used. For more information, See the discussion
\r
217 of the --date option at <xref linkend="git-log(1)" />.
\r
227 Detect moved or copied lines within a file. When a commit
\r
228 moves or copies a block of lines (e.g. the original file
\r
229 has A and then B, and the commit changes it to B and then
\r
230 A), the traditional <emphasis>blame</emphasis> algorithm notices only half of
\r
231 the movement and typically blames the lines that were moved
\r
232 up (i.e. B) to the parent and assigns blame to the lines that
\r
233 were moved down (i.e. A) to the child commit. With this
\r
234 option, both groups of lines are blamed on the parent by
\r
235 running extra passes of inspection.
\r
237 <simpara><num> is optional but it is the lower bound on the number of
\r
238 alphanumeric characters that git must detect as moving/copying
\r
239 within a file for it to associate those lines with the parent
\r
240 commit. The default value is 20.</simpara>
\r
249 In addition to <emphasis>-M</emphasis>, detect lines moved or copied from other
\r
250 files that were modified in the same commit. This is
\r
251 useful when you reorganize your program and move code
\r
252 around across files. When this option is given twice,
\r
253 the command additionally looks for copies from other
\r
254 files in the commit that creates the file. When this
\r
255 option is given three times, the command additionally
\r
256 looks for copies from other files in any commit.
\r
258 <simpara><num> is optional but it is the lower bound on the number of
\r
259 alphanumeric characters that git must detect as moving/copying
\r
260 between files for it to associate those lines with the parent
\r
261 commit. And the default value is 40. If there are more than one
\r
262 <emphasis>-C</emphasis> options given, the <num> argument of the last <emphasis>-C</emphasis> will
\r
263 take effect.</simpara>
\r
278 <simplesect id="git-annotate(1)__see_also">
\r
279 <title>SEE ALSO</title>
\r
280 <simpara><xref linkend="git-blame(1)" /></simpara>
\r
282 <simplesect id="git-annotate(1)__git">
\r
284 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r