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
68 -L :<funcname>
\r
72 Annotate only the given line range. May be specified multiple times.
\r
73 Overlapping ranges are allowed.
\r
75 <simpara><start> and <end> are optional. -L <start> or -L <start>, spans from
\r
76 <start> to end of file. -L ,<end> spans from start of file to <end>.</simpara>
\r
77 <simpara><start> and <end> can take one of these forms:</simpara>
\r
83 <simpara>If <start> or <end> is a number, it specifies an
\r
84 absolute line number (lines count from 1).</simpara>
\r
90 <simpara>This form will use the first line matching the given
\r
91 POSIX regex. If <start> is a regex, it will search from the end of
\r
92 the previous <emphasis>-L</emphasis> range, if any, otherwise from the start of file.
\r
93 If <start> is ^/regex/, it will search from the start of file.
\r
94 If <end> is a regex, it will search
\r
95 starting at the line given by <start>.</simpara>
\r
101 <simpara>This is only valid for <end> and will specify a number
\r
102 of lines before or after the line given by <start>.</simpara>
\r
105 <simpara>If :<funcname> is given in place of <start> and <end>, it is a
\r
106 regular expression that denotes the range from the first funcname line
\r
107 that matches <funcname>, up to the next funcname line. :<funcname>
\r
108 searches from the end of the previous <emphasis>-L</emphasis> range, if any, otherwise
\r
109 from the start of file. ^:<funcname> searches from the start of
\r
119 Show long rev (Default: off).
\r
129 Show raw timestamp (Default: off).
\r
135 -S <revs-file>
\r
139 Use revisions from revs-file instead of calling <xref linkend="git-rev-list(1)" />.
\r
149 Walk history forward instead of backward. Instead of showing
\r
150 the revision in which a line appeared, this shows the last
\r
151 revision in which a line has existed. This requires a range of
\r
152 revision like START..END where the path to blame exists in
\r
166 Show in a format designed for machine consumption.
\r
176 Show the porcelain format, but output commit information for
\r
177 each line, not just the first time a commit is referenced.
\r
178 Implies --porcelain.
\r
188 Show the result incrementally in a format designed for
\r
189 machine consumption.
\r
195 --encoding=<encoding>
\r
199 Specifies the encoding used to output author names
\r
200 and commit summaries. Setting it to <emphasis>none</emphasis> makes blame
\r
201 output unconverted data. For more information see the
\r
202 discussion about encoding in the <xref linkend="git-log(1)" />
\r
209 --contents <file>
\r
213 When <rev> is not specified, the command annotates the
\r
214 changes starting backwards from the working tree copy.
\r
215 This flag makes the command pretend as if the working
\r
216 tree copy has the contents of the named file (specify
\r
217 <emphasis>-</emphasis> to make the command read from the standard input).
\r
223 --date <format>
\r
227 Specifies the format used to output dates. If --date is not
\r
228 provided, the value of the blame.date config variable is
\r
229 used. If the blame.date config variable is also not set, the
\r
230 iso format is used. For supported values, see the discussion
\r
231 of the --date option at <xref linkend="git-log(1)" />.
\r
241 Progress status is reported on the standard error stream
\r
242 by default when it is attached to a terminal. This flag
\r
243 enables progress reporting even if not attached to a
\r
244 terminal. Can't use <emphasis>--progress</emphasis> together with <emphasis>--porcelain</emphasis>
\r
245 or <emphasis>--incremental</emphasis>.
\r
255 Detect moved or copied lines within a file. When a commit
\r
256 moves or copies a block of lines (e.g. the original file
\r
257 has A and then B, and the commit changes it to B and then
\r
258 A), the traditional <emphasis>blame</emphasis> algorithm notices only half of
\r
259 the movement and typically blames the lines that were moved
\r
260 up (i.e. B) to the parent and assigns blame to the lines that
\r
261 were moved down (i.e. A) to the child commit. With this
\r
262 option, both groups of lines are blamed on the parent by
\r
263 running extra passes of inspection.
\r
265 <simpara><num> is optional but it is the lower bound on the number of
\r
266 alphanumeric characters that Git must detect as moving/copying
\r
267 within a file for it to associate those lines with the parent
\r
268 commit. The default value is 20.</simpara>
\r
277 In addition to <emphasis>-M</emphasis>, detect lines moved or copied from other
\r
278 files that were modified in the same commit. This is
\r
279 useful when you reorganize your program and move code
\r
280 around across files. When this option is given twice,
\r
281 the command additionally looks for copies from other
\r
282 files in the commit that creates the file. When this
\r
283 option is given three times, the command additionally
\r
284 looks for copies from other files in any commit.
\r
286 <simpara><num> is optional but it is the lower bound on the number of
\r
287 alphanumeric characters that Git must detect as moving/copying
\r
288 between files for it to associate those lines with the parent
\r
289 commit. And the default value is 40. If there are more than one
\r
290 <emphasis>-C</emphasis> options given, the <num> argument of the last <emphasis>-C</emphasis> will
\r
291 take effect.</simpara>
\r
306 <simplesect id="git-annotate(1)__see_also">
\r
307 <title>SEE ALSO</title>
\r
308 <simpara><xref linkend="git-blame(1)" /></simpara>
\r
310 <simplesect id="git-annotate(1)__git">
\r
312 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r