Autogenerated HTML docs for v1.7.4.1-176-g501cc
[git/jnareb-git.git] / git-blame.html
blobc45b75ea5f019f44fedddd19b79403fac2344bc9
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-blame(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-blame(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-blame -
411 Show what revision and author last modified each line of a file
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="verseblock">
418 <div class="verseblock-content"><em>git blame</em> [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental] [-L n,m]
419 [-S &lt;revs-file&gt;] [-M] [-C] [-C] [-C] [--since=&lt;date&gt;]
420 [&lt;rev&gt; | --contents &lt;file&gt; | --reverse &lt;rev&gt;] [--] &lt;file&gt;</div>
421 <div class="verseblock-attribution">
422 </div></div>
423 </div>
424 <h2 id="_description">DESCRIPTION</h2>
425 <div class="sectionbody">
426 <div class="paragraph"><p>Annotates each line in the given file with information from the revision which
427 last modified the line. Optionally, start annotating from the given revision.</p></div>
428 <div class="paragraph"><p>The command can also limit the range of lines annotated.</p></div>
429 <div class="paragraph"><p>The report does not tell you anything about lines which have been deleted or
430 replaced; you need to use a tool such as <em>git diff</em> or the "pickaxe"
431 interface briefly mentioned in the following paragraph.</p></div>
432 <div class="paragraph"><p>Apart from supporting file annotation, git also supports searching the
433 development history for when a code snippet occurred in a change. This makes it
434 possible to track when a code snippet was added to a file, moved or copied
435 between files, and eventually deleted or replaced. It works by searching for
436 a text string in the diff. A small example:</p></div>
437 <div class="listingblock">
438 <div class="content">
439 <pre><tt>$ git log --pretty=oneline -S'blame_usage'
440 5040f17eba15504bad66b14a645bddd9b015ebb7 blame -S &lt;ancestry-file&gt;
441 ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output</tt></pre>
442 </div></div>
443 </div>
444 <h2 id="_options">OPTIONS</h2>
445 <div class="sectionbody">
446 <div class="dlist"><dl>
447 <dt class="hdlist1">
449 </dt>
450 <dd>
452 Show blank SHA-1 for boundary commits. This can also
453 be controlled via the <tt>blame.blankboundary</tt> config option.
454 </p>
455 </dd>
456 <dt class="hdlist1">
457 --root
458 </dt>
459 <dd>
461 Do not treat root commits as boundaries. This can also be
462 controlled via the <tt>blame.showroot</tt> config option.
463 </p>
464 </dd>
465 <dt class="hdlist1">
466 --show-stats
467 </dt>
468 <dd>
470 Include additional statistics at the end of blame output.
471 </p>
472 </dd>
473 <dt class="hdlist1">
474 -L &lt;start&gt;,&lt;end&gt;
475 </dt>
476 <dd>
478 Annotate only the given line range. &lt;start&gt; and &lt;end&gt; can take
479 one of these forms:
480 </p>
481 <div class="ulist"><ul>
482 <li>
484 number
485 </p>
486 <div class="paragraph"><p>If &lt;start&gt; or &lt;end&gt; is a number, it specifies an
487 absolute line number (lines count from 1).</p></div>
488 </li>
489 <li>
491 /regex/
492 </p>
493 <div class="paragraph"><p>This form will use the first line matching the given
494 POSIX regex. If &lt;end&gt; is a regex, it will search
495 starting at the line given by &lt;start&gt;.</p></div>
496 </li>
497 <li>
499 +offset or -offset
500 </p>
501 <div class="paragraph"><p>This is only valid for &lt;end&gt; and will specify a number
502 of lines before or after the line given by &lt;start&gt;.</p></div>
503 </li>
504 </ul></div>
505 </dd>
506 <dt class="hdlist1">
508 </dt>
509 <dd>
511 Show long rev (Default: off).
512 </p>
513 </dd>
514 <dt class="hdlist1">
516 </dt>
517 <dd>
519 Show raw timestamp (Default: off).
520 </p>
521 </dd>
522 <dt class="hdlist1">
523 -S &lt;revs-file&gt;
524 </dt>
525 <dd>
527 Use revisions from revs-file instead of calling <a href="git-rev-list.html">git-rev-list(1)</a>.
528 </p>
529 </dd>
530 <dt class="hdlist1">
531 --reverse
532 </dt>
533 <dd>
535 Walk history forward instead of backward. Instead of showing
536 the revision in which a line appeared, this shows the last
537 revision in which a line has existed. This requires a range of
538 revision like START..END where the path to blame exists in
539 START.
540 </p>
541 </dd>
542 <dt class="hdlist1">
544 </dt>
545 <dt class="hdlist1">
546 --porcelain
547 </dt>
548 <dd>
550 Show in a format designed for machine consumption.
551 </p>
552 </dd>
553 <dt class="hdlist1">
554 --incremental
555 </dt>
556 <dd>
558 Show the result incrementally in a format designed for
559 machine consumption.
560 </p>
561 </dd>
562 <dt class="hdlist1">
563 --encoding=&lt;encoding&gt;
564 </dt>
565 <dd>
567 Specifies the encoding used to output author names
568 and commit summaries. Setting it to <tt>none</tt> makes blame
569 output unconverted data. For more information see the
570 discussion about encoding in the <a href="git-log.html">git-log(1)</a>
571 manual page.
572 </p>
573 </dd>
574 <dt class="hdlist1">
575 --contents &lt;file&gt;
576 </dt>
577 <dd>
579 When &lt;rev&gt; is not specified, the command annotates the
580 changes starting backwards from the working tree copy.
581 This flag makes the command pretend as if the working
582 tree copy has the contents of the named file (specify
583 <tt>-</tt> to make the command read from the standard input).
584 </p>
585 </dd>
586 <dt class="hdlist1">
587 --date &lt;format&gt;
588 </dt>
589 <dd>
591 The value is one of the following alternatives:
592 {relative,local,default,iso,rfc,short}. If --date is not
593 provided, the value of the blame.date config variable is
594 used. If the blame.date config variable is also not set, the
595 iso format is used. For more information, See the discussion
596 of the --date option at <a href="git-log.html">git-log(1)</a>.
597 </p>
598 </dd>
599 <dt class="hdlist1">
600 -M|&lt;num&gt;|
601 </dt>
602 <dd>
604 Detect moved or copied lines within a file. When a commit
605 moves or copies a block of lines (e.g. the original file
606 has A and then B, and the commit changes it to B and then
607 A), the traditional <em>blame</em> algorithm notices only half of
608 the movement and typically blames the lines that were moved
609 up (i.e. B) to the parent and assigns blame to the lines that
610 were moved down (i.e. A) to the child commit. With this
611 option, both groups of lines are blamed on the parent by
612 running extra passes of inspection.
613 </p>
614 <div class="paragraph"><p>&lt;num&gt; is optional but it is the lower bound on the number of
615 alphanumeric characters that git must detect as moving/copying
616 within a file for it to associate those lines with the parent
617 commit. The default value is 20.</p></div>
618 </dd>
619 <dt class="hdlist1">
620 -C|&lt;num&gt;|
621 </dt>
622 <dd>
624 In addition to <tt>-M</tt>, detect lines moved or copied from other
625 files that were modified in the same commit. This is
626 useful when you reorganize your program and move code
627 around across files. When this option is given twice,
628 the command additionally looks for copies from other
629 files in the commit that creates the file. When this
630 option is given three times, the command additionally
631 looks for copies from other files in any commit.
632 </p>
633 <div class="paragraph"><p>&lt;num&gt; is optional but it is the lower bound on the number of
634 alphanumeric characters that git must detect as moving/copying
635 between files for it to associate those lines with the parent
636 commit. And the default value is 40. If there are more than one
637 <tt>-C</tt> options given, the &lt;num&gt; argument of the last <tt>-C</tt> will
638 take effect.</p></div>
639 </dd>
640 <dt class="hdlist1">
642 </dt>
643 <dt class="hdlist1">
644 --help
645 </dt>
646 <dd>
648 Show help message.
649 </p>
650 </dd>
651 <dt class="hdlist1">
653 </dt>
654 <dd>
656 Use the same output mode as <a href="git-annotate.html">git-annotate(1)</a> (Default: off).
657 </p>
658 </dd>
659 <dt class="hdlist1">
660 --score-debug
661 </dt>
662 <dd>
664 Include debugging information related to the movement of
665 lines between files (see <tt>-C</tt>) and lines moved within a
666 file (see <tt>-M</tt>). The first number listed is the score.
667 This is the number of alphanumeric characters detected
668 as having been moved between or within files. This must be above
669 a certain threshold for <em>git blame</em> to consider those lines
670 of code to have been moved.
671 </p>
672 </dd>
673 <dt class="hdlist1">
675 </dt>
676 <dt class="hdlist1">
677 --show-name
678 </dt>
679 <dd>
681 Show the filename in the original commit. By default
682 the filename is shown if there is any line that came from a
683 file with a different name, due to rename detection.
684 </p>
685 </dd>
686 <dt class="hdlist1">
688 </dt>
689 <dt class="hdlist1">
690 --show-number
691 </dt>
692 <dd>
694 Show the line number in the original commit (Default: off).
695 </p>
696 </dd>
697 <dt class="hdlist1">
699 </dt>
700 <dd>
702 Suppress the author name and timestamp from the output.
703 </p>
704 </dd>
705 <dt class="hdlist1">
707 </dt>
708 <dt class="hdlist1">
709 --show-email
710 </dt>
711 <dd>
713 Show the author email instead of author name (Default: off).
714 </p>
715 </dd>
716 <dt class="hdlist1">
718 </dt>
719 <dd>
721 Ignore whitespace when comparing the parent&#8217;s version and
722 the child&#8217;s to find where the lines came from.
723 </p>
724 </dd>
725 </dl></div>
726 </div>
727 <h2 id="_the_porcelain_format">THE PORCELAIN FORMAT</h2>
728 <div class="sectionbody">
729 <div class="paragraph"><p>In this format, each line is output after a header; the
730 header at the minimum has the first line which has:</p></div>
731 <div class="ulist"><ul>
732 <li>
734 40-byte SHA-1 of the commit the line is attributed to;
735 </p>
736 </li>
737 <li>
739 the line number of the line in the original file;
740 </p>
741 </li>
742 <li>
744 the line number of the line in the final file;
745 </p>
746 </li>
747 <li>
749 on a line that starts a group of lines from a different
750 commit than the previous one, the number of lines in this
751 group. On subsequent lines this field is absent.
752 </p>
753 </li>
754 </ul></div>
755 <div class="paragraph"><p>This header line is followed by the following information
756 at least once for each commit:</p></div>
757 <div class="ulist"><ul>
758 <li>
760 the author name ("author"), email ("author-mail"), time
761 ("author-time"), and timezone ("author-tz"); similarly
762 for committer.
763 </p>
764 </li>
765 <li>
767 the filename in the commit that the line is attributed to.
768 </p>
769 </li>
770 <li>
772 the first line of the commit log message ("summary").
773 </p>
774 </li>
775 </ul></div>
776 <div class="paragraph"><p>The contents of the actual line is output after the above
777 header, prefixed by a TAB. This is to allow adding more
778 header elements later.</p></div>
779 </div>
780 <h2 id="_specifying_ranges">SPECIFYING RANGES</h2>
781 <div class="sectionbody">
782 <div class="paragraph"><p>Unlike <em>git blame</em> and <em>git annotate</em> in older versions of git, the extent
783 of the annotation can be limited to both line ranges and revision
784 ranges. When you are interested in finding the origin for
785 lines 40-60 for file <tt>foo</tt>, you can use the <tt>-L</tt> option like so
786 (they mean the same thing&#8201;&#8212;&#8201;both ask for 21 lines starting at
787 line 40):</p></div>
788 <div class="literalblock">
789 <div class="content">
790 <pre><tt>git blame -L 40,60 foo
791 git blame -L 40,+21 foo</tt></pre>
792 </div></div>
793 <div class="paragraph"><p>Also you can use a regular expression to specify the line range:</p></div>
794 <div class="literalblock">
795 <div class="content">
796 <pre><tt>git blame -L '/^sub hello {/,/^}$/' foo</tt></pre>
797 </div></div>
798 <div class="paragraph"><p>which limits the annotation to the body of the <tt>hello</tt> subroutine.</p></div>
799 <div class="paragraph"><p>When you are not interested in changes older than version
800 v2.6.18, or changes older than 3 weeks, you can use revision
801 range specifiers similar to <em>git rev-list</em>:</p></div>
802 <div class="literalblock">
803 <div class="content">
804 <pre><tt>git blame v2.6.18.. -- foo
805 git blame --since=3.weeks -- foo</tt></pre>
806 </div></div>
807 <div class="paragraph"><p>When revision range specifiers are used to limit the annotation,
808 lines that have not changed since the range boundary (either the
809 commit v2.6.18 or the most recent commit that is more than 3
810 weeks old in the above example) are blamed for that range
811 boundary commit.</p></div>
812 <div class="paragraph"><p>A particularly useful way is to see if an added file has lines
813 created by copy-and-paste from existing files. Sometimes this
814 indicates that the developer was being sloppy and did not
815 refactor the code properly. You can first find the commit that
816 introduced the file with:</p></div>
817 <div class="literalblock">
818 <div class="content">
819 <pre><tt>git log --diff-filter=A --pretty=short -- foo</tt></pre>
820 </div></div>
821 <div class="paragraph"><p>and then annotate the change between the commit and its
822 parents, using <tt>commit&#94;!</tt> notation:</p></div>
823 <div class="literalblock">
824 <div class="content">
825 <pre><tt>git blame -C -C -f $commit^! -- foo</tt></pre>
826 </div></div>
827 </div>
828 <h2 id="_incremental_output">INCREMENTAL OUTPUT</h2>
829 <div class="sectionbody">
830 <div class="paragraph"><p>When called with <tt>--incremental</tt> option, the command outputs the
831 result as it is built. The output generally will talk about
832 lines touched by more recent commits first (i.e. the lines will
833 be annotated out of order) and is meant to be used by
834 interactive viewers.</p></div>
835 <div class="paragraph"><p>The output format is similar to the Porcelain format, but it
836 does not contain the actual lines from the file that is being
837 annotated.</p></div>
838 <div class="olist arabic"><ol class="arabic">
839 <li>
841 Each blame entry always starts with a line of:
842 </p>
843 <div class="literalblock">
844 <div class="content">
845 <pre><tt>&lt;40-byte hex sha1&gt; &lt;sourceline&gt; &lt;resultline&gt; &lt;num_lines&gt;</tt></pre>
846 </div></div>
847 <div class="paragraph"><p>Line numbers count from 1.</p></div>
848 </li>
849 <li>
851 The first time that a commit shows up in the stream, it has various
852 other information about it printed out with a one-word tag at the
853 beginning of each line describing the extra commit information (author,
854 email, committer, dates, summary, etc.).
855 </p>
856 </li>
857 <li>
859 Unlike the Porcelain format, the filename information is always
860 given and terminates the entry:
861 </p>
862 <div class="literalblock">
863 <div class="content">
864 <pre><tt>"filename" &lt;whitespace-quoted-filename-goes-here&gt;</tt></pre>
865 </div></div>
866 <div class="paragraph"><p>and thus it is really quite easy to parse for some line- and word-oriented
867 parser (which should be quite natural for most scripting languages).</p></div>
868 <div class="admonitionblock">
869 <table><tr>
870 <td class="icon">
871 <div class="title">Note</div>
872 </td>
873 <td class="content">For people who do parsing: to make it more robust, just ignore any
874 lines between the first and last one ("&lt;sha1&gt;" and "filename" lines)
875 where you do not recognize the tag words (or care about that particular
876 one) at the beginning of the "extended information" lines. That way, if
877 there is ever added information (like the commit encoding or extended
878 commit commentary), a blame viewer will not care.</td>
879 </tr></table>
880 </div>
881 </li>
882 </ol></div>
883 </div>
884 <h2 id="_mapping_authors">MAPPING AUTHORS</h2>
885 <div class="sectionbody">
886 <div class="paragraph"><p>If the file <tt>.mailmap</tt> exists at the toplevel of the repository, or at
887 the location pointed to by the mailmap.file configuration option, it
888 is used to map author and committer names and email addresses to
889 canonical real names and email addresses.</p></div>
890 <div class="paragraph"><p>In the simple form, each line in the file consists of the canonical
891 real name of an author, whitespace, and an email address used in the
892 commit (enclosed by <em>&lt;</em> and <em>&gt;</em>) to map to the name. For example:</p></div>
893 <div class="literalblock">
894 <div class="content">
895 <pre><tt>Proper Name &lt;commit@email.xx&gt;</tt></pre>
896 </div></div>
897 <div class="paragraph"><p>The more complex forms are:</p></div>
898 <div class="literalblock">
899 <div class="content">
900 <pre><tt>&lt;proper@email.xx&gt; &lt;commit@email.xx&gt;</tt></pre>
901 </div></div>
902 <div class="paragraph"><p>which allows mailmap to replace only the email part of a commit, and:</p></div>
903 <div class="literalblock">
904 <div class="content">
905 <pre><tt>Proper Name &lt;proper@email.xx&gt; &lt;commit@email.xx&gt;</tt></pre>
906 </div></div>
907 <div class="paragraph"><p>which allows mailmap to replace both the name and the email of a
908 commit matching the specified commit email address, and:</p></div>
909 <div class="literalblock">
910 <div class="content">
911 <pre><tt>Proper Name &lt;proper@email.xx&gt; Commit Name &lt;commit@email.xx&gt;</tt></pre>
912 </div></div>
913 <div class="paragraph"><p>which allows mailmap to replace both the name and the email of a
914 commit matching both the specified commit name and email address.</p></div>
915 <div class="paragraph"><p>Example 1: Your history contains commits by two authors, Jane
916 and Joe, whose names appear in the repository under several forms:</p></div>
917 <div class="listingblock">
918 <div class="content">
919 <pre><tt>Joe Developer &lt;joe@example.com&gt;
920 Joe R. Developer &lt;joe@example.com&gt;
921 Jane Doe &lt;jane@example.com&gt;
922 Jane Doe &lt;jane@laptop.(none)&gt;
923 Jane D. &lt;jane@desktop.(none)&gt;</tt></pre>
924 </div></div>
925 <div class="paragraph"><p>Now suppose that Joe wants his middle name initial used, and Jane
926 prefers her family name fully spelled out. A proper <tt>.mailmap</tt> file
927 would look like:</p></div>
928 <div class="listingblock">
929 <div class="content">
930 <pre><tt>Jane Doe &lt;jane@desktop.(none)&gt;
931 Joe R. Developer &lt;joe@example.com&gt;</tt></pre>
932 </div></div>
933 <div class="paragraph"><p>Note how there is no need for an entry for &lt;<a href="mailto:jane@laptop">jane@laptop</a>.(none)&gt;, because the
934 real name of that author is already correct.</p></div>
935 <div class="paragraph"><p>Example 2: Your repository contains commits from the following
936 authors:</p></div>
937 <div class="listingblock">
938 <div class="content">
939 <pre><tt>nick1 &lt;bugs@company.xx&gt;
940 nick2 &lt;bugs@company.xx&gt;
941 nick2 &lt;nick2@company.xx&gt;
942 santa &lt;me@company.xx&gt;
943 claus &lt;me@company.xx&gt;
944 CTO &lt;cto@coompany.xx&gt;</tt></pre>
945 </div></div>
946 <div class="paragraph"><p>Then you might want a <tt>.mailmap</tt> file that looks like:</p></div>
947 <div class="listingblock">
948 <div class="content">
949 <pre><tt>&lt;cto@company.xx&gt; &lt;cto@coompany.xx&gt;
950 Some Dude &lt;some@dude.xx&gt; nick1 &lt;bugs@company.xx&gt;
951 Other Author &lt;other@author.xx&gt; nick2 &lt;bugs@company.xx&gt;
952 Other Author &lt;other@author.xx&gt; &lt;nick2@company.xx&gt;
953 Santa Claus &lt;santa.claus@northpole.xx&gt; &lt;me@company.xx&gt;</tt></pre>
954 </div></div>
955 <div class="paragraph"><p>Use hash <em>#</em> for comments that are either on their own line, or after
956 the email address.</p></div>
957 </div>
958 <h2 id="_see_also">SEE ALSO</h2>
959 <div class="sectionbody">
960 <div class="paragraph"><p><a href="git-annotate.html">git-annotate(1)</a></p></div>
961 </div>
962 <h2 id="_author">AUTHOR</h2>
963 <div class="sectionbody">
964 <div class="paragraph"><p>Written by Junio C Hamano &lt;<a href="mailto:gitster@pobox.com">gitster@pobox.com</a>&gt;</p></div>
965 </div>
966 <h2 id="_git">GIT</h2>
967 <div class="sectionbody">
968 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
969 </div>
970 <div id="footer">
971 <div id="footer-text">
972 Last updated 2010-12-01 03:09:03 UTC
973 </div>
974 </div>
975 </body>
976 </html>