1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE sect2 SYSTEM "../../../dtd/dblite.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
145 --reverse <rev>..<rev>
\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
153 START. <emphasis>git blame --reverse START</emphasis> is taken as <emphasis>git blame
\r
154 --reverse START..HEAD</emphasis> for convenience.
\r
167 Show in a format designed for machine consumption.
\r
177 Show the porcelain format, but output commit information for
\r
178 each line, not just the first time a commit is referenced.
\r
179 Implies --porcelain.
\r
189 Show the result incrementally in a format designed for
\r
190 machine consumption.
\r
196 --encoding=<encoding>
\r
200 Specifies the encoding used to output author names
\r
201 and commit summaries. Setting it to <emphasis>none</emphasis> makes blame
\r
202 output unconverted data. For more information see the
\r
203 discussion about encoding in the <xref linkend="git-log(1)" />
\r
210 --contents <file>
\r
214 When <rev> is not specified, the command annotates the
\r
215 changes starting backwards from the working tree copy.
\r
216 This flag makes the command pretend as if the working
\r
217 tree copy has the contents of the named file (specify
\r
218 <emphasis>-</emphasis> to make the command read from the standard input).
\r
224 --date <format>
\r
228 Specifies the format used to output dates. If --date is not
\r
229 provided, the value of the blame.date config variable is
\r
230 used. If the blame.date config variable is also not set, the
\r
231 iso format is used. For supported values, see the discussion
\r
232 of the --date option at <xref linkend="git-log(1)" />.
\r
242 Progress status is reported on the standard error stream
\r
243 by default when it is attached to a terminal. This flag
\r
244 enables progress reporting even if not attached to a
\r
245 terminal. Can't use <emphasis>--progress</emphasis> together with <emphasis>--porcelain</emphasis>
\r
246 or <emphasis>--incremental</emphasis>.
\r
256 Detect moved or copied lines within a file. When a commit
\r
257 moves or copies a block of lines (e.g. the original file
\r
258 has A and then B, and the commit changes it to B and then
\r
259 A), the traditional <emphasis>blame</emphasis> algorithm notices only half of
\r
260 the movement and typically blames the lines that were moved
\r
261 up (i.e. B) to the parent and assigns blame to the lines that
\r
262 were moved down (i.e. A) to the child commit. With this
\r
263 option, both groups of lines are blamed on the parent by
\r
264 running extra passes of inspection.
\r
266 <simpara><num> is optional but it is the lower bound on the number of
\r
267 alphanumeric characters that Git must detect as moving/copying
\r
268 within a file for it to associate those lines with the parent
\r
269 commit. The default value is 20.</simpara>
\r
278 In addition to <emphasis>-M</emphasis>, detect lines moved or copied from other
\r
279 files that were modified in the same commit. This is
\r
280 useful when you reorganize your program and move code
\r
281 around across files. When this option is given twice,
\r
282 the command additionally looks for copies from other
\r
283 files in the commit that creates the file. When this
\r
284 option is given three times, the command additionally
\r
285 looks for copies from other files in any commit.
\r
287 <simpara><num> is optional but it is the lower bound on the number of
\r
288 alphanumeric characters that Git must detect as moving/copying
\r
289 between files for it to associate those lines with the parent
\r
290 commit. And the default value is 40. If there are more than one
\r
291 <emphasis>-C</emphasis> options given, the <num> argument of the last <emphasis>-C</emphasis> will
\r
292 take effect.</simpara>
\r
297 --ignore-rev <rev>
\r
301 Ignore changes made by the revision when assigning blame, as if the
\r
302 change never happened. Lines that were changed or added by an ignored
\r
303 commit will be blamed on the previous commit that changed that line or
\r
304 nearby lines. This option may be specified multiple times to ignore
\r
305 more than one revision. If the <emphasis>blame.markIgnoredLines</emphasis> config option
\r
306 is set, then lines that were changed by an ignored commit and attributed to
\r
307 another commit will be marked with a <emphasis>?</emphasis> in the blame output. If the
\r
308 <emphasis>blame.markUnblamableLines</emphasis> config option is set, then those lines touched
\r
309 by an ignored commit that we could not attribute to another revision are
\r
310 marked with a <emphasis>*</emphasis>.
\r
316 --ignore-revs-file <file>
\r
320 Ignore revisions listed in <emphasis>file</emphasis>, which must be in the same format as an
\r
321 <emphasis>fsck.skipList</emphasis>. This option may be repeated, and these files will be
\r
322 processed after any files specified with the <emphasis>blame.ignoreRevsFile</emphasis> config
\r
323 option. An empty file name, <emphasis>""</emphasis>, will clear the list of revs from
\r
324 previously processed files.
\r
340 <simplesect id="git-annotate(1)__see_also">
\r
341 <title>SEE ALSO</title>
\r
342 <simpara><xref linkend="git-blame(1)" /></simpara>
\r
344 <simplesect id="git-annotate(1)__git">
\r
346 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r