blob: d22cb120f7b1a5c23487e828df05ce5887cda69b [file] [log] [blame]
Junio C Hamanob33fb4f2006-04-18 21:30:511<!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" />
Junio C Hamano7bd050f2011-09-22 06:32:226<meta name="generator" content="AsciiDoc 8.5.2" />
Junio C Hamanoed69a742010-12-01 03:09:237<title>git-blame(1)</title>
Junio C Hamanob33fb4f2006-04-18 21:30:518<style type="text/css">
9/* Debug borders */
10p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
11/*
12 border: 1px solid red;
13*/
14}
15
16body {
17 margin: 1em 5% 1em 5%;
18}
19
Junio C Hamanoba4b9282008-07-06 05:20:3120a {
21 color: blue;
22 text-decoration: underline;
23}
24a:visited {
25 color: fuchsia;
26}
Junio C Hamanob33fb4f2006-04-18 21:30:5127
28em {
29 font-style: italic;
Junio C Hamanoed69a742010-12-01 03:09:2330 color: navy;
Junio C Hamanob33fb4f2006-04-18 21:30:5131}
32
33strong {
34 font-weight: bold;
Junio C Hamanoed69a742010-12-01 03:09:2335 color: #083194;
Junio C Hamanob33fb4f2006-04-18 21:30:5136}
37
38tt {
39 color: navy;
40}
41
42h1, 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;
48}
49
Junio C Hamanoba4b9282008-07-06 05:20:3150h1, h2, h3 {
Junio C Hamanob33fb4f2006-04-18 21:30:5151 border-bottom: 2px solid silver;
52}
53h2 {
Junio C Hamanob33fb4f2006-04-18 21:30:5154 padding-top: 0.5em;
55}
Junio C Hamanoba4b9282008-07-06 05:20:3156h3 {
57 float: left;
58}
59h3 + * {
60 clear: left;
61}
Junio C Hamanob33fb4f2006-04-18 21:30:5162
63div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
66}
67
68hr {
69 border: 1px solid silver;
70}
71
72p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
75}
76
Junio C Hamanoed69a742010-12-01 03:09:2377ul, ol, li > p {
78 margin-top: 0;
79}
80
Junio C Hamanob33fb4f2006-04-18 21:30:5181pre {
82 padding: 0;
83 margin: 0;
84}
85
86span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3190 font-size: 1.1em;
Junio C Hamanob33fb4f2006-04-18 21:30:5191}
92span#email {
93}
Junio C Hamanoed69a742010-12-01 03:09:2394span#revnumber, span#revdate, span#revremark {
Junio C Hamanob33fb4f2006-04-18 21:30:5195 font-family: sans-serif;
96}
97
98div#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;
104}
105div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
108}
109div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
112}
113
Junio C Hamanoed69a742010-12-01 03:09:23114div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
117}
Junio C Hamanob33fb4f2006-04-18 21:30:51118div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22121 margin-top: 1.0em;
Junio C Hamanob33fb4f2006-04-18 21:30:51122 margin-bottom: 1.5em;
123}
124div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
Junio C Hamanob33fb4f2006-04-18 21:30:51129}
130
131div.content { /* Block element content. */
132 padding: 0;
133}
134
135/* Block element titles. */
136div.title, caption.title {
Junio C Hamanoed69a742010-12-01 03:09:23137 color: #527bbd;
Junio C Hamanob33fb4f2006-04-18 21:30:51138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
143}
144div.title + * {
145 margin-top: 0;
146}
147
148td div.title:first-child {
149 margin-top: 0.0em;
150}
151div.content div.title:first-child {
152 margin-top: 0.0em;
153}
154div.content + div.title {
155 margin-top: 0.0em;
156}
157
158div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
162}
163
164div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
168}
169
Junio C Hamano7bd050f2011-09-22 06:32:22170div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
Junio C Hamanoed69a742010-12-01 03:09:23173 margin-right: 10%;
Junio C Hamano7bd050f2011-09-22 06:32:22174 border-left: 5px solid #dddddd;
175 color: #777777;
Junio C Hamanob33fb4f2006-04-18 21:30:51176}
Junio C Hamano7bd050f2011-09-22 06:32:22177
Junio C Hamanoed69a742010-12-01 03:09:23178div.quoteblock > div.attribution {
179 padding-top: 0.5em;
Junio C Hamanob33fb4f2006-04-18 21:30:51180 text-align: right;
181}
Junio C Hamanoed69a742010-12-01 03:09:23182
Junio C Hamanoed69a742010-12-01 03:09:23183div.verseblock > div.content {
184 white-space: pre;
185}
186div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
189}
190/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31191div.verseblock + div.attribution {
192 text-align: left;
193}
Junio C Hamanob33fb4f2006-04-18 21:30:51194
195div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
202}
203div.admonitionblock td.content {
204 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22205 border-left: 3px solid #dddddd;
Junio C Hamanob33fb4f2006-04-18 21:30:51206}
207
208div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
Junio C Hamanob33fb4f2006-04-18 21:30:51211}
212
Junio C Hamanob33fb4f2006-04-18 21:30:51213div.imageblock div.content { padding-left: 0; }
Junio C Hamanob33fb4f2006-04-18 21:30:51214span.image img { border-style: none; }
Junio C Hamanoed69a742010-12-01 03:09:23215a.image:visited { color: white; }
Junio C Hamanob33fb4f2006-04-18 21:30:51216
217dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
220}
221dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
Junio C Hamanoed69a742010-12-01 03:09:23224 font-style: normal;
225 color: navy;
Junio C Hamanob33fb4f2006-04-18 21:30:51226}
227dd > *:first-child {
Junio C Hamanoed69a742010-12-01 03:09:23228 margin-top: 0.1em;
Junio C Hamanob33fb4f2006-04-18 21:30:51229}
230
231ul, ol {
232 list-style-position: outside;
233}
Junio C Hamanoed69a742010-12-01 03:09:23234ol.arabic {
235 list-style-type: decimal;
236}
237ol.loweralpha {
Junio C Hamanob33fb4f2006-04-18 21:30:51238 list-style-type: lower-alpha;
239}
Junio C Hamanoed69a742010-12-01 03:09:23240ol.upperalpha {
241 list-style-type: upper-alpha;
242}
243ol.lowerroman {
244 list-style-type: lower-roman;
245}
246ol.upperroman {
247 list-style-type: upper-roman;
248}
249
250div.compact ul, div.compact ol,
251div.compact p, div.compact p,
252div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
255}
Junio C Hamanob33fb4f2006-04-18 21:30:51256
257div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31258 border: 3px solid #527bbd;
Junio C Hamanob33fb4f2006-04-18 21:30:51259}
Junio C Hamano7bd050f2011-09-22 06:32:22260thead, p.table.header {
Junio C Hamanob33fb4f2006-04-18 21:30:51261 font-family: sans-serif;
262 font-weight: bold;
263}
264tfoot {
265 font-weight: bold;
266}
Junio C Hamanoed69a742010-12-01 03:09:23267td > div.verse {
268 white-space: pre;
269}
270p.table {
271 margin-top: 0;
272}
273/* Because the table frame attribute is overriden by CSS in most browsers. */
274div.tableblock > table[frame="void"] {
275 border-style: none;
276}
277div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
280}
281div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
284}
Junio C Hamanob33fb4f2006-04-18 21:30:51285
Junio C Hamanoed69a742010-12-01 03:09:23286
287div.hdlist {
Junio C Hamanob33fb4f2006-04-18 21:30:51288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
290}
Junio C Hamanoed69a742010-12-01 03:09:23291div.hdlist tr {
292 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31293}
Junio C Hamanoed69a742010-12-01 03:09:23294dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
296}
297td.hdlist1 {
Junio C Hamanob33fb4f2006-04-18 21:30:51298 vertical-align: top;
Junio C Hamanoed69a742010-12-01 03:09:23299 font-style: normal;
Junio C Hamanob33fb4f2006-04-18 21:30:51300 padding-right: 0.8em;
Junio C Hamanoed69a742010-12-01 03:09:23301 color: navy;
Junio C Hamanob33fb4f2006-04-18 21:30:51302}
Junio C Hamanoed69a742010-12-01 03:09:23303td.hdlist2 {
Junio C Hamanob33fb4f2006-04-18 21:30:51304 vertical-align: top;
305}
Junio C Hamanoed69a742010-12-01 03:09:23306div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
309}
310
311.comment {
312 background: yellow;
313}
Junio C Hamanob33fb4f2006-04-18 21:30:51314
Junio C Hamano7bd050f2011-09-22 06:32:22315.footnote, .footnoteref {
316 font-size: 0.8em;
317}
318
319span.footnote, span.footnoteref {
320 vertical-align: super;
321}
322
323#footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
326}
327
328#footnotes div.footnote {
329 margin: 0 0 5px 0;
330}
331
332#footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
340}
341
342
Junio C Hamanob33fb4f2006-04-18 21:30:51343@media print {
344 div#footer-badges { display: none; }
345}
Junio C Hamanoba4b9282008-07-06 05:20:31346
Junio C Hamano7bd050f2011-09-22 06:32:22347div#toc {
348 margin-bottom: 2.5em;
349}
350
Junio C Hamanoba4b9282008-07-06 05:20:31351div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
358}
359
360div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
363}
364div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
367}
368div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
371}
372div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
375}
Junio C Hamanoed69a742010-12-01 03:09:23376/* Overrides for manpage documents */
377h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
382}
383h2 {
384 border-style: none;
385}
386div.sectionbody {
387 margin-left: 5%;
388}
389
390@media print {
391 div#toc { display: none; }
392}
393
Junio C Hamanob33fb4f2006-04-18 21:30:51394/* Workarounds for IE6's broken and incomplete CSS2. */
395
396div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
400}
401div.sidebar-title, div.image-title {
Junio C Hamanoed69a742010-12-01 03:09:23402 color: #527bbd;
Junio C Hamanob33fb4f2006-04-18 21:30:51403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
407}
408
409div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
413}
414
Junio C Hamanoed69a742010-12-01 03:09:23415div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
418}
419
420div.verseblock-content {
421 white-space: pre;
422}
423div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
Junio C Hamanob33fb4f2006-04-18 21:30:51426}
427
428div.exampleblock-content {
Junio C Hamano7bd050f2011-09-22 06:32:22429 border-left: 3px solid #dddddd;
Junio C Hamanob33fb4f2006-04-18 21:30:51430 padding-left: 0.5em;
431}
Junio C Hamanoba4b9282008-07-06 05:20:31432
433/* IE6 sets dynamically generated links as visited. */
434div#toc a:visited { color: blue; }
Junio C Hamanob33fb4f2006-04-18 21:30:51435</style>
Junio C Hamano7bd050f2011-09-22 06:32:22436<script type="text/javascript">
437/*<![CDATA[*/
438window.onload = function(){asciidoc.footnotes();}
439var asciidoc = { // Namespace.
440
441/////////////////////////////////////////////////////////////////////
442// Table Of Contents generator
443/////////////////////////////////////////////////////////////////////
444
445/* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
447 *
448 * Table Of Content generator
449 * Version: 0.4
450 *
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
453 */
454
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
457
458// toclevels = 1..4.
459toc: function (toclevels) {
460
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
468 }
469 return text;
470 }
471
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
476 }
477
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
490 }
491 iterate(i);
492 }
493 }
494 }
495 iterate(el);
496 return result;
497 }
498
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
512 }
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
515},
516
517
518/////////////////////////////////////////////////////////////////////
519// Footnotes generator
520/////////////////////////////////////////////////////////////////////
521
522/* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
524 */
525
526footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
547 }
548 }
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
561 }
562 }
563 }
564}
565
566}
567/*]]>*/
568</script>
Junio C Hamanob33fb4f2006-04-18 21:30:51569</head>
570<body>
571<div id="header">
572<h1>
573git-blame(1) Manual Page
574</h1>
575<h2>NAME</h2>
576<div class="sectionbody">
577<p>git-blame -
Junio C Hamano6b2cee12006-08-26 08:43:31578 Show what revision and author last modified each line of a file
Junio C Hamanob33fb4f2006-04-18 21:30:51579</p>
580</div>
581</div>
Junio C Hamano7bd050f2011-09-22 06:32:22582<div id="content">
Junio C Hamanoed69a742010-12-01 03:09:23583<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamanob33fb4f2006-04-18 21:30:51584<div class="sectionbody">
Junio C Hamanoe1aa7472006-11-09 07:37:50585<div class="verseblock">
Junio C Hamanoed69a742010-12-01 03:09:23586<div class="verseblock-content"><em>git blame</em> [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental] [-L n,m]
Junio C Hamano209ebe82011-04-27 21:09:59587 [-S &lt;revs-file&gt;] [-M] [-C] [-C] [-C] [--since=&lt;date&gt;] [--abbrev=&lt;n&gt;]
Junio C Hamanoed69a742010-12-01 03:09:23588 [&lt;rev&gt; | --contents &lt;file&gt; | --reverse &lt;rev&gt;] [--] &lt;file&gt;</div>
589<div class="verseblock-attribution">
590</div></div>
Junio C Hamanob33fb4f2006-04-18 21:30:51591</div>
Junio C Hamanoba4b9282008-07-06 05:20:31592<h2 id="_description">DESCRIPTION</h2>
Junio C Hamanob33fb4f2006-04-18 21:30:51593<div class="sectionbody">
Junio C Hamanoed69a742010-12-01 03:09:23594<div class="paragraph"><p>Annotates each line in the given file with information from the revision which
Junio C Hamanoba4b9282008-07-06 05:20:31595last modified the line. Optionally, start annotating from the given revision.</p></div>
Junio C Hamanoed69a742010-12-01 03:09:23596<div class="paragraph"><p>The command can also limit the range of lines annotated.</p></div>
597<div class="paragraph"><p>The report does not tell you anything about lines which have been deleted or
Junio C Hamano1aa40d22010-01-21 17:46:43598replaced; you need to use a tool such as <em>git diff</em> or the "pickaxe"
Junio C Hamanoba4b9282008-07-06 05:20:31599interface briefly mentioned in the following paragraph.</p></div>
Junio C Hamanoed69a742010-12-01 03:09:23600<div class="paragraph"><p>Apart from supporting file annotation, git also supports searching the
Junio C Hamanof9771f62007-01-17 17:42:30601development history for when a code snippet occurred in a change. This makes it
Junio C Hamano6b2cee12006-08-26 08:43:31602possible to track when a code snippet was added to a file, moved or copied
603between files, and eventually deleted or replaced. It works by searching for
Junio C Hamanoba4b9282008-07-06 05:20:31604a text string in the diff. A small example:</p></div>
Junio C Hamano6b2cee12006-08-26 08:43:31605<div class="listingblock">
606<div class="content">
607<pre><tt>$ git log --pretty=oneline -S'blame_usage'
6085040f17eba15504bad66b14a645bddd9b015ebb7 blame -S &lt;ancestry-file&gt;
609ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output</tt></pre>
610</div></div>
Junio C Hamanob33fb4f2006-04-18 21:30:51611</div>
Junio C Hamanoba4b9282008-07-06 05:20:31612<h2 id="_options">OPTIONS</h2>
Junio C Hamanob33fb4f2006-04-18 21:30:51613<div class="sectionbody">
Junio C Hamanoed69a742010-12-01 03:09:23614<div class="dlist"><dl>
615<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11616-b
Junio C Hamanob33fb4f2006-04-18 21:30:51617</dt>
618<dd>
619<p>
Junio C Hamano0e3cb532007-04-17 08:28:11620 Show blank SHA-1 for boundary commits. This can also
621 be controlled via the <tt>blame.blankboundary</tt> config option.
622</p>
623</dd>
Junio C Hamanoed69a742010-12-01 03:09:23624<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11625--root
626</dt>
627<dd>
628<p>
629 Do not treat root commits as boundaries. This can also be
630 controlled via the <tt>blame.showroot</tt> config option.
631</p>
632</dd>
Junio C Hamanoed69a742010-12-01 03:09:23633<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11634--show-stats
635</dt>
636<dd>
637<p>
638 Include additional statistics at the end of blame output.
Junio C Hamanob33fb4f2006-04-18 21:30:51639</p>
640</dd>
Junio C Hamanoed69a742010-12-01 03:09:23641<dt class="hdlist1">
Junio C Hamano9882a522007-04-27 08:22:22642-L &lt;start&gt;,&lt;end&gt;
Junio C Hamanoe1aa7472006-11-09 07:37:50643</dt>
644<dd>
645<p>
Junio C Hamano9882a522007-04-27 08:22:22646 Annotate only the given line range. &lt;start&gt; and &lt;end&gt; can take
647 one of these forms:
Junio C Hamanoe1aa7472006-11-09 07:37:50648</p>
Junio C Hamanoed69a742010-12-01 03:09:23649<div class="ulist"><ul>
Junio C Hamano9882a522007-04-27 08:22:22650<li>
651<p>
652number
653</p>
Junio C Hamanoed69a742010-12-01 03:09:23654<div class="paragraph"><p>If &lt;start&gt; or &lt;end&gt; is a number, it specifies an
Junio C Hamanoba4b9282008-07-06 05:20:31655absolute line number (lines count from 1).</p></div>
Junio C Hamano9882a522007-04-27 08:22:22656</li>
657<li>
658<p>
659/regex/
660</p>
Junio C Hamanoed69a742010-12-01 03:09:23661<div class="paragraph"><p>This form will use the first line matching the given
Junio C Hamano9882a522007-04-27 08:22:22662POSIX regex. If &lt;end&gt; is a regex, it will search
Junio C Hamanoba4b9282008-07-06 05:20:31663starting at the line given by &lt;start&gt;.</p></div>
Junio C Hamano9882a522007-04-27 08:22:22664</li>
665<li>
666<p>
667+offset or -offset
668</p>
Junio C Hamanoed69a742010-12-01 03:09:23669<div class="paragraph"><p>This is only valid for &lt;end&gt; and will specify a number
Junio C Hamanoba4b9282008-07-06 05:20:31670of lines before or after the line given by &lt;start&gt;.</p></div>
Junio C Hamano9882a522007-04-27 08:22:22671</li>
Junio C Hamanoba4b9282008-07-06 05:20:31672</ul></div>
Junio C Hamanoe1aa7472006-11-09 07:37:50673</dd>
Junio C Hamanoed69a742010-12-01 03:09:23674<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11675-l
Junio C Hamanob33fb4f2006-04-18 21:30:51676</dt>
677<dd>
678<p>
Junio C Hamano3fd90c82006-06-18 00:22:01679 Show long rev (Default: off).
680</p>
681</dd>
Junio C Hamanoed69a742010-12-01 03:09:23682<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11683-t
Junio C Hamano3fd90c82006-06-18 00:22:01684</dt>
685<dd>
686<p>
687 Show raw timestamp (Default: off).
Junio C Hamanob33fb4f2006-04-18 21:30:51688</p>
689</dd>
Junio C Hamanoed69a742010-12-01 03:09:23690<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11691-S &lt;revs-file&gt;
Junio C Hamanob33fb4f2006-04-18 21:30:51692</dt>
693<dd>
694<p>
Junio C Hamanofd83b8e2009-03-22 08:21:41695 Use revisions from revs-file instead of calling <a href="git-rev-list.html">git-rev-list(1)</a>.
Junio C Hamanob33fb4f2006-04-18 21:30:51696</p>
697</dd>
Junio C Hamanoed69a742010-12-01 03:09:23698<dt class="hdlist1">
Junio C Hamanoa6455f62009-02-20 08:33:08699--reverse
700</dt>
701<dd>
702<p>
703 Walk history forward instead of backward. Instead of showing
704 the revision in which a line appeared, this shows the last
705 revision in which a line has existed. This requires a range of
706 revision like START..END where the path to blame exists in
707 START.
708</p>
709</dd>
Junio C Hamanoed69a742010-12-01 03:09:23710<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47711-p
712</dt>
Junio C Hamanoed69a742010-12-01 03:09:23713<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47714--porcelain
Junio C Hamanoff4b4312006-10-25 22:55:31715</dt>
716<dd>
717<p>
718 Show in a format designed for machine consumption.
719</p>
720</dd>
Junio C Hamanoed69a742010-12-01 03:09:23721<dt class="hdlist1">
Junio C Hamano2a294cd2011-05-23 23:06:31722--line-porcelain
723</dt>
724<dd>
725<p>
726 Show the porcelain format, but output commit information for
727 each line, not just the first time a commit is referenced.
728 Implies --porcelain.
729</p>
730</dd>
731<dt class="hdlist1">
Junio C Hamano5a702332007-01-28 20:55:22732--incremental
733</dt>
734<dd>
735<p>
736 Show the result incrementally in a format designed for
737 machine consumption.
738</p>
739</dd>
Junio C Hamanoed69a742010-12-01 03:09:23740<dt class="hdlist1">
Junio C Hamanoaa17c7c2008-11-03 04:36:58741--encoding=&lt;encoding&gt;
742</dt>
743<dd>
744<p>
745 Specifies the encoding used to output author names
746 and commit summaries. Setting it to <tt>none</tt> makes blame
747 output unconverted data. For more information see the
748 discussion about encoding in the <a href="git-log.html">git-log(1)</a>
749 manual page.
750</p>
751</dd>
Junio C Hamanoed69a742010-12-01 03:09:23752<dt class="hdlist1">
Junio C Hamano42f855f2007-02-06 00:09:38753--contents &lt;file&gt;
754</dt>
755<dd>
756<p>
757 When &lt;rev&gt; is not specified, the command annotates the
758 changes starting backwards from the working tree copy.
759 This flag makes the command pretend as if the working
Junio C Hamano49dccaf2008-02-10 10:48:01760 tree copy has the contents of the named file (specify
Junio C Hamano42f855f2007-02-06 00:09:38761 <tt>-</tt> to make the command read from the standard input).
762</p>
763</dd>
Junio C Hamanoed69a742010-12-01 03:09:23764<dt class="hdlist1">
Junio C Hamanoea6a7642009-03-11 23:56:19765--date &lt;format&gt;
766</dt>
767<dd>
768<p>
769 The value is one of the following alternatives:
770 {relative,local,default,iso,rfc,short}. If --date is not
771 provided, the value of the blame.date config variable is
772 used. If the blame.date config variable is also not set, the
773 iso format is used. For more information, See the discussion
774 of the --date option at <a href="git-log.html">git-log(1)</a>.
775</p>
776</dd>
Junio C Hamanoed69a742010-12-01 03:09:23777<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11778-M|&lt;num&gt;|
Junio C Hamanoe1aa7472006-11-09 07:37:50779</dt>
780<dd>
781<p>
Junio C Hamano0e8c0b02010-04-12 15:45:55782 Detect moved or copied lines within a file. When a commit
783 moves or copies a block of lines (e.g. the original file
784 has A and then B, and the commit changes it to B and then
785 A), the traditional <em>blame</em> algorithm notices only half of
786 the movement and typically blames the lines that were moved
787 up (i.e. B) to the parent and assigns blame to the lines that
788 were moved down (i.e. A) to the child commit. With this
789 option, both groups of lines are blamed on the parent by
790 running extra passes of inspection.
Junio C Hamanoe1aa7472006-11-09 07:37:50791</p>
Junio C Hamanoed69a742010-12-01 03:09:23792<div class="paragraph"><p>&lt;num&gt; is optional but it is the lower bound on the number of
Junio C Hamanocc7636a2010-05-21 14:57:53793alphanumeric characters that git must detect as moving/copying
Junio C Hamano0e3cb532007-04-17 08:28:11794within a file for it to associate those lines with the parent
Junio C Hamanocc7636a2010-05-21 14:57:53795commit. The default value is 20.</p></div>
Junio C Hamanoe1aa7472006-11-09 07:37:50796</dd>
Junio C Hamanoed69a742010-12-01 03:09:23797<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11798-C|&lt;num&gt;|
Junio C Hamanoe1aa7472006-11-09 07:37:50799</dt>
800<dd>
801<p>
Junio C Hamano0e8c0b02010-04-12 15:45:55802 In addition to <tt>-M</tt>, detect lines moved or copied from other
Junio C Hamanoe1aa7472006-11-09 07:37:50803 files that were modified in the same commit. This is
804 useful when you reorganize your program and move code
805 around across files. When this option is given twice,
Junio C Hamano5ca1dd12010-01-17 02:44:04806 the command additionally looks for copies from other
807 files in the commit that creates the file. When this
808 option is given three times, the command additionally
809 looks for copies from other files in any commit.
Junio C Hamanoe1aa7472006-11-09 07:37:50810</p>
Junio C Hamanoed69a742010-12-01 03:09:23811<div class="paragraph"><p>&lt;num&gt; is optional but it is the lower bound on the number of
Junio C Hamanocc7636a2010-05-21 14:57:53812alphanumeric characters that git must detect as moving/copying
Junio C Hamano0e3cb532007-04-17 08:28:11813between files for it to associate those lines with the parent
Junio C Hamanocc7636a2010-05-21 14:57:53814commit. And the default value is 40. If there are more than one
815<tt>-C</tt> options given, the &lt;num&gt; argument of the last <tt>-C</tt> will
816take effect.</p></div>
Junio C Hamanoe1aa7472006-11-09 07:37:50817</dd>
Junio C Hamanoed69a742010-12-01 03:09:23818<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47819-h
820</dt>
Junio C Hamanob33fb4f2006-04-18 21:30:51821<dd>
822<p>
823 Show help message.
824</p>
825</dd>
Junio C Hamanoed69a742010-12-01 03:09:23826<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11827-c
828</dt>
829<dd>
830<p>
831 Use the same output mode as <a href="git-annotate.html">git-annotate(1)</a> (Default: off).
832</p>
833</dd>
Junio C Hamanoed69a742010-12-01 03:09:23834<dt class="hdlist1">
Junio C Hamano0e3cb532007-04-17 08:28:11835--score-debug
836</dt>
837<dd>
838<p>
839 Include debugging information related to the movement of
840 lines between files (see <tt>-C</tt>) and lines moved within a
841 file (see <tt>-M</tt>). The first number listed is the score.
842 This is the number of alphanumeric characters detected
Junio C Hamanofd83b8e2009-03-22 08:21:41843 as having been moved between or within files. This must be above
Junio C Hamano1aa40d22010-01-21 17:46:43844 a certain threshold for <em>git blame</em> to consider those lines
Junio C Hamano0e3cb532007-04-17 08:28:11845 of code to have been moved.
846</p>
847</dd>
Junio C Hamanoed69a742010-12-01 03:09:23848<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47849-f
850</dt>
Junio C Hamanoed69a742010-12-01 03:09:23851<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47852--show-name
Junio C Hamano0e3cb532007-04-17 08:28:11853</dt>
854<dd>
855<p>
Junio C Hamanofd83b8e2009-03-22 08:21:41856 Show the filename in the original commit. By default
857 the filename is shown if there is any line that came from a
858 file with a different name, due to rename detection.
Junio C Hamano0e3cb532007-04-17 08:28:11859</p>
860</dd>
Junio C Hamanoed69a742010-12-01 03:09:23861<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47862-n
863</dt>
Junio C Hamanoed69a742010-12-01 03:09:23864<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47865--show-number
Junio C Hamano0e3cb532007-04-17 08:28:11866</dt>
867<dd>
868<p>
Junio C Hamanofd83b8e2009-03-22 08:21:41869 Show the line number in the original commit (Default: off).
Junio C Hamano0e3cb532007-04-17 08:28:11870</p>
871</dd>
Junio C Hamanoed69a742010-12-01 03:09:23872<dt class="hdlist1">
Junio C Hamano469d60e2007-04-29 18:30:34873-s
874</dt>
875<dd>
876<p>
Junio C Hamanofd83b8e2009-03-22 08:21:41877 Suppress the author name and timestamp from the output.
Junio C Hamano469d60e2007-04-29 18:30:34878</p>
879</dd>
Junio C Hamanoed69a742010-12-01 03:09:23880<dt class="hdlist1">
881-e
882</dt>
883<dt class="hdlist1">
884--show-email
885</dt>
886<dd>
887<p>
888 Show the author email instead of author name (Default: off).
889</p>
890</dd>
891<dt class="hdlist1">
Junio C Hamano9e52d4e2007-06-13 08:29:33892-w
893</dt>
894<dd>
895<p>
Junio C Hamanoed69a742010-12-01 03:09:23896 Ignore whitespace when comparing the parent&#8217;s version and
897 the child&#8217;s to find where the lines came from.
Junio C Hamano9e52d4e2007-06-13 08:29:33898</p>
899</dd>
Junio C Hamano209ebe82011-04-27 21:09:59900<dt class="hdlist1">
901--abbrev=&lt;n&gt;
902</dt>
903<dd>
904<p>
905 Instead of using the default 7+1 hexadecimal digits as the
906 abbreviated object name, use &lt;n&gt;+1 digits. Note that 1 column
907 is used for a caret to mark the boundary commit.
908</p>
909</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31910</dl></div>
Junio C Hamanob33fb4f2006-04-18 21:30:51911</div>
Junio C Hamanoba4b9282008-07-06 05:20:31912<h2 id="_the_porcelain_format">THE PORCELAIN FORMAT</h2>
Junio C Hamanoff4b4312006-10-25 22:55:31913<div class="sectionbody">
Junio C Hamanoed69a742010-12-01 03:09:23914<div class="paragraph"><p>In this format, each line is output after a header; the
Junio C Hamanoba4b9282008-07-06 05:20:31915header at the minimum has the first line which has:</p></div>
Junio C Hamanoed69a742010-12-01 03:09:23916<div class="ulist"><ul>
Junio C Hamanoff4b4312006-10-25 22:55:31917<li>
918<p>
91940-byte SHA-1 of the commit the line is attributed to;
920</p>
921</li>
922<li>
923<p>
924the line number of the line in the original file;
925</p>
926</li>
927<li>
928<p>
929the line number of the line in the final file;
930</p>
931</li>
932<li>
933<p>
Junio C Hamanofd83b8e2009-03-22 08:21:41934on a line that starts a group of lines from a different
Junio C Hamanoff4b4312006-10-25 22:55:31935 commit than the previous one, the number of lines in this
936 group. On subsequent lines this field is absent.
937</p>
938</li>
Junio C Hamanoba4b9282008-07-06 05:20:31939</ul></div>
Junio C Hamanoed69a742010-12-01 03:09:23940<div class="paragraph"><p>This header line is followed by the following information
Junio C Hamanoba4b9282008-07-06 05:20:31941at least once for each commit:</p></div>
Junio C Hamanoed69a742010-12-01 03:09:23942<div class="ulist"><ul>
Junio C Hamanoff4b4312006-10-25 22:55:31943<li>
944<p>
Junio C Hamanofd83b8e2009-03-22 08:21:41945the author name ("author"), email ("author-mail"), time
Junio C Hamanoff4b4312006-10-25 22:55:31946 ("author-time"), and timezone ("author-tz"); similarly
947 for committer.
948</p>
949</li>
950<li>
951<p>
Junio C Hamanofd83b8e2009-03-22 08:21:41952the filename in the commit that the line is attributed to.
Junio C Hamanoff4b4312006-10-25 22:55:31953</p>
954</li>
955<li>
956<p>
957the first line of the commit log message ("summary").
958</p>
959</li>
Junio C Hamanoba4b9282008-07-06 05:20:31960</ul></div>
Junio C Hamanoed69a742010-12-01 03:09:23961<div class="paragraph"><p>The contents of the actual line is output after the above
Junio C Hamanoff4b4312006-10-25 22:55:31962header, prefixed by a TAB. This is to allow adding more
Junio C Hamanoba4b9282008-07-06 05:20:31963header elements later.</p></div>
Junio C Hamano2a294cd2011-05-23 23:06:31964<div class="paragraph"><p>The porcelain format generally suppresses commit information that has
965already been seen. For example, two lines that are blamed to the same
966commit will both be shown, but the details for that commit will be shown
967only once. This is more efficient, but may require more state be kept by
968the reader. The <tt>--line-porcelain</tt> option can be used to output full
969commit information for each line, allowing simpler (but less efficient)
970usage like:</p></div>
971<div class="literalblock">
972<div class="content">
973<pre><tt># count the number of lines attributed to each author
974git blame --line-porcelain file |
975sed -n 's/^author //p' |
976sort | uniq -c | sort -rn</tt></pre>
977</div></div>
Junio C Hamanoff4b4312006-10-25 22:55:31978</div>
Junio C Hamanoba4b9282008-07-06 05:20:31979<h2 id="_specifying_ranges">SPECIFYING RANGES</h2>
Junio C Hamanoe1aa7472006-11-09 07:37:50980<div class="sectionbody">
Junio C Hamanoed69a742010-12-01 03:09:23981<div class="paragraph"><p>Unlike <em>git blame</em> and <em>git annotate</em> in older versions of git, the extent
Junio C Hamanofd83b8e2009-03-22 08:21:41982of the annotation can be limited to both line ranges and revision
Junio C Hamanoe1aa7472006-11-09 07:37:50983ranges. When you are interested in finding the origin for
Junio C Hamanofd83b8e2009-03-22 08:21:41984lines 40-60 for file <tt>foo</tt>, you can use the <tt>-L</tt> option like so
Junio C Hamanoed69a742010-12-01 03:09:23985(they mean the same thing&#8201;&#8212;&#8201;both ask for 21 lines starting at
Junio C Hamanoba4b9282008-07-06 05:20:31986line 40):</p></div>
Junio C Hamanoe1aa7472006-11-09 07:37:50987<div class="literalblock">
988<div class="content">
Junio C Hamanoe58607f2007-01-17 23:27:45989<pre><tt>git blame -L 40,60 foo
990git blame -L 40,+21 foo</tt></pre>
Junio C Hamanoe1aa7472006-11-09 07:37:50991</div></div>
Junio C Hamanoed69a742010-12-01 03:09:23992<div class="paragraph"><p>Also you can use a regular expression to specify the line range:</p></div>
Junio C Hamano4a345d22006-11-09 18:45:32993<div class="literalblock">
994<div class="content">
995<pre><tt>git blame -L '/^sub hello {/,/^}$/' foo</tt></pre>
996</div></div>
Junio C Hamanoed69a742010-12-01 03:09:23997<div class="paragraph"><p>which limits the annotation to the body of the <tt>hello</tt> subroutine.</p></div>
998<div class="paragraph"><p>When you are not interested in changes older than version
Junio C Hamanoe1aa7472006-11-09 07:37:50999v2.6.18, or changes older than 3 weeks, you can use revision
Junio C Hamano1aa40d22010-01-21 17:46:431000range specifiers similar to <em>git rev-list</em>:</p></div>
Junio C Hamanoe1aa7472006-11-09 07:37:501001<div class="literalblock">
1002<div class="content">
1003<pre><tt>git blame v2.6.18.. -- foo
1004git blame --since=3.weeks -- foo</tt></pre>
1005</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231006<div class="paragraph"><p>When revision range specifiers are used to limit the annotation,
Junio C Hamanoe1aa7472006-11-09 07:37:501007lines that have not changed since the range boundary (either the
1008commit v2.6.18 or the most recent commit that is more than 3
1009weeks old in the above example) are blamed for that range
Junio C Hamanoba4b9282008-07-06 05:20:311010boundary commit.</p></div>
Junio C Hamanoed69a742010-12-01 03:09:231011<div class="paragraph"><p>A particularly useful way is to see if an added file has lines
Junio C Hamanoe1aa7472006-11-09 07:37:501012created by copy-and-paste from existing files. Sometimes this
1013indicates that the developer was being sloppy and did not
1014refactor the code properly. You can first find the commit that
Junio C Hamanoba4b9282008-07-06 05:20:311015introduced the file with:</p></div>
Junio C Hamanoe1aa7472006-11-09 07:37:501016<div class="literalblock">
1017<div class="content">
1018<pre><tt>git log --diff-filter=A --pretty=short -- foo</tt></pre>
1019</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231020<div class="paragraph"><p>and then annotate the change between the commit and its
Junio C Hamanob76a6862012-05-02 22:02:461021parents, using <tt>commit^!</tt> notation:</p></div>
Junio C Hamanoe1aa7472006-11-09 07:37:501022<div class="literalblock">
1023<div class="content">
1024<pre><tt>git blame -C -C -f $commit^! -- foo</tt></pre>
1025</div></div>
1026</div>
Junio C Hamanoba4b9282008-07-06 05:20:311027<h2 id="_incremental_output">INCREMENTAL OUTPUT</h2>
Junio C Hamano5a702332007-01-28 20:55:221028<div class="sectionbody">
Junio C Hamanoed69a742010-12-01 03:09:231029<div class="paragraph"><p>When called with <tt>--incremental</tt> option, the command outputs the
Junio C Hamano5a702332007-01-28 20:55:221030result as it is built. The output generally will talk about
1031lines touched by more recent commits first (i.e. the lines will
1032be annotated out of order) and is meant to be used by
Junio C Hamanoba4b9282008-07-06 05:20:311033interactive viewers.</p></div>
Junio C Hamanoed69a742010-12-01 03:09:231034<div class="paragraph"><p>The output format is similar to the Porcelain format, but it
Junio C Hamano5a702332007-01-28 20:55:221035does not contain the actual lines from the file that is being
Junio C Hamanoba4b9282008-07-06 05:20:311036annotated.</p></div>
Junio C Hamanoed69a742010-12-01 03:09:231037<div class="olist arabic"><ol class="arabic">
Junio C Hamano5a702332007-01-28 20:55:221038<li>
1039<p>
1040Each blame entry always starts with a line of:
1041</p>
1042<div class="literalblock">
1043<div class="content">
1044<pre><tt>&lt;40-byte hex sha1&gt; &lt;sourceline&gt; &lt;resultline&gt; &lt;num_lines&gt;</tt></pre>
1045</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231046<div class="paragraph"><p>Line numbers count from 1.</p></div>
Junio C Hamano5a702332007-01-28 20:55:221047</li>
1048<li>
1049<p>
Junio C Hamanofd83b8e2009-03-22 08:21:411050The first time that a commit shows up in the stream, it has various
Junio C Hamano5a702332007-01-28 20:55:221051 other information about it printed out with a one-word tag at the
Junio C Hamanofd83b8e2009-03-22 08:21:411052 beginning of each line describing the extra commit information (author,
1053 email, committer, dates, summary, etc.).
Junio C Hamano5a702332007-01-28 20:55:221054</p>
1055</li>
1056<li>
1057<p>
Junio C Hamanofd83b8e2009-03-22 08:21:411058Unlike the Porcelain format, the filename information is always
Junio C Hamano5a702332007-01-28 20:55:221059 given and terminates the entry:
1060</p>
1061<div class="literalblock">
1062<div class="content">
1063<pre><tt>"filename" &lt;whitespace-quoted-filename-goes-here&gt;</tt></pre>
1064</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231065<div class="paragraph"><p>and thus it is really quite easy to parse for some line- and word-oriented
Junio C Hamanoba4b9282008-07-06 05:20:311066parser (which should be quite natural for most scripting languages).</p></div>
Junio C Hamano5a702332007-01-28 20:55:221067<div class="admonitionblock">
1068<table><tr>
1069<td class="icon">
1070<div class="title">Note</div>
1071</td>
1072<td class="content">For people who do parsing: to make it more robust, just ignore any
Junio C Hamanofd83b8e2009-03-22 08:21:411073lines between the first and last one ("&lt;sha1&gt;" and "filename" lines)
1074where you do not recognize the tag words (or care about that particular
Junio C Hamano5a702332007-01-28 20:55:221075one) at the beginning of the "extended information" lines. That way, if
1076there is ever added information (like the commit encoding or extended
Junio C Hamanofd83b8e2009-03-22 08:21:411077commit commentary), a blame viewer will not care.</td>
Junio C Hamano5a702332007-01-28 20:55:221078</tr></table>
1079</div>
1080</li>
Junio C Hamanoba4b9282008-07-06 05:20:311081</ol></div>
Junio C Hamano5a702332007-01-28 20:55:221082</div>
Junio C Hamano8bc410e2009-02-15 10:38:191083<h2 id="_mapping_authors">MAPPING AUTHORS</h2>
1084<div class="sectionbody">
Junio C Hamanoed69a742010-12-01 03:09:231085<div class="paragraph"><p>If the file <tt>.mailmap</tt> exists at the toplevel of the repository, or at
Junio C Hamano8bc410e2009-02-15 10:38:191086the location pointed to by the mailmap.file configuration option, it
1087is used to map author and committer names and email addresses to
1088canonical real names and email addresses.</p></div>
Junio C Hamanoed69a742010-12-01 03:09:231089<div class="paragraph"><p>In the simple form, each line in the file consists of the canonical
Junio C Hamano8bc410e2009-02-15 10:38:191090real name of an author, whitespace, and an email address used in the
Junio C Hamanofd83b8e2009-03-22 08:21:411091commit (enclosed by <em>&lt;</em> and <em>&gt;</em>) to map to the name. For example:</p></div>
Junio C Hamano8bc410e2009-02-15 10:38:191092<div class="literalblock">
1093<div class="content">
1094<pre><tt>Proper Name &lt;commit@email.xx&gt;</tt></pre>
1095</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231096<div class="paragraph"><p>The more complex forms are:</p></div>
Junio C Hamano8bc410e2009-02-15 10:38:191097<div class="literalblock">
1098<div class="content">
1099<pre><tt>&lt;proper@email.xx&gt; &lt;commit@email.xx&gt;</tt></pre>
1100</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231101<div class="paragraph"><p>which allows mailmap to replace only the email part of a commit, and:</p></div>
Junio C Hamano8bc410e2009-02-15 10:38:191102<div class="literalblock">
1103<div class="content">
1104<pre><tt>Proper Name &lt;proper@email.xx&gt; &lt;commit@email.xx&gt;</tt></pre>
1105</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231106<div class="paragraph"><p>which allows mailmap to replace both the name and the email of a
Junio C Hamanofd83b8e2009-03-22 08:21:411107commit matching the specified commit email address, and:</p></div>
Junio C Hamano8bc410e2009-02-15 10:38:191108<div class="literalblock">
1109<div class="content">
1110<pre><tt>Proper Name &lt;proper@email.xx&gt; Commit Name &lt;commit@email.xx&gt;</tt></pre>
1111</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231112<div class="paragraph"><p>which allows mailmap to replace both the name and the email of a
Junio C Hamano8bc410e2009-02-15 10:38:191113commit matching both the specified commit name and email address.</p></div>
Junio C Hamanoed69a742010-12-01 03:09:231114<div class="paragraph"><p>Example 1: Your history contains commits by two authors, Jane
Junio C Hamano8bc410e2009-02-15 10:38:191115and Joe, whose names appear in the repository under several forms:</p></div>
1116<div class="listingblock">
1117<div class="content">
1118<pre><tt>Joe Developer &lt;joe@example.com&gt;
1119Joe R. Developer &lt;joe@example.com&gt;
1120Jane Doe &lt;jane@example.com&gt;
1121Jane Doe &lt;jane@laptop.(none)&gt;
1122Jane D. &lt;jane@desktop.(none)&gt;</tt></pre>
1123</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231124<div class="paragraph"><p>Now suppose that Joe wants his middle name initial used, and Jane
Junio C Hamano8bc410e2009-02-15 10:38:191125prefers her family name fully spelled out. A proper <tt>.mailmap</tt> file
1126would look like:</p></div>
1127<div class="listingblock">
1128<div class="content">
1129<pre><tt>Jane Doe &lt;jane@desktop.(none)&gt;
1130Joe R. Developer &lt;joe@example.com&gt;</tt></pre>
1131</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231132<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
Junio C Hamanofd83b8e2009-03-22 08:21:411133real name of that author is already correct.</p></div>
Junio C Hamanoed69a742010-12-01 03:09:231134<div class="paragraph"><p>Example 2: Your repository contains commits from the following
Junio C Hamano8bc410e2009-02-15 10:38:191135authors:</p></div>
1136<div class="listingblock">
1137<div class="content">
1138<pre><tt>nick1 &lt;bugs@company.xx&gt;
1139nick2 &lt;bugs@company.xx&gt;
1140nick2 &lt;nick2@company.xx&gt;
1141santa &lt;me@company.xx&gt;
1142claus &lt;me@company.xx&gt;
1143CTO &lt;cto@coompany.xx&gt;</tt></pre>
1144</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231145<div class="paragraph"><p>Then you might want a <tt>.mailmap</tt> file that looks like:</p></div>
Junio C Hamano8bc410e2009-02-15 10:38:191146<div class="listingblock">
1147<div class="content">
1148<pre><tt>&lt;cto@company.xx&gt; &lt;cto@coompany.xx&gt;
1149Some Dude &lt;some@dude.xx&gt; nick1 &lt;bugs@company.xx&gt;
1150Other Author &lt;other@author.xx&gt; nick2 &lt;bugs@company.xx&gt;
1151Other Author &lt;other@author.xx&gt; &lt;nick2@company.xx&gt;
1152Santa Claus &lt;santa.claus@northpole.xx&gt; &lt;me@company.xx&gt;</tt></pre>
1153</div></div>
Junio C Hamanoed69a742010-12-01 03:09:231154<div class="paragraph"><p>Use hash <em>#</em> for comments that are either on their own line, or after
Junio C Hamano8bc410e2009-02-15 10:38:191155the email address.</p></div>
1156</div>
Junio C Hamanoba4b9282008-07-06 05:20:311157<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamanob33fb4f2006-04-18 21:30:511158<div class="sectionbody">
Junio C Hamanoed69a742010-12-01 03:09:231159<div class="paragraph"><p><a href="git-annotate.html">git-annotate(1)</a></p></div>
Junio C Hamanob33fb4f2006-04-18 21:30:511160</div>
Junio C Hamanoba4b9282008-07-06 05:20:311161<h2 id="_git">GIT</h2>
Junio C Hamanob33fb4f2006-04-18 21:30:511162<div class="sectionbody">
Junio C Hamanoed69a742010-12-01 03:09:231163<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamanob33fb4f2006-04-18 21:30:511164</div>
Junio C Hamano7bd050f2011-09-22 06:32:221165</div>
1166<div id="footnotes"><hr /></div>
Junio C Hamanob33fb4f2006-04-18 21:30:511167<div id="footer">
1168<div id="footer-text">
Junio C Hamanob76a6862012-05-02 22:02:461169Last updated 2012-05-02 15:00:44 PDT
Junio C Hamanob33fb4f2006-04-18 21:30:511170</div>
1171</div>
1172</body>
1173</html>