Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 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" /> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.2.5" /> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 19 | a { |
| 20 | color: blue; |
| 21 | text-decoration: underline; |
| 22 | } |
| 23 | a:visited { |
| 24 | color: fuchsia; |
| 25 | } |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 26 | |
| 27 | em { |
| 28 | font-style: italic; |
| 29 | } |
| 30 | |
| 31 | strong { |
| 32 | font-weight: bold; |
| 33 | } |
| 34 | |
| 35 | tt { |
| 36 | color: navy; |
| 37 | } |
| 38 | |
| 39 | h1, h2, h3, h4, h5, h6 { |
| 40 | color: #527bbd; |
| 41 | font-family: sans-serif; |
| 42 | margin-top: 1.2em; |
| 43 | margin-bottom: 0.5em; |
| 44 | line-height: 1.3; |
| 45 | } |
| 46 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 47 | h1, h2, h3 { |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 48 | border-bottom: 2px solid silver; |
| 49 | } |
| 50 | h2 { |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 51 | padding-top: 0.5em; |
| 52 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 53 | h3 { |
| 54 | float: left; |
| 55 | } |
| 56 | h3 + * { |
| 57 | clear: left; |
| 58 | } |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 59 | |
| 60 | div.sectionbody { |
| 61 | font-family: serif; |
| 62 | margin-left: 0; |
| 63 | } |
| 64 | |
| 65 | hr { |
| 66 | border: 1px solid silver; |
| 67 | } |
| 68 | |
| 69 | p { |
| 70 | margin-top: 0.5em; |
| 71 | margin-bottom: 0.5em; |
| 72 | } |
| 73 | |
| 74 | pre { |
| 75 | padding: 0; |
| 76 | margin: 0; |
| 77 | } |
| 78 | |
| 79 | span#author { |
| 80 | color: #527bbd; |
| 81 | font-family: sans-serif; |
| 82 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 83 | font-size: 1.1em; |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 84 | } |
| 85 | span#email { |
| 86 | } |
| 87 | span#revision { |
| 88 | font-family: sans-serif; |
| 89 | } |
| 90 | |
| 91 | div#footer { |
| 92 | font-family: sans-serif; |
| 93 | font-size: small; |
| 94 | border-top: 2px solid silver; |
| 95 | padding-top: 0.5em; |
| 96 | margin-top: 4.0em; |
| 97 | } |
| 98 | div#footer-text { |
| 99 | float: left; |
| 100 | padding-bottom: 0.5em; |
| 101 | } |
| 102 | div#footer-badges { |
| 103 | float: right; |
| 104 | padding-bottom: 0.5em; |
| 105 | } |
| 106 | |
| 107 | div#preamble, |
| 108 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 109 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 110 | div.admonitionblock { |
| 111 | margin-right: 10%; |
| 112 | margin-top: 1.5em; |
| 113 | margin-bottom: 1.5em; |
| 114 | } |
| 115 | div.admonitionblock { |
| 116 | margin-top: 2.5em; |
| 117 | margin-bottom: 2.5em; |
| 118 | } |
| 119 | |
| 120 | div.content { /* Block element content. */ |
| 121 | padding: 0; |
| 122 | } |
| 123 | |
| 124 | /* Block element titles. */ |
| 125 | div.title, caption.title { |
| 126 | font-family: sans-serif; |
| 127 | font-weight: bold; |
| 128 | text-align: left; |
| 129 | margin-top: 1.0em; |
| 130 | margin-bottom: 0.5em; |
| 131 | } |
| 132 | div.title + * { |
| 133 | margin-top: 0; |
| 134 | } |
| 135 | |
| 136 | td div.title:first-child { |
| 137 | margin-top: 0.0em; |
| 138 | } |
| 139 | div.content div.title:first-child { |
| 140 | margin-top: 0.0em; |
| 141 | } |
| 142 | div.content + div.title { |
| 143 | margin-top: 0.0em; |
| 144 | } |
| 145 | |
| 146 | div.sidebarblock > div.content { |
| 147 | background: #ffffee; |
| 148 | border: 1px solid silver; |
| 149 | padding: 0.5em; |
| 150 | } |
| 151 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 152 | div.listingblock { |
| 153 | margin-right: 0%; |
| 154 | } |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 155 | div.listingblock > div.content { |
| 156 | border: 1px solid silver; |
| 157 | background: #f4f4f4; |
| 158 | padding: 0.5em; |
| 159 | } |
| 160 | |
| 161 | div.quoteblock > div.content { |
| 162 | padding-left: 2.0em; |
| 163 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 164 | |
| 165 | div.attribution { |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 166 | text-align: right; |
| 167 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 168 | div.verseblock + div.attribution { |
| 169 | text-align: left; |
| 170 | } |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 171 | |
| 172 | div.admonitionblock .icon { |
| 173 | vertical-align: top; |
| 174 | font-size: 1.1em; |
| 175 | font-weight: bold; |
| 176 | text-decoration: underline; |
| 177 | color: #527bbd; |
| 178 | padding-right: 0.5em; |
| 179 | } |
| 180 | div.admonitionblock td.content { |
| 181 | padding-left: 0.5em; |
| 182 | border-left: 2px solid silver; |
| 183 | } |
| 184 | |
| 185 | div.exampleblock > div.content { |
| 186 | border-left: 2px solid silver; |
| 187 | padding: 0.5em; |
| 188 | } |
| 189 | |
| 190 | div.verseblock div.content { |
| 191 | white-space: pre; |
| 192 | } |
| 193 | |
| 194 | div.imageblock div.content { padding-left: 0; } |
| 195 | div.imageblock img { border: 1px solid silver; } |
| 196 | span.image img { border-style: none; } |
| 197 | |
| 198 | dl { |
| 199 | margin-top: 0.8em; |
| 200 | margin-bottom: 0.8em; |
| 201 | } |
| 202 | dt { |
| 203 | margin-top: 0.5em; |
| 204 | margin-bottom: 0; |
| 205 | font-style: italic; |
| 206 | } |
| 207 | dd > *:first-child { |
| 208 | margin-top: 0; |
| 209 | } |
| 210 | |
| 211 | ul, ol { |
| 212 | list-style-position: outside; |
| 213 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 214 | div.olist2 ol { |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 215 | list-style-type: lower-alpha; |
| 216 | } |
| 217 | |
| 218 | div.tableblock > table { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 219 | border: 3px solid #527bbd; |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 220 | } |
| 221 | thead { |
| 222 | font-family: sans-serif; |
| 223 | font-weight: bold; |
| 224 | } |
| 225 | tfoot { |
| 226 | font-weight: bold; |
| 227 | } |
| 228 | |
| 229 | div.hlist { |
| 230 | margin-top: 0.8em; |
| 231 | margin-bottom: 0.8em; |
| 232 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 233 | div.hlist td { |
| 234 | padding-bottom: 5px; |
| 235 | } |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 236 | td.hlist1 { |
| 237 | vertical-align: top; |
| 238 | font-style: italic; |
| 239 | padding-right: 0.8em; |
| 240 | } |
| 241 | td.hlist2 { |
| 242 | vertical-align: top; |
| 243 | } |
| 244 | |
| 245 | @media print { |
| 246 | div#footer-badges { display: none; } |
| 247 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 248 | |
| 249 | div#toctitle { |
| 250 | color: #527bbd; |
| 251 | font-family: sans-serif; |
| 252 | font-size: 1.1em; |
| 253 | font-weight: bold; |
| 254 | margin-top: 1.0em; |
| 255 | margin-bottom: 0.1em; |
| 256 | } |
| 257 | |
| 258 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 259 | margin-top: 0; |
| 260 | margin-bottom: 0; |
| 261 | } |
| 262 | div.toclevel2 { |
| 263 | margin-left: 2em; |
| 264 | font-size: 0.9em; |
| 265 | } |
| 266 | div.toclevel3 { |
| 267 | margin-left: 4em; |
| 268 | font-size: 0.9em; |
| 269 | } |
| 270 | div.toclevel4 { |
| 271 | margin-left: 6em; |
| 272 | font-size: 0.9em; |
| 273 | } |
| 274 | include1::./stylesheets/xhtml11-manpage.css[] |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 275 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 276 | |
| 277 | div.sidebar-content { |
| 278 | background: #ffffee; |
| 279 | border: 1px solid silver; |
| 280 | padding: 0.5em; |
| 281 | } |
| 282 | div.sidebar-title, div.image-title { |
| 283 | font-family: sans-serif; |
| 284 | font-weight: bold; |
| 285 | margin-top: 0.0em; |
| 286 | margin-bottom: 0.5em; |
| 287 | } |
| 288 | |
| 289 | div.listingblock div.content { |
| 290 | border: 1px solid silver; |
| 291 | background: #f4f4f4; |
| 292 | padding: 0.5em; |
| 293 | } |
| 294 | |
| 295 | div.quoteblock-content { |
| 296 | padding-left: 2.0em; |
| 297 | } |
| 298 | |
| 299 | div.exampleblock-content { |
| 300 | border-left: 2px solid silver; |
| 301 | padding-left: 0.5em; |
| 302 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 303 | |
| 304 | /* IE6 sets dynamically generated links as visited. */ |
| 305 | div#toc a:visited { color: blue; } |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 306 | </style> |
| 307 | <title>git-blame(1)</title> |
| 308 | </head> |
| 309 | <body> |
| 310 | <div id="header"> |
| 311 | <h1> |
| 312 | git-blame(1) Manual Page |
| 313 | </h1> |
| 314 | <h2>NAME</h2> |
| 315 | <div class="sectionbody"> |
| 316 | <p>git-blame - |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 317 | Show what revision and author last modified each line of a file |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 318 | </p> |
| 319 | </div> |
| 320 | </div> |
| 321 | <h2>SYNOPSIS</h2> |
| 322 | <div class="sectionbody"> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 323 | <div class="verseblock"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 324 | <div class="content"><em>git blame</em> [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-p] [-w] [--incremental] [-L n,m] |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 325 | [-S <revs-file>] [-M] [-C] [-C] [--since=<date>] |
Junio C Hamano | a6455f6 | 2009-02-20 08:33:08 | [diff] [blame] | 326 | [<rev> | --contents <file> | --reverse <rev>] [--] <file></div></div> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 327 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 328 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 329 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 330 | <div class="para"><p>Annotates each line in the given file with information from the revision which |
| 331 | last modified the line. Optionally, start annotating from the given revision.</p></div> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 332 | <div class="para"><p>The command can also limit the range of lines annotated.</p></div> |
| 333 | <div class="para"><p>The report does not tell you anything about lines which have been deleted or |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 334 | replaced; you need to use a tool such as <em>git-diff</em> or the "pickaxe" |
| 335 | interface briefly mentioned in the following paragraph.</p></div> |
| 336 | <div class="para"><p>Apart from supporting file annotation, git also supports searching the |
Junio C Hamano | f9771f6 | 2007-01-17 17:42:30 | [diff] [blame] | 337 | development history for when a code snippet occurred in a change. This makes it |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 338 | possible to track when a code snippet was added to a file, moved or copied |
| 339 | between files, and eventually deleted or replaced. It works by searching for |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 340 | a text string in the diff. A small example:</p></div> |
Junio C Hamano | 6b2cee1 | 2006-08-26 08:43:31 | [diff] [blame] | 341 | <div class="listingblock"> |
| 342 | <div class="content"> |
| 343 | <pre><tt>$ git log --pretty=oneline -S'blame_usage' |
| 344 | 5040f17eba15504bad66b14a645bddd9b015ebb7 blame -S <ancestry-file> |
| 345 | ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output</tt></pre> |
| 346 | </div></div> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 347 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 348 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 349 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 350 | <div class="vlist"><dl> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 351 | <dt> |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 352 | -b |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 353 | </dt> |
| 354 | <dd> |
| 355 | <p> |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 356 | Show blank SHA-1 for boundary commits. This can also |
| 357 | be controlled via the <tt>blame.blankboundary</tt> config option. |
| 358 | </p> |
| 359 | </dd> |
| 360 | <dt> |
| 361 | --root |
| 362 | </dt> |
| 363 | <dd> |
| 364 | <p> |
| 365 | Do not treat root commits as boundaries. This can also be |
| 366 | controlled via the <tt>blame.showroot</tt> config option. |
| 367 | </p> |
| 368 | </dd> |
| 369 | <dt> |
| 370 | --show-stats |
| 371 | </dt> |
| 372 | <dd> |
| 373 | <p> |
| 374 | Include additional statistics at the end of blame output. |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 375 | </p> |
| 376 | </dd> |
| 377 | <dt> |
Junio C Hamano | 9882a52 | 2007-04-27 08:22:22 | [diff] [blame] | 378 | -L <start>,<end> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 379 | </dt> |
| 380 | <dd> |
| 381 | <p> |
Junio C Hamano | 9882a52 | 2007-04-27 08:22:22 | [diff] [blame] | 382 | Annotate only the given line range. <start> and <end> can take |
| 383 | one of these forms: |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 384 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 385 | <div class="ilist"><ul> |
Junio C Hamano | 9882a52 | 2007-04-27 08:22:22 | [diff] [blame] | 386 | <li> |
| 387 | <p> |
| 388 | number |
| 389 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 390 | <div class="para"><p>If <start> or <end> is a number, it specifies an |
| 391 | absolute line number (lines count from 1).</p></div> |
Junio C Hamano | 9882a52 | 2007-04-27 08:22:22 | [diff] [blame] | 392 | </li> |
| 393 | <li> |
| 394 | <p> |
| 395 | /regex/ |
| 396 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 397 | <div class="para"><p>This form will use the first line matching the given |
Junio C Hamano | 9882a52 | 2007-04-27 08:22:22 | [diff] [blame] | 398 | POSIX regex. If <end> is a regex, it will search |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 399 | starting at the line given by <start>.</p></div> |
Junio C Hamano | 9882a52 | 2007-04-27 08:22:22 | [diff] [blame] | 400 | </li> |
| 401 | <li> |
| 402 | <p> |
| 403 | +offset or -offset |
| 404 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 405 | <div class="para"><p>This is only valid for <end> and will specify a number |
| 406 | of lines before or after the line given by <start>.</p></div> |
Junio C Hamano | 9882a52 | 2007-04-27 08:22:22 | [diff] [blame] | 407 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 408 | </ul></div> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 409 | </dd> |
| 410 | <dt> |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 411 | -l |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 412 | </dt> |
| 413 | <dd> |
| 414 | <p> |
Junio C Hamano | 3fd90c8 | 2006-06-18 00:22:01 | [diff] [blame] | 415 | Show long rev (Default: off). |
| 416 | </p> |
| 417 | </dd> |
| 418 | <dt> |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 419 | -t |
Junio C Hamano | 3fd90c8 | 2006-06-18 00:22:01 | [diff] [blame] | 420 | </dt> |
| 421 | <dd> |
| 422 | <p> |
| 423 | Show raw timestamp (Default: off). |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 424 | </p> |
| 425 | </dd> |
| 426 | <dt> |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 427 | -S <revs-file> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 428 | </dt> |
| 429 | <dd> |
| 430 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 431 | Use revisions from revs-file instead of calling <a href="git-rev-list.html">git-rev-list(1)</a>. |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 432 | </p> |
| 433 | </dd> |
| 434 | <dt> |
Junio C Hamano | a6455f6 | 2009-02-20 08:33:08 | [diff] [blame] | 435 | --reverse |
| 436 | </dt> |
| 437 | <dd> |
| 438 | <p> |
| 439 | Walk history forward instead of backward. Instead of showing |
| 440 | the revision in which a line appeared, this shows the last |
| 441 | revision in which a line has existed. This requires a range of |
| 442 | revision like START..END where the path to blame exists in |
| 443 | START. |
| 444 | </p> |
| 445 | </dd> |
| 446 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 447 | -p |
| 448 | </dt> |
| 449 | <dt> |
| 450 | --porcelain |
Junio C Hamano | ff4b431 | 2006-10-25 22:55:31 | [diff] [blame] | 451 | </dt> |
| 452 | <dd> |
| 453 | <p> |
| 454 | Show in a format designed for machine consumption. |
| 455 | </p> |
| 456 | </dd> |
| 457 | <dt> |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 458 | --incremental |
| 459 | </dt> |
| 460 | <dd> |
| 461 | <p> |
| 462 | Show the result incrementally in a format designed for |
| 463 | machine consumption. |
| 464 | </p> |
| 465 | </dd> |
| 466 | <dt> |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 467 | --encoding=<encoding> |
| 468 | </dt> |
| 469 | <dd> |
| 470 | <p> |
| 471 | Specifies the encoding used to output author names |
| 472 | and commit summaries. Setting it to <tt>none</tt> makes blame |
| 473 | output unconverted data. For more information see the |
| 474 | discussion about encoding in the <a href="git-log.html">git-log(1)</a> |
| 475 | manual page. |
| 476 | </p> |
| 477 | </dd> |
| 478 | <dt> |
Junio C Hamano | 42f855f | 2007-02-06 00:09:38 | [diff] [blame] | 479 | --contents <file> |
| 480 | </dt> |
| 481 | <dd> |
| 482 | <p> |
| 483 | When <rev> is not specified, the command annotates the |
| 484 | changes starting backwards from the working tree copy. |
| 485 | This flag makes the command pretend as if the working |
Junio C Hamano | 49dccaf | 2008-02-10 10:48:01 | [diff] [blame] | 486 | tree copy has the contents of the named file (specify |
Junio C Hamano | 42f855f | 2007-02-06 00:09:38 | [diff] [blame] | 487 | <tt>-</tt> to make the command read from the standard input). |
| 488 | </p> |
| 489 | </dd> |
| 490 | <dt> |
Junio C Hamano | ea6a764 | 2009-03-11 23:56:19 | [diff] [blame] | 491 | --date <format> |
| 492 | </dt> |
| 493 | <dd> |
| 494 | <p> |
| 495 | The value is one of the following alternatives: |
| 496 | {relative,local,default,iso,rfc,short}. If --date is not |
| 497 | provided, the value of the blame.date config variable is |
| 498 | used. If the blame.date config variable is also not set, the |
| 499 | iso format is used. For more information, See the discussion |
| 500 | of the --date option at <a href="git-log.html">git-log(1)</a>. |
| 501 | </p> |
| 502 | </dd> |
| 503 | <dt> |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 504 | -M|<num>| |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 505 | </dt> |
| 506 | <dd> |
| 507 | <p> |
| 508 | Detect moving lines in the file as well. When a commit |
| 509 | moves a block of lines in a file (e.g. the original file |
| 510 | has A and then B, and the commit changes it to B and |
Junio C Hamano | 7924d5e | 2009-03-03 08:28:48 | [diff] [blame] | 511 | then A), the traditional <em>blame</em> algorithm typically blames |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 512 | the lines that were moved up (i.e. B) to the parent and |
| 513 | assigns blame to the lines that were moved down (i.e. A) |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 514 | to the child commit. With this option, both groups of lines |
| 515 | are blamed on the parent. |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 516 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 517 | <div class="para"><p><num> is optional but it is the lower bound on the number of |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 518 | alphanumeric characters that git must detect as moving |
| 519 | within a file for it to associate those lines with the parent |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 520 | commit.</p></div> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 521 | </dd> |
| 522 | <dt> |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 523 | -C|<num>| |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 524 | </dt> |
| 525 | <dd> |
| 526 | <p> |
| 527 | In addition to <tt>-M</tt>, detect lines copied from other |
| 528 | files that were modified in the same commit. This is |
| 529 | useful when you reorganize your program and move code |
| 530 | around across files. When this option is given twice, |
Junio C Hamano | 7924d5e | 2009-03-03 08:28:48 | [diff] [blame] | 531 | the command additionally looks for copies from all other |
| 532 | files in the parent for the commit that creates the file. |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 533 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 534 | <div class="para"><p><num> is optional but it is the lower bound on the number of |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 535 | alphanumeric characters that git must detect as moving |
| 536 | between files for it to associate those lines with the parent |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 537 | commit.</p></div> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 538 | </dd> |
| 539 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 540 | -h |
| 541 | </dt> |
| 542 | <dt> |
| 543 | --help |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 544 | </dt> |
| 545 | <dd> |
| 546 | <p> |
| 547 | Show help message. |
| 548 | </p> |
| 549 | </dd> |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 550 | <dt> |
| 551 | -c |
| 552 | </dt> |
| 553 | <dd> |
| 554 | <p> |
| 555 | Use the same output mode as <a href="git-annotate.html">git-annotate(1)</a> (Default: off). |
| 556 | </p> |
| 557 | </dd> |
| 558 | <dt> |
| 559 | --score-debug |
| 560 | </dt> |
| 561 | <dd> |
| 562 | <p> |
| 563 | Include debugging information related to the movement of |
| 564 | lines between files (see <tt>-C</tt>) and lines moved within a |
| 565 | file (see <tt>-M</tt>). The first number listed is the score. |
| 566 | This is the number of alphanumeric characters detected |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 567 | as having been moved between or within files. This must be above |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 568 | a certain threshold for <em>git-blame</em> to consider those lines |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 569 | of code to have been moved. |
| 570 | </p> |
| 571 | </dd> |
| 572 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 573 | -f |
| 574 | </dt> |
| 575 | <dt> |
| 576 | --show-name |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 577 | </dt> |
| 578 | <dd> |
| 579 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 580 | Show the filename in the original commit. By default |
| 581 | the filename is shown if there is any line that came from a |
| 582 | file with a different name, due to rename detection. |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 583 | </p> |
| 584 | </dd> |
| 585 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 586 | -n |
| 587 | </dt> |
| 588 | <dt> |
| 589 | --show-number |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 590 | </dt> |
| 591 | <dd> |
| 592 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 593 | Show the line number in the original commit (Default: off). |
Junio C Hamano | 0e3cb53 | 2007-04-17 08:28:11 | [diff] [blame] | 594 | </p> |
| 595 | </dd> |
Junio C Hamano | 469d60e | 2007-04-29 18:30:34 | [diff] [blame] | 596 | <dt> |
| 597 | -s |
| 598 | </dt> |
| 599 | <dd> |
| 600 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 601 | Suppress the author name and timestamp from the output. |
Junio C Hamano | 469d60e | 2007-04-29 18:30:34 | [diff] [blame] | 602 | </p> |
| 603 | </dd> |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 604 | <dt> |
| 605 | -w |
| 606 | </dt> |
| 607 | <dd> |
| 608 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 609 | Ignore whitespace when comparing the parent's version and |
| 610 | the child's to find where the lines came from. |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 611 | </p> |
| 612 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 613 | </dl></div> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 614 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 615 | <h2 id="_the_porcelain_format">THE PORCELAIN FORMAT</h2> |
Junio C Hamano | ff4b431 | 2006-10-25 22:55:31 | [diff] [blame] | 616 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 617 | <div class="para"><p>In this format, each line is output after a header; the |
| 618 | header at the minimum has the first line which has:</p></div> |
| 619 | <div class="ilist"><ul> |
Junio C Hamano | ff4b431 | 2006-10-25 22:55:31 | [diff] [blame] | 620 | <li> |
| 621 | <p> |
| 622 | 40-byte SHA-1 of the commit the line is attributed to; |
| 623 | </p> |
| 624 | </li> |
| 625 | <li> |
| 626 | <p> |
| 627 | the line number of the line in the original file; |
| 628 | </p> |
| 629 | </li> |
| 630 | <li> |
| 631 | <p> |
| 632 | the line number of the line in the final file; |
| 633 | </p> |
| 634 | </li> |
| 635 | <li> |
| 636 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 637 | on a line that starts a group of lines from a different |
Junio C Hamano | ff4b431 | 2006-10-25 22:55:31 | [diff] [blame] | 638 | commit than the previous one, the number of lines in this |
| 639 | group. On subsequent lines this field is absent. |
| 640 | </p> |
| 641 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 642 | </ul></div> |
| 643 | <div class="para"><p>This header line is followed by the following information |
| 644 | at least once for each commit:</p></div> |
| 645 | <div class="ilist"><ul> |
Junio C Hamano | ff4b431 | 2006-10-25 22:55:31 | [diff] [blame] | 646 | <li> |
| 647 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 648 | the author name ("author"), email ("author-mail"), time |
Junio C Hamano | ff4b431 | 2006-10-25 22:55:31 | [diff] [blame] | 649 | ("author-time"), and timezone ("author-tz"); similarly |
| 650 | for committer. |
| 651 | </p> |
| 652 | </li> |
| 653 | <li> |
| 654 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 655 | the filename in the commit that the line is attributed to. |
Junio C Hamano | ff4b431 | 2006-10-25 22:55:31 | [diff] [blame] | 656 | </p> |
| 657 | </li> |
| 658 | <li> |
| 659 | <p> |
| 660 | the first line of the commit log message ("summary"). |
| 661 | </p> |
| 662 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 663 | </ul></div> |
| 664 | <div class="para"><p>The contents of the actual line is output after the above |
Junio C Hamano | ff4b431 | 2006-10-25 22:55:31 | [diff] [blame] | 665 | header, prefixed by a TAB. This is to allow adding more |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 666 | header elements later.</p></div> |
Junio C Hamano | ff4b431 | 2006-10-25 22:55:31 | [diff] [blame] | 667 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 668 | <h2 id="_specifying_ranges">SPECIFYING RANGES</h2> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 669 | <div class="sectionbody"> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 670 | <div class="para"><p>Unlike <em>git-blame</em> and <em>git-annotate</em> in older versions of git, the extent |
| 671 | of the annotation can be limited to both line ranges and revision |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 672 | ranges. When you are interested in finding the origin for |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 673 | lines 40-60 for file <tt>foo</tt>, you can use the <tt>-L</tt> option like so |
Junio C Hamano | e58607f | 2007-01-17 23:27:45 | [diff] [blame] | 674 | (they mean the same thing — both ask for 21 lines starting at |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 675 | line 40):</p></div> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 676 | <div class="literalblock"> |
| 677 | <div class="content"> |
Junio C Hamano | e58607f | 2007-01-17 23:27:45 | [diff] [blame] | 678 | <pre><tt>git blame -L 40,60 foo |
| 679 | git blame -L 40,+21 foo</tt></pre> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 680 | </div></div> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 681 | <div class="para"><p>Also you can use a regular expression to specify the line range:</p></div> |
Junio C Hamano | 4a345d2 | 2006-11-09 18:45:32 | [diff] [blame] | 682 | <div class="literalblock"> |
| 683 | <div class="content"> |
| 684 | <pre><tt>git blame -L '/^sub hello {/,/^}$/' foo</tt></pre> |
| 685 | </div></div> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 686 | <div class="para"><p>which limits the annotation to the body of the <tt>hello</tt> subroutine.</p></div> |
| 687 | <div class="para"><p>When you are not interested in changes older than version |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 688 | v2.6.18, or changes older than 3 weeks, you can use revision |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 689 | range specifiers similar to <em>git-rev-list</em>:</p></div> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 690 | <div class="literalblock"> |
| 691 | <div class="content"> |
| 692 | <pre><tt>git blame v2.6.18.. -- foo |
| 693 | git blame --since=3.weeks -- foo</tt></pre> |
| 694 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 695 | <div class="para"><p>When revision range specifiers are used to limit the annotation, |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 696 | lines that have not changed since the range boundary (either the |
| 697 | commit v2.6.18 or the most recent commit that is more than 3 |
| 698 | weeks old in the above example) are blamed for that range |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 699 | boundary commit.</p></div> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 700 | <div class="para"><p>A particularly useful way is to see if an added file has lines |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 701 | created by copy-and-paste from existing files. Sometimes this |
| 702 | indicates that the developer was being sloppy and did not |
| 703 | refactor the code properly. You can first find the commit that |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 704 | introduced the file with:</p></div> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 705 | <div class="literalblock"> |
| 706 | <div class="content"> |
| 707 | <pre><tt>git log --diff-filter=A --pretty=short -- foo</tt></pre> |
| 708 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 709 | <div class="para"><p>and then annotate the change between the commit and its |
| 710 | parents, using <tt>commit^!</tt> notation:</p></div> |
Junio C Hamano | e1aa747 | 2006-11-09 07:37:50 | [diff] [blame] | 711 | <div class="literalblock"> |
| 712 | <div class="content"> |
| 713 | <pre><tt>git blame -C -C -f $commit^! -- foo</tt></pre> |
| 714 | </div></div> |
| 715 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 716 | <h2 id="_incremental_output">INCREMENTAL OUTPUT</h2> |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 717 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 718 | <div class="para"><p>When called with <tt>--incremental</tt> option, the command outputs the |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 719 | result as it is built. The output generally will talk about |
| 720 | lines touched by more recent commits first (i.e. the lines will |
| 721 | be annotated out of order) and is meant to be used by |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 722 | interactive viewers.</p></div> |
| 723 | <div class="para"><p>The output format is similar to the Porcelain format, but it |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 724 | does not contain the actual lines from the file that is being |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 725 | annotated.</p></div> |
| 726 | <div class="olist"><ol> |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 727 | <li> |
| 728 | <p> |
| 729 | Each blame entry always starts with a line of: |
| 730 | </p> |
| 731 | <div class="literalblock"> |
| 732 | <div class="content"> |
| 733 | <pre><tt><40-byte hex sha1> <sourceline> <resultline> <num_lines></tt></pre> |
| 734 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 735 | <div class="para"><p>Line numbers count from 1.</p></div> |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 736 | </li> |
| 737 | <li> |
| 738 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 739 | The first time that a commit shows up in the stream, it has various |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 740 | other information about it printed out with a one-word tag at the |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 741 | beginning of each line describing the extra commit information (author, |
| 742 | email, committer, dates, summary, etc.). |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 743 | </p> |
| 744 | </li> |
| 745 | <li> |
| 746 | <p> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 747 | Unlike the Porcelain format, the filename information is always |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 748 | given and terminates the entry: |
| 749 | </p> |
| 750 | <div class="literalblock"> |
| 751 | <div class="content"> |
| 752 | <pre><tt>"filename" <whitespace-quoted-filename-goes-here></tt></pre> |
| 753 | </div></div> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 754 | <div class="para"><p>and thus it is really quite easy to parse for some line- and word-oriented |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 755 | parser (which should be quite natural for most scripting languages).</p></div> |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 756 | <div class="admonitionblock"> |
| 757 | <table><tr> |
| 758 | <td class="icon"> |
| 759 | <div class="title">Note</div> |
| 760 | </td> |
| 761 | <td class="content">For people who do parsing: to make it more robust, just ignore any |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 762 | lines between the first and last one ("<sha1>" and "filename" lines) |
| 763 | where you do not recognize the tag words (or care about that particular |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 764 | one) at the beginning of the "extended information" lines. That way, if |
| 765 | there is ever added information (like the commit encoding or extended |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 766 | commit commentary), a blame viewer will not care.</td> |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 767 | </tr></table> |
| 768 | </div> |
| 769 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 770 | </ol></div> |
Junio C Hamano | 5a70233 | 2007-01-28 20:55:22 | [diff] [blame] | 771 | </div> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 772 | <h2 id="_mapping_authors">MAPPING AUTHORS</h2> |
| 773 | <div class="sectionbody"> |
| 774 | <div class="para"><p>If the file <tt>.mailmap</tt> exists at the toplevel of the repository, or at |
| 775 | the location pointed to by the mailmap.file configuration option, it |
| 776 | is used to map author and committer names and email addresses to |
| 777 | canonical real names and email addresses.</p></div> |
| 778 | <div class="para"><p>In the simple form, each line in the file consists of the canonical |
| 779 | real name of an author, whitespace, and an email address used in the |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 780 | commit (enclosed by <em><</em> and <em>></em>) to map to the name. For example:</p></div> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 781 | <div class="literalblock"> |
| 782 | <div class="content"> |
| 783 | <pre><tt>Proper Name <commit@email.xx></tt></pre> |
| 784 | </div></div> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 785 | <div class="para"><p>The more complex forms are:</p></div> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 786 | <div class="literalblock"> |
| 787 | <div class="content"> |
| 788 | <pre><tt><proper@email.xx> <commit@email.xx></tt></pre> |
| 789 | </div></div> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 790 | <div class="para"><p>which allows mailmap to replace only the email part of a commit, and:</p></div> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 791 | <div class="literalblock"> |
| 792 | <div class="content"> |
| 793 | <pre><tt>Proper Name <proper@email.xx> <commit@email.xx></tt></pre> |
| 794 | </div></div> |
| 795 | <div class="para"><p>which allows mailmap to replace both the name and the email of a |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 796 | commit matching the specified commit email address, and:</p></div> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 797 | <div class="literalblock"> |
| 798 | <div class="content"> |
| 799 | <pre><tt>Proper Name <proper@email.xx> Commit Name <commit@email.xx></tt></pre> |
| 800 | </div></div> |
| 801 | <div class="para"><p>which allows mailmap to replace both the name and the email of a |
| 802 | commit matching both the specified commit name and email address.</p></div> |
| 803 | <div class="para"><p>Example 1: Your history contains commits by two authors, Jane |
| 804 | and Joe, whose names appear in the repository under several forms:</p></div> |
| 805 | <div class="listingblock"> |
| 806 | <div class="content"> |
| 807 | <pre><tt>Joe Developer <joe@example.com> |
| 808 | Joe R. Developer <joe@example.com> |
| 809 | Jane Doe <jane@example.com> |
| 810 | Jane Doe <jane@laptop.(none)> |
| 811 | Jane D. <jane@desktop.(none)></tt></pre> |
| 812 | </div></div> |
| 813 | <div class="para"><p>Now suppose that Joe wants his middle name initial used, and Jane |
| 814 | prefers her family name fully spelled out. A proper <tt>.mailmap</tt> file |
| 815 | would look like:</p></div> |
| 816 | <div class="listingblock"> |
| 817 | <div class="content"> |
| 818 | <pre><tt>Jane Doe <jane@desktop.(none)> |
| 819 | Joe R. Developer <joe@example.com></tt></pre> |
| 820 | </div></div> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 821 | <div class="para"><p>Note how there is no need for an entry for <jane@laptop.(none)>, because the |
| 822 | real name of that author is already correct.</p></div> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 823 | <div class="para"><p>Example 2: Your repository contains commits from the following |
| 824 | authors:</p></div> |
| 825 | <div class="listingblock"> |
| 826 | <div class="content"> |
| 827 | <pre><tt>nick1 <bugs@company.xx> |
| 828 | nick2 <bugs@company.xx> |
| 829 | nick2 <nick2@company.xx> |
| 830 | santa <me@company.xx> |
| 831 | claus <me@company.xx> |
| 832 | CTO <cto@coompany.xx></tt></pre> |
| 833 | </div></div> |
Junio C Hamano | fd83b8e | 2009-03-22 08:21:41 | [diff] [blame] | 834 | <div class="para"><p>Then you might want a <tt>.mailmap</tt> file that looks like:</p></div> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 835 | <div class="listingblock"> |
| 836 | <div class="content"> |
| 837 | <pre><tt><cto@company.xx> <cto@coompany.xx> |
| 838 | Some Dude <some@dude.xx> nick1 <bugs@company.xx> |
| 839 | Other Author <other@author.xx> nick2 <bugs@company.xx> |
| 840 | Other Author <other@author.xx> <nick2@company.xx> |
| 841 | Santa Claus <santa.claus@northpole.xx> <me@company.xx></tt></pre> |
| 842 | </div></div> |
| 843 | <div class="para"><p>Use hash <em>#</em> for comments that are either on their own line, or after |
| 844 | the email address.</p></div> |
| 845 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 846 | <h2 id="_see_also">SEE ALSO</h2> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 847 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 848 | <div class="para"><p><a href="git-annotate.html">git-annotate(1)</a></p></div> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 849 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 850 | <h2 id="_author">AUTHOR</h2> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 851 | <div class="sectionbody"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 852 | <div class="para"><p>Written by Junio C Hamano <gitster@pobox.com></p></div> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 853 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 854 | <h2 id="_git">GIT</h2> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 855 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 856 | <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 857 | </div> |
| 858 | <div id="footer"> |
| 859 | <div id="footer-text"> |
Junio C Hamano | 73d812c | 2009-07-01 02:33:06 | [diff] [blame] | 860 | Last updated 2009-07-01 02:30:43 UTC |
Junio C Hamano | b33fb4f | 2006-04-18 21:30:51 | [diff] [blame] | 861 | </div> |
| 862 | </div> |
| 863 | </body> |
| 864 | </html> |