Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 48 | border-bottom: 2px solid silver; |
| 49 | } |
| 50 | h2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 306 | </style> |
| 307 | <title>git-log(1)</title> |
| 308 | </head> |
| 309 | <body> |
| 310 | <div id="header"> |
| 311 | <h1> |
| 312 | git-log(1) Manual Page |
| 313 | </h1> |
| 314 | <h2>NAME</h2> |
| 315 | <div class="sectionbody"> |
| 316 | <p>git-log - |
| 317 | Show commit logs |
| 318 | </p> |
| 319 | </div> |
| 320 | </div> |
| 321 | <h2>SYNOPSIS</h2> |
| 322 | <div class="sectionbody"> |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 323 | <div class="para"><p><em>git log</em> [<options>] [<since>..<until>] [[--] <path>…]</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 324 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 325 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 326 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 327 | <div class="para"><p>Shows the commit logs.</p></div> |
| 328 | <div class="para"><p>The command takes options applicable to the <em>git-rev-list</em> |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 329 | command to control what is shown and how, and options applicable to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 330 | the <em>git-diff-*</em> commands to control how the changes |
| 331 | each commit introduces are shown.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 332 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 333 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 334 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 335 | <div class="vlist"><dl> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 336 | <dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 337 | -p |
| 338 | </dt> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 339 | <dt> |
| 340 | -u |
| 341 | </dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 342 | <dd> |
| 343 | <p> |
| 344 | Generate patch (see section on generating patches). |
| 345 | |
| 346 | </p> |
| 347 | </dd> |
| 348 | <dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 349 | -U<n> |
| 350 | </dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 351 | <dt> |
| 352 | --unified=<n> |
| 353 | </dt> |
| 354 | <dd> |
| 355 | <p> |
| 356 | Generate diffs with <n> lines of context instead of |
| 357 | the usual three. Implies "-p". |
| 358 | </p> |
| 359 | </dd> |
| 360 | <dt> |
| 361 | --raw |
| 362 | </dt> |
| 363 | <dd> |
| 364 | <p> |
| 365 | Generate the raw format. |
| 366 | |
| 367 | </p> |
| 368 | </dd> |
| 369 | <dt> |
| 370 | --patch-with-raw |
| 371 | </dt> |
| 372 | <dd> |
| 373 | <p> |
| 374 | Synonym for "-p --raw". |
| 375 | </p> |
| 376 | </dd> |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 377 | <dt> |
| 378 | --patience |
| 379 | </dt> |
| 380 | <dd> |
| 381 | <p> |
| 382 | Generate a diff using the "patience diff" algorithm. |
| 383 | </p> |
| 384 | </dd> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 385 | <dt> |
| 386 | --stat[=width[,name-width]] |
| 387 | </dt> |
| 388 | <dd> |
| 389 | <p> |
| 390 | Generate a diffstat. You can override the default |
| 391 | output width for 80-column terminal by "--stat=width". |
| 392 | The width of the filename part can be controlled by |
| 393 | giving another width to it separated by a comma. |
| 394 | </p> |
| 395 | </dd> |
| 396 | <dt> |
| 397 | --numstat |
| 398 | </dt> |
| 399 | <dd> |
| 400 | <p> |
| 401 | Similar to --stat, but shows number of added and |
| 402 | deleted lines in decimal notation and pathname without |
| 403 | abbreviation, to make it more machine friendly. For |
| 404 | binary files, outputs two <tt>-</tt> instead of saying |
| 405 | <tt>0 0</tt>. |
| 406 | </p> |
| 407 | </dd> |
| 408 | <dt> |
| 409 | --shortstat |
| 410 | </dt> |
| 411 | <dd> |
| 412 | <p> |
| 413 | Output only the last line of the --stat format containing total |
| 414 | number of modified files, as well as number of added and deleted |
| 415 | lines. |
| 416 | </p> |
| 417 | </dd> |
| 418 | <dt> |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 419 | --dirstat[=limit] |
| 420 | </dt> |
| 421 | <dd> |
| 422 | <p> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 423 | Output the distribution of relative amount of changes (number of lines added or |
| 424 | removed) for each sub-directory. Directories with changes below |
| 425 | a cut-off percent (3% by default) are not shown. The cut-off percent |
| 426 | can be set with "--dirstat=limit". Changes in a child directory is not |
| 427 | counted for the parent directory, unless "--cumulative" is used. |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 428 | </p> |
| 429 | </dd> |
| 430 | <dt> |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 431 | --dirstat-by-file[=limit] |
| 432 | </dt> |
| 433 | <dd> |
| 434 | <p> |
| 435 | Same as --dirstat, but counts changed files instead of lines. |
| 436 | </p> |
| 437 | </dd> |
| 438 | <dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 439 | --summary |
| 440 | </dt> |
| 441 | <dd> |
| 442 | <p> |
| 443 | Output a condensed summary of extended header information |
| 444 | such as creations, renames and mode changes. |
| 445 | </p> |
| 446 | </dd> |
| 447 | <dt> |
| 448 | --patch-with-stat |
| 449 | </dt> |
| 450 | <dd> |
| 451 | <p> |
| 452 | Synonym for "-p --stat". |
| 453 | |
| 454 | </p> |
| 455 | </dd> |
| 456 | <dt> |
| 457 | -z |
| 458 | </dt> |
| 459 | <dd> |
| 460 | <p> |
| 461 | NUL-line termination on output. This affects the --raw |
| 462 | output field terminator. Also output from commands such |
| 463 | as "git-log" will be delimited with NUL between commits. |
| 464 | </p> |
| 465 | </dd> |
| 466 | <dt> |
| 467 | --name-only |
| 468 | </dt> |
| 469 | <dd> |
| 470 | <p> |
| 471 | Show only names of changed files. |
| 472 | </p> |
| 473 | </dd> |
| 474 | <dt> |
| 475 | --name-status |
| 476 | </dt> |
| 477 | <dd> |
| 478 | <p> |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 479 | Show only names and status of changed files. See the description |
| 480 | of the <tt>--diff-filter</tt> option on what the status letters mean. |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 481 | </p> |
| 482 | </dd> |
| 483 | <dt> |
| 484 | --color |
| 485 | </dt> |
| 486 | <dd> |
| 487 | <p> |
| 488 | Show colored diff. |
| 489 | </p> |
| 490 | </dd> |
| 491 | <dt> |
| 492 | --no-color |
| 493 | </dt> |
| 494 | <dd> |
| 495 | <p> |
| 496 | Turn off colored diff, even when the configuration file |
| 497 | gives the default to color output. |
| 498 | </p> |
| 499 | </dd> |
| 500 | <dt> |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 501 | --color-words[=<regex>] |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 502 | </dt> |
| 503 | <dd> |
| 504 | <p> |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 505 | Show colored word diff, i.e., color words which have changed. |
| 506 | By default, words are separated by whitespace. |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 507 | </p> |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 508 | <div class="para"><p>When a <regex> is specified, every non-overlapping match of the |
| 509 | <regex> is considered a word. Anything between these matches is |
| 510 | considered whitespace and ignored(!) for the purposes of finding |
| 511 | differences. You may want to append <tt>|[^[:space:]]</tt> to your regular |
| 512 | expression to make sure that it matches all non-whitespace characters. |
| 513 | A match that contains a newline is silently truncated(!) at the |
| 514 | newline.</p></div> |
| 515 | <div class="para"><p>The regex can also be set via a diff driver or configuration option, see |
| 516 | <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly |
| 517 | overrides any diff driver or configuration setting. Diff drivers |
| 518 | override configuration settings.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 519 | </dd> |
| 520 | <dt> |
| 521 | --no-renames |
| 522 | </dt> |
| 523 | <dd> |
| 524 | <p> |
| 525 | Turn off rename detection, even when the configuration |
| 526 | file gives the default to do so. |
| 527 | </p> |
| 528 | </dd> |
| 529 | <dt> |
| 530 | --check |
| 531 | </dt> |
| 532 | <dd> |
| 533 | <p> |
| 534 | Warn if changes introduce trailing whitespace |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 535 | or an indent that uses a space before a tab. Exits with |
| 536 | non-zero status if problems are found. Not compatible with |
| 537 | --exit-code. |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 538 | </p> |
| 539 | </dd> |
| 540 | <dt> |
| 541 | --full-index |
| 542 | </dt> |
| 543 | <dd> |
| 544 | <p> |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 545 | Instead of the first handful of characters, show the full |
| 546 | pre- and post-image blob object names on the "index" |
| 547 | line when generating patch format output. |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 548 | </p> |
| 549 | </dd> |
| 550 | <dt> |
| 551 | --binary |
| 552 | </dt> |
| 553 | <dd> |
| 554 | <p> |
| 555 | In addition to --full-index, output "binary diff" that |
| 556 | can be applied with "git apply". |
| 557 | </p> |
| 558 | </dd> |
| 559 | <dt> |
| 560 | --abbrev[=<n>] |
| 561 | </dt> |
| 562 | <dd> |
| 563 | <p> |
| 564 | Instead of showing the full 40-byte hexadecimal object |
| 565 | name in diff-raw format output and diff-tree header |
Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 566 | lines, show only a partial prefix. This is |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 567 | independent of --full-index option above, which controls |
| 568 | the diff-patch output format. Non default number of |
| 569 | digits can be specified with --abbrev=<n>. |
| 570 | </p> |
| 571 | </dd> |
| 572 | <dt> |
| 573 | -B |
| 574 | </dt> |
| 575 | <dd> |
| 576 | <p> |
| 577 | Break complete rewrite changes into pairs of delete and create. |
| 578 | </p> |
| 579 | </dd> |
| 580 | <dt> |
| 581 | -M |
| 582 | </dt> |
| 583 | <dd> |
| 584 | <p> |
| 585 | Detect renames. |
| 586 | </p> |
| 587 | </dd> |
| 588 | <dt> |
| 589 | -C |
| 590 | </dt> |
| 591 | <dd> |
| 592 | <p> |
| 593 | Detect copies as well as renames. See also <tt>--find-copies-harder</tt>. |
| 594 | </p> |
| 595 | </dd> |
| 596 | <dt> |
| 597 | --diff-filter=[ACDMRTUXB*] |
| 598 | </dt> |
| 599 | <dd> |
| 600 | <p> |
| 601 | Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>), |
| 602 | Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their |
Junio C Hamano | a2deec5 | 2008-10-18 18:58:09 | [diff] [blame] | 603 | type (i.e. regular file, symlink, submodule, …) changed (<tt>T</tt>), |
| 604 | are Unmerged (<tt>U</tt>), are |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 605 | Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>). |
| 606 | Any combination of the filter characters may be used. |
| 607 | When <tt>*</tt> (All-or-none) is added to the combination, all |
| 608 | paths are selected if there is any file that matches |
| 609 | other criteria in the comparison; if there is no file |
| 610 | that matches other criteria, nothing is selected. |
| 611 | </p> |
| 612 | </dd> |
| 613 | <dt> |
| 614 | --find-copies-harder |
| 615 | </dt> |
| 616 | <dd> |
| 617 | <p> |
| 618 | For performance reasons, by default, <tt>-C</tt> option finds copies only |
| 619 | if the original file of the copy was modified in the same |
| 620 | changeset. This flag makes the command |
| 621 | inspect unmodified files as candidates for the source of |
| 622 | copy. This is a very expensive operation for large |
| 623 | projects, so use it with caution. Giving more than one |
| 624 | <tt>-C</tt> option has the same effect. |
| 625 | </p> |
| 626 | </dd> |
| 627 | <dt> |
| 628 | -l<num> |
| 629 | </dt> |
| 630 | <dd> |
| 631 | <p> |
| 632 | -M and -C options require O(n^2) processing time where n |
| 633 | is the number of potential rename/copy targets. This |
| 634 | option prevents rename/copy detection from running if |
| 635 | the number of rename/copy targets exceeds the specified |
| 636 | number. |
| 637 | </p> |
| 638 | </dd> |
| 639 | <dt> |
| 640 | -S<string> |
| 641 | </dt> |
| 642 | <dd> |
| 643 | <p> |
Junio C Hamano | 5217a27 | 2009-03-21 00:39:33 | [diff] [blame] | 644 | Look for differences that introduce or remove an instance of |
| 645 | <string>. Note that this is different than the string simply |
| 646 | appearing in diff output; see the <em>pickaxe</em> entry in |
| 647 | <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details. |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 648 | </p> |
| 649 | </dd> |
| 650 | <dt> |
| 651 | --pickaxe-all |
| 652 | </dt> |
| 653 | <dd> |
| 654 | <p> |
| 655 | When -S finds a change, show all the changes in that |
| 656 | changeset, not just the files that contain the change |
| 657 | in <string>. |
| 658 | </p> |
| 659 | </dd> |
| 660 | <dt> |
| 661 | --pickaxe-regex |
| 662 | </dt> |
| 663 | <dd> |
| 664 | <p> |
| 665 | Make the <string> not a plain string but an extended POSIX |
| 666 | regex to match. |
| 667 | </p> |
| 668 | </dd> |
| 669 | <dt> |
| 670 | -O<orderfile> |
| 671 | </dt> |
| 672 | <dd> |
| 673 | <p> |
| 674 | Output the patch in the order specified in the |
| 675 | <orderfile>, which has one shell glob pattern per line. |
| 676 | </p> |
| 677 | </dd> |
| 678 | <dt> |
| 679 | -R |
| 680 | </dt> |
| 681 | <dd> |
| 682 | <p> |
| 683 | Swap two inputs; that is, show differences from index or |
| 684 | on-disk file to tree contents. |
| 685 | </p> |
| 686 | </dd> |
| 687 | <dt> |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 688 | --relative[=<path>] |
| 689 | </dt> |
| 690 | <dd> |
| 691 | <p> |
| 692 | When run from a subdirectory of the project, it can be |
| 693 | told to exclude changes outside the directory and show |
| 694 | pathnames relative to it with this option. When you are |
| 695 | not in a subdirectory (e.g. in a bare repository), you |
| 696 | can name which subdirectory to make the output relative |
| 697 | to by giving a <path> as an argument. |
| 698 | </p> |
| 699 | </dd> |
| 700 | <dt> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 701 | -a |
| 702 | </dt> |
| 703 | <dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 704 | --text |
| 705 | </dt> |
| 706 | <dd> |
| 707 | <p> |
| 708 | Treat all files as text. |
| 709 | </p> |
| 710 | </dd> |
| 711 | <dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 712 | --ignore-space-at-eol |
| 713 | </dt> |
| 714 | <dd> |
| 715 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 716 | Ignore changes in whitespace at EOL. |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 717 | </p> |
| 718 | </dd> |
| 719 | <dt> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 720 | -b |
| 721 | </dt> |
| 722 | <dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 723 | --ignore-space-change |
| 724 | </dt> |
| 725 | <dd> |
| 726 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 727 | Ignore changes in amount of whitespace. This ignores whitespace |
| 728 | at line end, and considers all other sequences of one or |
| 729 | more whitespace characters to be equivalent. |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 730 | </p> |
| 731 | </dd> |
| 732 | <dt> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 733 | -w |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 734 | </dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 735 | <dt> |
| 736 | --ignore-all-space |
| 737 | </dt> |
| 738 | <dd> |
| 739 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 740 | Ignore whitespace when comparing lines. This ignores |
| 741 | differences even if one line has whitespace where the other |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 742 | line has none. |
| 743 | </p> |
| 744 | </dd> |
| 745 | <dt> |
Junio C Hamano | 1d40ee8 | 2009-01-07 10:14:16 | [diff] [blame] | 746 | --inter-hunk-context=<lines> |
| 747 | </dt> |
| 748 | <dd> |
| 749 | <p> |
| 750 | Show the context between diff hunks, up to the specified number |
| 751 | of lines, thereby fusing hunks that are close to each other. |
| 752 | </p> |
| 753 | </dd> |
| 754 | <dt> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 755 | --exit-code |
| 756 | </dt> |
| 757 | <dd> |
| 758 | <p> |
| 759 | Make the program exit with codes similar to diff(1). |
| 760 | That is, it exits with 1 if there were differences and |
| 761 | 0 means no differences. |
| 762 | </p> |
| 763 | </dd> |
| 764 | <dt> |
| 765 | --quiet |
| 766 | </dt> |
| 767 | <dd> |
| 768 | <p> |
| 769 | Disable all output of the program. Implies --exit-code. |
| 770 | </p> |
| 771 | </dd> |
| 772 | <dt> |
| 773 | --ext-diff |
| 774 | </dt> |
| 775 | <dd> |
| 776 | <p> |
| 777 | Allow an external diff helper to be executed. If you set an |
| 778 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 779 | to use this option with <a href="git-log.html">git-log(1)</a> and friends. |
| 780 | </p> |
| 781 | </dd> |
| 782 | <dt> |
| 783 | --no-ext-diff |
| 784 | </dt> |
| 785 | <dd> |
| 786 | <p> |
| 787 | Disallow external diff drivers. |
| 788 | </p> |
| 789 | </dd> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 790 | <dt> |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 791 | --ignore-submodules |
| 792 | </dt> |
| 793 | <dd> |
| 794 | <p> |
| 795 | Ignore changes to submodules in the diff generation. |
| 796 | </p> |
| 797 | </dd> |
| 798 | <dt> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 799 | --src-prefix=<prefix> |
| 800 | </dt> |
| 801 | <dd> |
| 802 | <p> |
| 803 | Show the given source prefix instead of "a/". |
| 804 | </p> |
| 805 | </dd> |
| 806 | <dt> |
| 807 | --dst-prefix=<prefix> |
| 808 | </dt> |
| 809 | <dd> |
| 810 | <p> |
| 811 | Show the given destination prefix instead of "b/". |
| 812 | </p> |
| 813 | </dd> |
| 814 | <dt> |
| 815 | --no-prefix |
| 816 | </dt> |
| 817 | <dd> |
| 818 | <p> |
| 819 | Do not show any source or destination prefix. |
| 820 | </p> |
| 821 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 822 | </dl></div> |
| 823 | <div class="para"><p>For more detailed explanation on these common options, see also |
| 824 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
| 825 | <div class="vlist"><dl> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 826 | <dt> |
| 827 | -<n> |
| 828 | </dt> |
| 829 | <dd> |
| 830 | <p> |
| 831 | Limits the number of commits to show. |
| 832 | </p> |
| 833 | </dd> |
| 834 | <dt> |
| 835 | <since>..<until> |
| 836 | </dt> |
| 837 | <dd> |
| 838 | <p> |
| 839 | Show only commits between the named two commits. When |
| 840 | either <since> or <until> is omitted, it defaults to |
| 841 | <tt>HEAD</tt>, i.e. the tip of the current branch. |
| 842 | For a more complete list of ways to spell <since> |
| 843 | and <until>, see "SPECIFYING REVISIONS" section in |
| 844 | <a href="git-rev-parse.html">git-rev-parse(1)</a>. |
| 845 | </p> |
| 846 | </dd> |
| 847 | <dt> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 848 | --decorate |
| 849 | </dt> |
| 850 | <dd> |
| 851 | <p> |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 852 | Print out the ref names of any commits that are shown. |
| 853 | </p> |
| 854 | </dd> |
| 855 | <dt> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 856 | --source |
| 857 | </dt> |
| 858 | <dd> |
| 859 | <p> |
| 860 | Print out the ref name given on the command line by which each |
| 861 | commit was reached. |
| 862 | </p> |
| 863 | </dd> |
| 864 | <dt> |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 865 | --full-diff |
| 866 | </dt> |
| 867 | <dd> |
| 868 | <p> |
Junio C Hamano | 9e39507 | 2008-07-31 22:11:21 | [diff] [blame] | 869 | Without this flag, "git log -p <path>…" shows commits that |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 870 | touch the specified paths, and diffs about the same specified |
| 871 | paths. With this, the full diff is shown for commits that touch |
Junio C Hamano | 9e39507 | 2008-07-31 22:11:21 | [diff] [blame] | 872 | the specified paths; this means that "<path>…" limits only |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 873 | commits, and doesn't limit diff for those commits. |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 874 | </p> |
| 875 | </dd> |
| 876 | <dt> |
Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 877 | --follow |
| 878 | </dt> |
| 879 | <dd> |
| 880 | <p> |
| 881 | Continue listing the history of a file beyond renames. |
| 882 | </p> |
| 883 | </dd> |
| 884 | <dt> |
Junio C Hamano | 024b6c6 | 2007-08-14 09:43:08 | [diff] [blame] | 885 | --log-size |
| 886 | </dt> |
| 887 | <dd> |
| 888 | <p> |
| 889 | Before the log message print out its size in bytes. Intended |
| 890 | mainly for porcelain tools consumption. If git is unable to |
| 891 | produce a valid value size is set to zero. |
| 892 | Note that only message is considered, if also a diff is shown |
| 893 | its size is not included. |
| 894 | </p> |
| 895 | </dd> |
| 896 | <dt> |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 897 | [--] <path>… |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 898 | </dt> |
| 899 | <dd> |
| 900 | <p> |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 901 | Show only commits that affect any of the specified paths. To |
| 902 | prevent confusion with options and branch names, paths may need |
| 903 | to be prefixed with "-- " to separate them from options or |
| 904 | refnames. |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 905 | </p> |
| 906 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 907 | </dl></div> |
| 908 | <h3 id="_commit_formatting">Commit Formatting</h3><div style="clear:left"></div> |
| 909 | <div class="vlist"><dl> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 910 | <dt> |
| 911 | --pretty[=<em><format></em>] |
| 912 | </dt> |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 913 | <dt> |
| 914 | --format[=<em><format></em>] |
| 915 | </dt> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 916 | <dd> |
| 917 | <p> |
| 918 | Pretty-print the contents of the commit logs in a given format, |
| 919 | where <em><format></em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>, |
| 920 | <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:<string></em>. |
| 921 | When omitted, the format defaults to <em>medium</em>. |
| 922 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 923 | <div class="para"><p>Note: you can specify the default pretty format in the repository |
| 924 | configuration (see <a href="git-config.html">git-config(1)</a>).</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 925 | </dd> |
| 926 | <dt> |
| 927 | --abbrev-commit |
| 928 | </dt> |
| 929 | <dd> |
| 930 | <p> |
| 931 | Instead of showing the full 40-byte hexadecimal commit object |
Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 932 | name, show only a partial prefix. Non default number of |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 933 | digits can be specified with "--abbrev=<n>" (which also modifies |
| 934 | diff output, if it is displayed). |
| 935 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 936 | <div class="para"><p>This should make "--pretty=oneline" a whole lot more readable for |
| 937 | people using 80-column terminals.</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 938 | </dd> |
| 939 | <dt> |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 940 | --oneline |
| 941 | </dt> |
| 942 | <dd> |
| 943 | <p> |
| 944 | This is a shorthand for "--pretty=oneline --abbrev-commit" |
| 945 | used together. |
| 946 | </p> |
| 947 | </dd> |
| 948 | <dt> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 949 | --encoding[=<encoding>] |
| 950 | </dt> |
| 951 | <dd> |
| 952 | <p> |
| 953 | The commit objects record the encoding used for the log message |
| 954 | in their encoding header; this option can be used to tell the |
| 955 | command to re-code the commit log message in the encoding |
| 956 | preferred by the user. For non plumbing commands this |
| 957 | defaults to UTF-8. |
| 958 | </p> |
| 959 | </dd> |
| 960 | <dt> |
| 961 | --relative-date |
| 962 | </dt> |
| 963 | <dd> |
| 964 | <p> |
| 965 | Synonym for <tt>--date=relative</tt>. |
| 966 | </p> |
| 967 | </dd> |
| 968 | <dt> |
Junio C Hamano | bb65313 | 2009-02-22 08:09:35 | [diff] [blame] | 969 | --date={relative,local,default,iso,rfc,short,raw} |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 970 | </dt> |
| 971 | <dd> |
| 972 | <p> |
| 973 | Only takes effect for dates shown in human-readable format, such |
Junio C Hamano | b713ff1 | 2008-05-24 01:12:30 | [diff] [blame] | 974 | as when using "--pretty". <tt>log.date</tt> config variable sets a default |
| 975 | value for log command's --date option. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 976 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 977 | <div class="para"><p><tt>--date=relative</tt> shows dates relative to the current time, |
| 978 | e.g. "2 hours ago".</p></div> |
| 979 | <div class="para"><p><tt>--date=local</tt> shows timestamps in user's local timezone.</p></div> |
| 980 | <div class="para"><p><tt>--date=iso</tt> (or <tt>--date=iso8601</tt>) shows timestamps in ISO 8601 format.</p></div> |
| 981 | <div class="para"><p><tt>--date=rfc</tt> (or <tt>--date=rfc2822</tt>) shows timestamps in RFC 2822 |
| 982 | format, often found in E-mail messages.</p></div> |
| 983 | <div class="para"><p><tt>--date=short</tt> shows only date but not time, in <tt>YYYY-MM-DD</tt> format.</p></div> |
Junio C Hamano | bb65313 | 2009-02-22 08:09:35 | [diff] [blame] | 984 | <div class="para"><p><tt>--date=raw</tt> shows the date in the internal raw git format <tt>%s %z</tt> format.</p></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 985 | <div class="para"><p><tt>--date=default</tt> shows timestamps in the original timezone |
| 986 | (either committer's or author's).</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 987 | </dd> |
| 988 | <dt> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 989 | --parents |
| 990 | </dt> |
| 991 | <dd> |
| 992 | <p> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 993 | Print the parents of the commit. Also enables parent |
| 994 | rewriting, see <em>History Simplification</em> below. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 995 | </p> |
| 996 | </dd> |
| 997 | <dt> |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 998 | --children |
| 999 | </dt> |
| 1000 | <dd> |
| 1001 | <p> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1002 | Print the children of the commit. Also enables parent |
| 1003 | rewriting, see <em>History Simplification</em> below. |
Junio C Hamano | 46a38aa | 2008-07-14 03:13:27 | [diff] [blame] | 1004 | </p> |
| 1005 | </dd> |
| 1006 | <dt> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1007 | --left-right |
| 1008 | </dt> |
| 1009 | <dd> |
| 1010 | <p> |
| 1011 | Mark which side of a symmetric diff a commit is reachable from. |
| 1012 | Commits from the left side are prefixed with <tt><</tt> and those from |
| 1013 | the right with <tt>></tt>. If combined with <tt>--boundary</tt>, those |
| 1014 | commits are prefixed with <tt>-</tt>. |
| 1015 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1016 | <div class="para"><p>For example, if you have this topology:</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1017 | <div class="listingblock"> |
| 1018 | <div class="content"> |
| 1019 | <pre><tt> y---b---b branch B |
| 1020 | / \ / |
| 1021 | / . |
| 1022 | / / \ |
| 1023 | o---x---a---a branch A</tt></pre> |
| 1024 | </div></div> |
Junio C Hamano | c96fb5a | 2008-08-12 06:59:38 | [diff] [blame] | 1025 | <div class="para"><p>you would get an output like this:</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1026 | <div class="listingblock"> |
| 1027 | <div class="content"> |
| 1028 | <pre><tt> $ git rev-list --left-right --boundary --pretty=oneline A...B |
| 1029 | |
| 1030 | >bbbbbbb... 3rd on b |
| 1031 | >bbbbbbb... 2nd on b |
| 1032 | <aaaaaaa... 3rd on a |
| 1033 | <aaaaaaa... 2nd on a |
| 1034 | -yyyyyyy... 1st on b |
| 1035 | -xxxxxxx... 1st on a</tt></pre> |
| 1036 | </div></div> |
| 1037 | </dd> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1038 | <dt> |
| 1039 | --graph |
| 1040 | </dt> |
| 1041 | <dd> |
| 1042 | <p> |
| 1043 | Draw a text-based graphical representation of the commit history |
| 1044 | on the left hand side of the output. This may cause extra lines |
| 1045 | to be printed in between commits, in order for the graph history |
| 1046 | to be drawn properly. |
| 1047 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1048 | <div class="para"><p>This implies the <em>--topo-order</em> option by default, but the |
| 1049 | <em>--date-order</em> option may also be specified.</p></div> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1050 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1051 | </dl></div> |
| 1052 | <h3 id="_diff_formatting">Diff Formatting</h3><div style="clear:left"></div> |
| 1053 | <div class="para"><p>Below are listed options that control the formatting of diff output. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1054 | Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1055 | options may be given. See <a href="git-diff-files.html">git-diff-files(1)</a> for more options.</p></div> |
| 1056 | <div class="vlist"><dl> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1057 | <dt> |
| 1058 | -c |
| 1059 | </dt> |
| 1060 | <dd> |
| 1061 | <p> |
| 1062 | This flag changes the way a merge commit is displayed. It shows |
| 1063 | the differences from each of the parents to the merge result |
| 1064 | simultaneously instead of showing pairwise diff between a parent |
| 1065 | and the result one at a time. Furthermore, it lists only files |
| 1066 | which were modified from all parents. |
| 1067 | </p> |
| 1068 | </dd> |
| 1069 | <dt> |
| 1070 | --cc |
| 1071 | </dt> |
| 1072 | <dd> |
| 1073 | <p> |
| 1074 | This flag implies the <em>-c</em> options and further compresses the |
Junio C Hamano | ccc2f76 | 2008-07-24 04:03:33 | [diff] [blame] | 1075 | patch output by omitting uninteresting hunks whose contents in |
| 1076 | the parents have only two variants and the merge result picks |
| 1077 | one of them without modification. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1078 | </p> |
| 1079 | </dd> |
| 1080 | <dt> |
| 1081 | -r |
| 1082 | </dt> |
| 1083 | <dd> |
| 1084 | <p> |
| 1085 | Show recursive diffs. |
| 1086 | </p> |
| 1087 | </dd> |
| 1088 | <dt> |
| 1089 | -t |
| 1090 | </dt> |
| 1091 | <dd> |
| 1092 | <p> |
| 1093 | Show the tree objects in the diff output. This implies <em>-r</em>. |
| 1094 | </p> |
| 1095 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1096 | </dl></div> |
| 1097 | <h3 id="_commit_limiting">Commit Limiting</h3><div style="clear:left"></div> |
| 1098 | <div class="para"><p>Besides specifying a range of commits that should be listed using the |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1099 | special notations explained in the description, additional commit |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1100 | limiting may be applied.</p></div> |
| 1101 | <div class="vlist"><dl> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1102 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1103 | -n <em>number</em> |
| 1104 | </dt> |
| 1105 | <dt> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1106 | --max-count=<number> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1107 | </dt> |
| 1108 | <dd> |
| 1109 | <p> |
| 1110 | Limit the number of commits output. |
| 1111 | </p> |
| 1112 | </dd> |
| 1113 | <dt> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1114 | --skip=<number> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1115 | </dt> |
| 1116 | <dd> |
| 1117 | <p> |
| 1118 | Skip <em>number</em> commits before starting to show the commit output. |
| 1119 | </p> |
| 1120 | </dd> |
| 1121 | <dt> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1122 | --since=<date> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1123 | </dt> |
| 1124 | <dt> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1125 | --after=<date> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1126 | </dt> |
| 1127 | <dd> |
| 1128 | <p> |
| 1129 | Show commits more recent than a specific date. |
| 1130 | </p> |
| 1131 | </dd> |
| 1132 | <dt> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1133 | --until=<date> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1134 | </dt> |
| 1135 | <dt> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1136 | --before=<date> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1137 | </dt> |
| 1138 | <dd> |
| 1139 | <p> |
| 1140 | Show commits older than a specific date. |
| 1141 | </p> |
| 1142 | </dd> |
| 1143 | <dt> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1144 | --author=<pattern> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1145 | </dt> |
| 1146 | <dt> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1147 | --committer=<pattern> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1148 | </dt> |
| 1149 | <dd> |
| 1150 | <p> |
| 1151 | Limit the commits output to ones with author/committer |
| 1152 | header lines that match the specified pattern (regular expression). |
| 1153 | </p> |
| 1154 | </dd> |
| 1155 | <dt> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1156 | --grep=<pattern> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1157 | </dt> |
| 1158 | <dd> |
| 1159 | <p> |
| 1160 | Limit the commits output to ones with log message that |
| 1161 | matches the specified pattern (regular expression). |
| 1162 | </p> |
| 1163 | </dd> |
| 1164 | <dt> |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1165 | --all-match |
| 1166 | </dt> |
| 1167 | <dd> |
| 1168 | <p> |
| 1169 | Limit the commits output to ones that match all given --grep, |
| 1170 | --author and --committer instead of ones that match at least one. |
| 1171 | </p> |
| 1172 | </dd> |
| 1173 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1174 | -i |
| 1175 | </dt> |
| 1176 | <dt> |
| 1177 | --regexp-ignore-case |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1178 | </dt> |
| 1179 | <dd> |
| 1180 | <p> |
| 1181 | Match the regexp limiting patterns without regard to letters case. |
| 1182 | </p> |
| 1183 | </dd> |
| 1184 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1185 | -E |
| 1186 | </dt> |
| 1187 | <dt> |
| 1188 | --extended-regexp |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1189 | </dt> |
| 1190 | <dd> |
| 1191 | <p> |
| 1192 | Consider the limiting patterns to be extended regular expressions |
| 1193 | instead of the default basic regular expressions. |
| 1194 | </p> |
| 1195 | </dd> |
| 1196 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1197 | -F |
| 1198 | </dt> |
| 1199 | <dt> |
| 1200 | --fixed-strings |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1201 | </dt> |
| 1202 | <dd> |
| 1203 | <p> |
| 1204 | Consider the limiting patterns to be fixed strings (don't interpret |
| 1205 | pattern as a regular expression). |
| 1206 | </p> |
| 1207 | </dd> |
| 1208 | <dt> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1209 | --remove-empty |
| 1210 | </dt> |
| 1211 | <dd> |
| 1212 | <p> |
| 1213 | Stop when a given path disappears from the tree. |
| 1214 | </p> |
| 1215 | </dd> |
| 1216 | <dt> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1217 | --no-merges |
| 1218 | </dt> |
| 1219 | <dd> |
| 1220 | <p> |
| 1221 | Do not print commits with more than one parent. |
| 1222 | </p> |
| 1223 | </dd> |
| 1224 | <dt> |
| 1225 | --first-parent |
| 1226 | </dt> |
| 1227 | <dd> |
| 1228 | <p> |
| 1229 | Follow only the first parent commit upon seeing a merge |
| 1230 | commit. This option can give a better overview when |
| 1231 | viewing the evolution of a particular topic branch, |
| 1232 | because merges into a topic branch tend to be only about |
| 1233 | adjusting to updated upstream from time to time, and |
| 1234 | this option allows you to ignore the individual commits |
| 1235 | brought in to your history by such a merge. |
| 1236 | </p> |
| 1237 | </dd> |
| 1238 | <dt> |
| 1239 | --not |
| 1240 | </dt> |
| 1241 | <dd> |
| 1242 | <p> |
| 1243 | Reverses the meaning of the <em>^</em> prefix (or lack thereof) |
| 1244 | for all following revision specifiers, up to the next <em>--not</em>. |
| 1245 | </p> |
| 1246 | </dd> |
| 1247 | <dt> |
| 1248 | --all |
| 1249 | </dt> |
| 1250 | <dd> |
| 1251 | <p> |
| 1252 | Pretend as if all the refs in <tt>$GIT_DIR/refs/</tt> are listed on the |
| 1253 | command line as <em><commit></em>. |
| 1254 | </p> |
| 1255 | </dd> |
| 1256 | <dt> |
Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1257 | --branches |
| 1258 | </dt> |
| 1259 | <dd> |
| 1260 | <p> |
| 1261 | Pretend as if all the refs in <tt>$GIT_DIR/refs/heads</tt> are listed |
| 1262 | on the command line as <em><commit></em>. |
| 1263 | </p> |
| 1264 | </dd> |
| 1265 | <dt> |
| 1266 | --tags |
| 1267 | </dt> |
| 1268 | <dd> |
| 1269 | <p> |
| 1270 | Pretend as if all the refs in <tt>$GIT_DIR/refs/tags</tt> are listed |
| 1271 | on the command line as <em><commit></em>. |
| 1272 | </p> |
| 1273 | </dd> |
| 1274 | <dt> |
| 1275 | --remotes |
| 1276 | </dt> |
| 1277 | <dd> |
| 1278 | <p> |
| 1279 | Pretend as if all the refs in <tt>$GIT_DIR/refs/remotes</tt> are listed |
| 1280 | on the command line as <em><commit></em>. |
| 1281 | </p> |
| 1282 | </dd> |
| 1283 | <dt> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1284 | --cherry-pick |
| 1285 | </dt> |
| 1286 | <dd> |
| 1287 | <p> |
| 1288 | Omit any commit that introduces the same change as |
| 1289 | another commit on the "other side" when the set of |
| 1290 | commits are limited with symmetric difference.<br /> |
| 1291 | For example, if you have two branches, <tt>A</tt> and <tt>B</tt>, a usual way |
| 1292 | to list all commits on only one side of them is with |
| 1293 | <tt>--left-right</tt>, like the example above in the description of |
| 1294 | that option. It however shows the commits that were cherry-picked |
| 1295 | from the other branch (for example, "3rd on b" may be cherry-picked |
| 1296 | from branch A). With this option, such pairs of commits are |
| 1297 | excluded from the output. |
| 1298 | </p> |
| 1299 | </dd> |
| 1300 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1301 | -g |
| 1302 | </dt> |
| 1303 | <dt> |
| 1304 | --walk-reflogs |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1305 | </dt> |
| 1306 | <dd> |
| 1307 | <p> |
| 1308 | Instead of walking the commit ancestry chain, walk |
| 1309 | reflog entries from the most recent one to older ones. |
| 1310 | When this option is used you cannot specify commits to |
| 1311 | exclude (that is, <em>^commit</em>, <em>commit1..commit2</em>, |
| 1312 | nor <em>commit1…commit2</em> notations cannot be used).<br /> |
| 1313 | With <em>--pretty</em> format other than oneline (for obvious reasons), |
| 1314 | this causes the output to have two extra lines of information |
| 1315 | taken from the reflog. By default, <em>commit@{Nth}</em> notation is |
| 1316 | used in the output. When the starting commit is specified as |
Junio C Hamano | 1d36888 | 2008-08-11 22:03:10 | [diff] [blame] | 1317 | <em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1318 | instead. Under <em>--pretty=oneline</em>, the commit message is |
| 1319 | prefixed with this information on the same line. |
Junio C Hamano | 1d36888 | 2008-08-11 22:03:10 | [diff] [blame] | 1320 | This option cannot be combined with <em>--reverse</em>. |
| 1321 | See also <a href="git-reflog.html">git-reflog(1)</a>. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1322 | </p> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1323 | </dd> |
| 1324 | <dt> |
| 1325 | --merge |
| 1326 | </dt> |
| 1327 | <dd> |
| 1328 | <p> |
| 1329 | After a failed merge, show refs that touch files having a |
| 1330 | conflict and don't exist on all heads to merge. |
| 1331 | </p> |
| 1332 | </dd> |
| 1333 | <dt> |
| 1334 | --boundary |
| 1335 | </dt> |
| 1336 | <dd> |
| 1337 | <p> |
| 1338 | Output uninteresting commits at the boundary, which are usually |
| 1339 | not shown. |
| 1340 | </p> |
| 1341 | </dd> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1342 | </dl></div> |
| 1343 | <h3 id="_history_simplification">History Simplification</h3><div style="clear:left"></div> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1344 | <div class="para"><p>Sometimes you are only interested in parts of the history, for example the |
| 1345 | commits modifying a particular <path>. But there are two parts of |
| 1346 | <em>History Simplification</em>, one part is selecting the commits and the other |
| 1347 | is how to do it, as there are various strategies to simplify the history.</p></div> |
| 1348 | <div class="para"><p>The following options select the commits to be shown:</p></div> |
| 1349 | <div class="vlist"><dl> |
| 1350 | <dt> |
| 1351 | <paths> |
| 1352 | </dt> |
| 1353 | <dd> |
| 1354 | <p> |
| 1355 | Commits modifying the given <paths> are selected. |
| 1356 | </p> |
| 1357 | </dd> |
| 1358 | <dt> |
| 1359 | --simplify-by-decoration |
| 1360 | </dt> |
| 1361 | <dd> |
| 1362 | <p> |
| 1363 | Commits that are referred by some branch or tag are selected. |
| 1364 | </p> |
| 1365 | </dd> |
| 1366 | </dl></div> |
| 1367 | <div class="para"><p>Note that extra commits can be shown to give a meaningful history.</p></div> |
| 1368 | <div class="para"><p>The following options affect the way the simplification is performed:</p></div> |
| 1369 | <div class="vlist"><dl> |
| 1370 | <dt> |
| 1371 | Default mode |
| 1372 | </dt> |
| 1373 | <dd> |
| 1374 | <p> |
| 1375 | Simplifies the history to the simplest history explaining the |
| 1376 | final state of the tree. Simplest because it prunes some side |
| 1377 | branches if the end result is the same (i.e. merging branches |
| 1378 | with the same content) |
| 1379 | </p> |
| 1380 | </dd> |
| 1381 | <dt> |
| 1382 | --full-history |
| 1383 | </dt> |
| 1384 | <dd> |
| 1385 | <p> |
| 1386 | As the default mode but does not prune some history. |
| 1387 | </p> |
| 1388 | </dd> |
| 1389 | <dt> |
| 1390 | --dense |
| 1391 | </dt> |
| 1392 | <dd> |
| 1393 | <p> |
| 1394 | Only the selected commits are shown, plus some to have a |
| 1395 | meaningful history. |
| 1396 | </p> |
| 1397 | </dd> |
| 1398 | <dt> |
| 1399 | --sparse |
| 1400 | </dt> |
| 1401 | <dd> |
| 1402 | <p> |
| 1403 | All commits in the simplified history are shown. |
| 1404 | </p> |
| 1405 | </dd> |
| 1406 | <dt> |
| 1407 | --simplify-merges |
| 1408 | </dt> |
| 1409 | <dd> |
| 1410 | <p> |
| 1411 | Additional option to <em>--full-history</em> to remove some needless |
| 1412 | merges from the resulting history, as there are no selected |
| 1413 | commits contributing to this merge. |
| 1414 | </p> |
| 1415 | </dd> |
| 1416 | </dl></div> |
| 1417 | <div class="para"><p>A more detailed explanation follows.</p></div> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1418 | <div class="para"><p>Suppose you specified <tt>foo</tt> as the <paths>. We shall call commits |
| 1419 | that modify <tt>foo</tt> !TREESAME, and the rest TREESAME. (In a diff |
| 1420 | filtered for <tt>foo</tt>, they look different and equal, respectively.)</p></div> |
| 1421 | <div class="para"><p>In the following, we will always refer to the same example history to |
| 1422 | illustrate the differences between simplification settings. We assume |
| 1423 | that you are filtering for a file <tt>foo</tt> in this commit graph:</p></div> |
| 1424 | <div class="listingblock"> |
| 1425 | <div class="content"> |
| 1426 | <pre><tt> .-A---M---N---O---P |
| 1427 | / / / / / |
| 1428 | I B C D E |
| 1429 | \ / / / / |
| 1430 | `-------------'</tt></pre> |
| 1431 | </div></div> |
| 1432 | <div class="para"><p>The horizontal line of history A--P is taken to be the first parent of |
| 1433 | each merge. The commits are:</p></div> |
| 1434 | <div class="ilist"><ul> |
| 1435 | <li> |
| 1436 | <p> |
| 1437 | <tt>I</tt> is the initial commit, in which <tt>foo</tt> exists with contents |
| 1438 | "asdf", and a file <tt>quux</tt> exists with contents "quux". Initial |
| 1439 | commits are compared to an empty tree, so <tt>I</tt> is !TREESAME. |
| 1440 | </p> |
| 1441 | </li> |
| 1442 | <li> |
| 1443 | <p> |
| 1444 | In <tt>A</tt>, <tt>foo</tt> contains just "foo". |
| 1445 | </p> |
| 1446 | </li> |
| 1447 | <li> |
| 1448 | <p> |
| 1449 | <tt>B</tt> contains the same change as <tt>A</tt>. Its merge <tt>M</tt> is trivial and |
| 1450 | hence TREESAME to all parents. |
| 1451 | </p> |
| 1452 | </li> |
| 1453 | <li> |
| 1454 | <p> |
| 1455 | <tt>C</tt> does not change <tt>foo</tt>, but its merge <tt>N</tt> changes it to "foobar", |
| 1456 | so it is not TREESAME to any parent. |
| 1457 | </p> |
| 1458 | </li> |
| 1459 | <li> |
| 1460 | <p> |
| 1461 | <tt>D</tt> sets <tt>foo</tt> to "baz". Its merge <tt>O</tt> combines the strings from |
| 1462 | <tt>N</tt> and <tt>D</tt> to "foobarbaz"; i.e., it is not TREESAME to any parent. |
| 1463 | </p> |
| 1464 | </li> |
| 1465 | <li> |
| 1466 | <p> |
| 1467 | <tt>E</tt> changes <tt>quux</tt> to "xyzzy", and its merge <tt>P</tt> combines the |
| 1468 | strings to "quux xyzzy". Despite appearing interesting, <tt>P</tt> is |
| 1469 | TREESAME to all parents. |
| 1470 | </p> |
| 1471 | </li> |
| 1472 | </ul></div> |
| 1473 | <div class="para"><p><em>rev-list</em> walks backwards through history, including or excluding |
| 1474 | commits based on whether <em>--full-history</em> and/or parent rewriting |
| 1475 | (via <em>--parents</em> or <em>--children</em>) are used. The following settings |
| 1476 | are available.</p></div> |
| 1477 | <div class="vlist"><dl> |
| 1478 | <dt> |
| 1479 | Default mode |
| 1480 | </dt> |
| 1481 | <dd> |
| 1482 | <p> |
| 1483 | Commits are included if they are not TREESAME to any parent |
| 1484 | (though this can be changed, see <em>--sparse</em> below). If the |
| 1485 | commit was a merge, and it was TREESAME to one parent, follow |
| 1486 | only that parent. (Even if there are several TREESAME |
| 1487 | parents, follow only one of them.) Otherwise, follow all |
| 1488 | parents. |
| 1489 | </p> |
| 1490 | <div class="para"><p>This results in:</p></div> |
| 1491 | <div class="listingblock"> |
| 1492 | <div class="content"> |
| 1493 | <pre><tt> .-A---N---O |
| 1494 | / / |
| 1495 | I---------D</tt></pre> |
| 1496 | </div></div> |
| 1497 | <div class="para"><p>Note how the rule to only follow the TREESAME parent, if one is |
| 1498 | available, removed <tt>B</tt> from consideration entirely. <tt>C</tt> was |
| 1499 | considered via <tt>N</tt>, but is TREESAME. Root commits are compared to an |
| 1500 | empty tree, so <tt>I</tt> is !TREESAME.</p></div> |
| 1501 | <div class="para"><p>Parent/child relations are only visible with --parents, but that does |
| 1502 | not affect the commits selected in default mode, so we have shown the |
| 1503 | parent lines.</p></div> |
| 1504 | </dd> |
| 1505 | <dt> |
| 1506 | --full-history without parent rewriting |
| 1507 | </dt> |
| 1508 | <dd> |
| 1509 | <p> |
| 1510 | This mode differs from the default in one point: always follow |
| 1511 | all parents of a merge, even if it is TREESAME to one of them. |
| 1512 | Even if more than one side of the merge has commits that are |
| 1513 | included, this does not imply that the merge itself is! In |
| 1514 | the example, we get |
| 1515 | </p> |
| 1516 | <div class="listingblock"> |
| 1517 | <div class="content"> |
| 1518 | <pre><tt> I A B N D O</tt></pre> |
| 1519 | </div></div> |
| 1520 | <div class="para"><p><tt>P</tt> and <tt>M</tt> were excluded because they are TREESAME to a parent. <tt>E</tt>, |
| 1521 | <tt>C</tt> and <tt>B</tt> were all walked, but only <tt>B</tt> was !TREESAME, so the others |
| 1522 | do not appear.</p></div> |
| 1523 | <div class="para"><p>Note that without parent rewriting, it is not really possible to talk |
| 1524 | about the parent/child relationships between the commits, so we show |
| 1525 | them disconnected.</p></div> |
| 1526 | </dd> |
| 1527 | <dt> |
| 1528 | --full-history with parent rewriting |
| 1529 | </dt> |
| 1530 | <dd> |
| 1531 | <p> |
| 1532 | Ordinary commits are only included if they are !TREESAME |
| 1533 | (though this can be changed, see <em>--sparse</em> below). |
| 1534 | </p> |
| 1535 | <div class="para"><p>Merges are always included. However, their parent list is rewritten: |
| 1536 | Along each parent, prune away commits that are not included |
| 1537 | themselves. This results in</p></div> |
| 1538 | <div class="listingblock"> |
| 1539 | <div class="content"> |
| 1540 | <pre><tt> .-A---M---N---O---P |
| 1541 | / / / / / |
| 1542 | I B / D / |
| 1543 | \ / / / / |
| 1544 | `-------------'</tt></pre> |
| 1545 | </div></div> |
| 1546 | <div class="para"><p>Compare to <em>--full-history</em> without rewriting above. Note that <tt>E</tt> |
| 1547 | was pruned away because it is TREESAME, but the parent list of P was |
| 1548 | rewritten to contain <tt>E</tt>'s parent <tt>I</tt>. The same happened for <tt>C</tt> and |
| 1549 | <tt>N</tt>. Note also that <tt>P</tt> was included despite being TREESAME.</p></div> |
| 1550 | </dd> |
| 1551 | </dl></div> |
| 1552 | <div class="para"><p>In addition to the above settings, you can change whether TREESAME |
| 1553 | affects inclusion:</p></div> |
| 1554 | <div class="vlist"><dl> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1555 | <dt> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1556 | --dense |
| 1557 | </dt> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1558 | <dd> |
| 1559 | <p> |
| 1560 | Commits that are walked are included if they are not TREESAME |
| 1561 | to any parent. |
| 1562 | </p> |
| 1563 | </dd> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1564 | <dt> |
| 1565 | --sparse |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1566 | </dt> |
| 1567 | <dd> |
| 1568 | <p> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1569 | All commits that are walked are included. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1570 | </p> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1571 | <div class="para"><p>Note that without <em>--full-history</em>, this still simplifies merges: if |
| 1572 | one of the parents is TREESAME, we follow only that one, so the other |
| 1573 | sides of the merge are never walked.</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1574 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1575 | </dl></div> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1576 | <div class="para"><p>Finally, there is a fourth simplification mode available:</p></div> |
| 1577 | <div class="vlist"><dl> |
| 1578 | <dt> |
| 1579 | --simplify-merges |
| 1580 | </dt> |
| 1581 | <dd> |
| 1582 | <p> |
| 1583 | First, build a history graph in the same way that |
| 1584 | <em>--full-history</em> with parent rewriting does (see above). |
| 1585 | </p> |
| 1586 | <div class="para"><p>Then simplify each commit <tt>C</tt> to its replacement <tt>C'</tt> in the final |
| 1587 | history according to the following rules:</p></div> |
| 1588 | <div class="ilist"><ul> |
| 1589 | <li> |
| 1590 | <p> |
| 1591 | Set <tt>C'</tt> to <tt>C</tt>.<br /> |
| 1592 | </p> |
| 1593 | </li> |
| 1594 | <li> |
| 1595 | <p> |
| 1596 | Replace each parent <tt>P</tt> of <tt>C'</tt> with its simplification <tt>P'</tt>. In |
| 1597 | the process, drop parents that are ancestors of other parents, and |
| 1598 | remove duplicates.<br /> |
| 1599 | </p> |
| 1600 | </li> |
| 1601 | <li> |
| 1602 | <p> |
| 1603 | If after this parent rewriting, <tt>C'</tt> is a root or merge commit (has |
| 1604 | zero or >1 parents), a boundary commit, or !TREESAME, it remains. |
| 1605 | Otherwise, it is replaced with its only parent. |
| 1606 | </p> |
| 1607 | </li> |
| 1608 | </ul></div> |
| 1609 | <div class="para"><p>The effect of this is best shown by way of comparing to |
| 1610 | <em>--full-history</em> with parent rewriting. The example turns into:</p></div> |
| 1611 | <div class="listingblock"> |
| 1612 | <div class="content"> |
| 1613 | <pre><tt> .-A---M---N---O |
| 1614 | / / / |
| 1615 | I B D |
| 1616 | \ / / |
| 1617 | `---------'</tt></pre> |
| 1618 | </div></div> |
| 1619 | <div class="para"><p>Note the major differences in <tt>N</tt> and <tt>P</tt> over <em>--full-history</em>:</p></div> |
| 1620 | <div class="ilist"><ul> |
| 1621 | <li> |
| 1622 | <p> |
| 1623 | <tt>N</tt>'s parent list had <tt>I</tt> removed, because it is an ancestor of the |
| 1624 | other parent <tt>M</tt>. Still, <tt>N</tt> remained because it is !TREESAME.<br /> |
| 1625 | </p> |
| 1626 | </li> |
| 1627 | <li> |
| 1628 | <p> |
| 1629 | <tt>P</tt>'s parent list similarly had <tt>I</tt> removed. <tt>P</tt> was then |
| 1630 | removed completely, because it had one parent and is TREESAME. |
| 1631 | </p> |
| 1632 | </li> |
| 1633 | </ul></div> |
| 1634 | </dd> |
| 1635 | </dl></div> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1636 | <div class="para"><p>The <em>--simplify-by-decoration</em> option allows you to view only the |
| 1637 | big picture of the topology of the history, by omitting commits |
| 1638 | that are not referenced by tags. Commits are marked as !TREESAME |
| 1639 | (in other words, kept after history simplification rules described |
| 1640 | above) if (1) they are referenced by tags, or (2) they change the |
| 1641 | contents of the paths given on the command line. All other |
| 1642 | commits are marked as TREESAME (subject to be simplified away).</p></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1643 | <h3 id="_commit_ordering">Commit Ordering</h3><div style="clear:left"></div> |
| 1644 | <div class="para"><p>By default, the commits are shown in reverse chronological order.</p></div> |
| 1645 | <div class="vlist"><dl> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1646 | <dt> |
| 1647 | --topo-order |
| 1648 | </dt> |
| 1649 | <dd> |
| 1650 | <p> |
| 1651 | This option makes them appear in topological order (i.e. |
| 1652 | descendant commits are shown before their parents). |
| 1653 | </p> |
| 1654 | </dd> |
| 1655 | <dt> |
| 1656 | --date-order |
| 1657 | </dt> |
| 1658 | <dd> |
| 1659 | <p> |
| 1660 | This option is similar to <em>--topo-order</em> in the sense that no |
| 1661 | parent comes before all of its children, but otherwise things |
| 1662 | are still ordered in the commit timestamp order. |
| 1663 | </p> |
| 1664 | </dd> |
| 1665 | <dt> |
| 1666 | --reverse |
| 1667 | </dt> |
| 1668 | <dd> |
| 1669 | <p> |
| 1670 | Output the commits in reverse order. |
| 1671 | Cannot be combined with <em>--walk-reflogs</em>. |
| 1672 | </p> |
| 1673 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1674 | </dl></div> |
| 1675 | <h3 id="_object_traversal">Object Traversal</h3><div style="clear:left"></div> |
| 1676 | <div class="para"><p>These options are mostly targeted for packing of git repositories.</p></div> |
| 1677 | <div class="vlist"><dl> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1678 | <dt> |
| 1679 | --objects |
| 1680 | </dt> |
| 1681 | <dd> |
| 1682 | <p> |
| 1683 | Print the object IDs of any object referenced by the listed |
| 1684 | commits. <em>--objects foo ^bar</em> thus means "send me |
| 1685 | all object IDs which I need to download if I have the commit |
| 1686 | object <em>bar</em>, but not <em>foo</em>". |
| 1687 | </p> |
| 1688 | </dd> |
| 1689 | <dt> |
| 1690 | --objects-edge |
| 1691 | </dt> |
| 1692 | <dd> |
| 1693 | <p> |
| 1694 | Similar to <em>--objects</em>, but also print the IDs of excluded |
| 1695 | commits prefixed with a "-" character. This is used by |
| 1696 | <a href="git-pack-objects.html">git-pack-objects(1)</a> to build "thin" pack, which records |
| 1697 | objects in deltified form based on objects contained in these |
| 1698 | excluded commits to reduce network traffic. |
| 1699 | </p> |
| 1700 | </dd> |
| 1701 | <dt> |
| 1702 | --unpacked |
| 1703 | </dt> |
| 1704 | <dd> |
| 1705 | <p> |
| 1706 | Only useful with <em>--objects</em>; print the object IDs that are not |
| 1707 | in packs. |
| 1708 | </p> |
| 1709 | </dd> |
| 1710 | <dt> |
| 1711 | --no-walk |
| 1712 | </dt> |
| 1713 | <dd> |
| 1714 | <p> |
| 1715 | Only show the given revs, but do not traverse their ancestors. |
| 1716 | </p> |
| 1717 | </dd> |
| 1718 | <dt> |
| 1719 | --do-walk |
| 1720 | </dt> |
| 1721 | <dd> |
| 1722 | <p> |
| 1723 | Overrides a previous --no-walk. |
| 1724 | </p> |
| 1725 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1726 | </dl></div> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1727 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1728 | <h2 id="_pretty_formats">PRETTY FORMATS</h2> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1729 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1730 | <div class="para"><p>If the commit is a merge, and if the pretty-format |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1731 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 1732 | inserted before the <em>Author:</em> line. This line begins with |
| 1733 | "Merge: " and the sha1s of ancestral commits are printed, |
| 1734 | separated by spaces. Note that the listed commits may not |
| 1735 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 1736 | have limited your view of history: for example, if you are |
| 1737 | only interested in changes related to a certain directory or |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1738 | file.</p></div> |
| 1739 | <div class="para"><p>Here are some additional details for each format:</p></div> |
| 1740 | <div class="ilist"><ul> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1741 | <li> |
| 1742 | <p> |
| 1743 | <em>oneline</em> |
| 1744 | </p> |
| 1745 | <div class="literalblock"> |
| 1746 | <div class="content"> |
| 1747 | <pre><tt><sha1> <title line></tt></pre> |
| 1748 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1749 | <div class="para"><p>This is designed to be as compact as possible.</p></div> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1750 | </li> |
| 1751 | <li> |
| 1752 | <p> |
| 1753 | <em>short</em> |
| 1754 | </p> |
| 1755 | <div class="literalblock"> |
| 1756 | <div class="content"> |
| 1757 | <pre><tt>commit <sha1> |
| 1758 | Author: <author></tt></pre> |
| 1759 | </div></div> |
| 1760 | <div class="literalblock"> |
| 1761 | <div class="content"> |
| 1762 | <pre><tt><title line></tt></pre> |
| 1763 | </div></div> |
| 1764 | </li> |
| 1765 | <li> |
| 1766 | <p> |
| 1767 | <em>medium</em> |
| 1768 | </p> |
| 1769 | <div class="literalblock"> |
| 1770 | <div class="content"> |
| 1771 | <pre><tt>commit <sha1> |
| 1772 | Author: <author> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 1773 | Date: <author date></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1774 | </div></div> |
| 1775 | <div class="literalblock"> |
| 1776 | <div class="content"> |
| 1777 | <pre><tt><title line></tt></pre> |
| 1778 | </div></div> |
| 1779 | <div class="literalblock"> |
| 1780 | <div class="content"> |
| 1781 | <pre><tt><full commit message></tt></pre> |
| 1782 | </div></div> |
| 1783 | </li> |
| 1784 | <li> |
| 1785 | <p> |
| 1786 | <em>full</em> |
| 1787 | </p> |
| 1788 | <div class="literalblock"> |
| 1789 | <div class="content"> |
| 1790 | <pre><tt>commit <sha1> |
| 1791 | Author: <author> |
| 1792 | Commit: <committer></tt></pre> |
| 1793 | </div></div> |
| 1794 | <div class="literalblock"> |
| 1795 | <div class="content"> |
| 1796 | <pre><tt><title line></tt></pre> |
| 1797 | </div></div> |
| 1798 | <div class="literalblock"> |
| 1799 | <div class="content"> |
| 1800 | <pre><tt><full commit message></tt></pre> |
| 1801 | </div></div> |
| 1802 | </li> |
| 1803 | <li> |
| 1804 | <p> |
| 1805 | <em>fuller</em> |
| 1806 | </p> |
| 1807 | <div class="literalblock"> |
| 1808 | <div class="content"> |
| 1809 | <pre><tt>commit <sha1> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 1810 | Author: <author> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1811 | AuthorDate: <author date> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 1812 | Commit: <committer> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1813 | CommitDate: <committer date></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1814 | </div></div> |
| 1815 | <div class="literalblock"> |
| 1816 | <div class="content"> |
| 1817 | <pre><tt><title line></tt></pre> |
| 1818 | </div></div> |
| 1819 | <div class="literalblock"> |
| 1820 | <div class="content"> |
| 1821 | <pre><tt><full commit message></tt></pre> |
| 1822 | </div></div> |
| 1823 | </li> |
| 1824 | <li> |
| 1825 | <p> |
| 1826 | <em>email</em> |
| 1827 | </p> |
| 1828 | <div class="literalblock"> |
| 1829 | <div class="content"> |
| 1830 | <pre><tt>From <sha1> <date> |
| 1831 | From: <author> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1832 | Date: <author date> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1833 | Subject: [PATCH] <title line></tt></pre> |
| 1834 | </div></div> |
| 1835 | <div class="literalblock"> |
| 1836 | <div class="content"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1837 | <pre><tt><full commit message></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1838 | </div></div> |
| 1839 | </li> |
| 1840 | <li> |
| 1841 | <p> |
| 1842 | <em>raw</em> |
| 1843 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1844 | <div class="para"><p>The <em>raw</em> format shows the entire commit exactly as |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1845 | stored in the commit object. Notably, the SHA1s are |
| 1846 | displayed in full, regardless of whether --abbrev or |
| 1847 | --no-abbrev are used, and <em>parents</em> information show the |
| 1848 | true parent commits, without taking grafts nor history |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1849 | simplification into account.</p></div> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1850 | </li> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1851 | <li> |
| 1852 | <p> |
| 1853 | <em>format:</em> |
| 1854 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1855 | <div class="para"><p>The <em>format:</em> format allows you to specify which information |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1856 | you want to show. It works a little bit like printf format, |
| 1857 | with the notable exception that you get a newline with <em>%n</em> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1858 | instead of <em>\n</em>.</p></div> |
| 1859 | <div class="para"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"</em> |
| 1860 | would show something like this:</p></div> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1861 | <div class="listingblock"> |
| 1862 | <div class="content"> |
| 1863 | <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
| 1864 | The title was >>t4119: test autocomputing -p<n> for traditional diff input.<< |
| 1865 | </tt></pre> |
| 1866 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1867 | <div class="para"><p>The placeholders are:</p></div> |
| 1868 | <div class="ilist"><ul> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1869 | <li> |
| 1870 | <p> |
| 1871 | <em>%H</em>: commit hash |
| 1872 | </p> |
| 1873 | </li> |
| 1874 | <li> |
| 1875 | <p> |
| 1876 | <em>%h</em>: abbreviated commit hash |
| 1877 | </p> |
| 1878 | </li> |
| 1879 | <li> |
| 1880 | <p> |
| 1881 | <em>%T</em>: tree hash |
| 1882 | </p> |
| 1883 | </li> |
| 1884 | <li> |
| 1885 | <p> |
| 1886 | <em>%t</em>: abbreviated tree hash |
| 1887 | </p> |
| 1888 | </li> |
| 1889 | <li> |
| 1890 | <p> |
| 1891 | <em>%P</em>: parent hashes |
| 1892 | </p> |
| 1893 | </li> |
| 1894 | <li> |
| 1895 | <p> |
| 1896 | <em>%p</em>: abbreviated parent hashes |
| 1897 | </p> |
| 1898 | </li> |
| 1899 | <li> |
| 1900 | <p> |
| 1901 | <em>%an</em>: author name |
| 1902 | </p> |
| 1903 | </li> |
| 1904 | <li> |
| 1905 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1906 | <em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
Junio C Hamano | f5a9362 | 2008-07-16 03:23:57 | [diff] [blame] | 1907 | </p> |
| 1908 | </li> |
| 1909 | <li> |
| 1910 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1911 | <em>%ae</em>: author email |
| 1912 | </p> |
| 1913 | </li> |
| 1914 | <li> |
| 1915 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1916 | <em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 1917 | </p> |
| 1918 | </li> |
| 1919 | <li> |
| 1920 | <p> |
Junio C Hamano | a387df3 | 2008-08-29 08:56:58 | [diff] [blame] | 1921 | <em>%ad</em>: author date (format respects --date= option) |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1922 | </p> |
| 1923 | </li> |
| 1924 | <li> |
| 1925 | <p> |
| 1926 | <em>%aD</em>: author date, RFC2822 style |
| 1927 | </p> |
| 1928 | </li> |
| 1929 | <li> |
| 1930 | <p> |
| 1931 | <em>%ar</em>: author date, relative |
| 1932 | </p> |
| 1933 | </li> |
| 1934 | <li> |
| 1935 | <p> |
| 1936 | <em>%at</em>: author date, UNIX timestamp |
| 1937 | </p> |
| 1938 | </li> |
| 1939 | <li> |
| 1940 | <p> |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 1941 | <em>%ai</em>: author date, ISO 8601 format |
| 1942 | </p> |
| 1943 | </li> |
| 1944 | <li> |
| 1945 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1946 | <em>%cn</em>: committer name |
| 1947 | </p> |
| 1948 | </li> |
| 1949 | <li> |
| 1950 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1951 | <em>%cN</em>: committer name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
Junio C Hamano | f5a9362 | 2008-07-16 03:23:57 | [diff] [blame] | 1952 | </p> |
| 1953 | </li> |
| 1954 | <li> |
| 1955 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1956 | <em>%ce</em>: committer email |
| 1957 | </p> |
| 1958 | </li> |
| 1959 | <li> |
| 1960 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1961 | <em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 1962 | </p> |
| 1963 | </li> |
| 1964 | <li> |
| 1965 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1966 | <em>%cd</em>: committer date |
| 1967 | </p> |
| 1968 | </li> |
| 1969 | <li> |
| 1970 | <p> |
| 1971 | <em>%cD</em>: committer date, RFC2822 style |
| 1972 | </p> |
| 1973 | </li> |
| 1974 | <li> |
| 1975 | <p> |
| 1976 | <em>%cr</em>: committer date, relative |
| 1977 | </p> |
| 1978 | </li> |
| 1979 | <li> |
| 1980 | <p> |
| 1981 | <em>%ct</em>: committer date, UNIX timestamp |
| 1982 | </p> |
| 1983 | </li> |
| 1984 | <li> |
| 1985 | <p> |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 1986 | <em>%ci</em>: committer date, ISO 8601 format |
| 1987 | </p> |
| 1988 | </li> |
| 1989 | <li> |
| 1990 | <p> |
Junio C Hamano | 5e4d8de | 2008-09-19 06:27:02 | [diff] [blame] | 1991 | <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a> |
| 1992 | </p> |
| 1993 | </li> |
| 1994 | <li> |
| 1995 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1996 | <em>%e</em>: encoding |
| 1997 | </p> |
| 1998 | </li> |
| 1999 | <li> |
| 2000 | <p> |
| 2001 | <em>%s</em>: subject |
| 2002 | </p> |
| 2003 | </li> |
| 2004 | <li> |
| 2005 | <p> |
Junio C Hamano | 5f9a6f0 | 2009-04-06 08:26:56 | [diff] [blame] | 2006 | <em>%f</em>: sanitized subject line, suitable for a filename |
| 2007 | </p> |
| 2008 | </li> |
| 2009 | <li> |
| 2010 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2011 | <em>%b</em>: body |
| 2012 | </p> |
| 2013 | </li> |
| 2014 | <li> |
| 2015 | <p> |
| 2016 | <em>%Cred</em>: switch color to red |
| 2017 | </p> |
| 2018 | </li> |
| 2019 | <li> |
| 2020 | <p> |
| 2021 | <em>%Cgreen</em>: switch color to green |
| 2022 | </p> |
| 2023 | </li> |
| 2024 | <li> |
| 2025 | <p> |
| 2026 | <em>%Cblue</em>: switch color to blue |
| 2027 | </p> |
| 2028 | </li> |
| 2029 | <li> |
| 2030 | <p> |
| 2031 | <em>%Creset</em>: reset color |
| 2032 | </p> |
| 2033 | </li> |
| 2034 | <li> |
| 2035 | <p> |
Junio C Hamano | cc0cb31 | 2009-01-22 03:38:50 | [diff] [blame] | 2036 | <em>%C(…)</em>: color specification, as described in color.branch.* config option |
| 2037 | </p> |
| 2038 | </li> |
| 2039 | <li> |
| 2040 | <p> |
Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 2041 | <em>%m</em>: left, right or boundary mark |
| 2042 | </p> |
| 2043 | </li> |
| 2044 | <li> |
| 2045 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2046 | <em>%n</em>: newline |
| 2047 | </p> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2048 | </li> |
Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 2049 | <li> |
| 2050 | <p> |
| 2051 | <em>%x00</em>: print a byte from a hex code |
| 2052 | </p> |
| 2053 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2054 | </ul></div> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2055 | </li> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2056 | <li> |
| 2057 | <p> |
| 2058 | <em>tformat:</em> |
| 2059 | </p> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2060 | <div class="para"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2061 | provides "terminator" semantics instead of "separator" semantics. In |
| 2062 | other words, each commit has the message terminator character (usually a |
| 2063 | newline) appended, rather than a separator placed between entries. |
| 2064 | This means that the final entry of a single-line format will be properly |
| 2065 | terminated with a new line, just as the "oneline" format does. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2066 | For example:</p></div> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2067 | <div class="listingblock"> |
| 2068 | <div class="content"> |
| 2069 | <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \ |
| 2070 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2071 | 4da45be |
| 2072 | 7134973 -- NO NEWLINE |
| 2073 | |
| 2074 | $ git log -2 --pretty=tformat:%h 4da45bef \ |
| 2075 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2076 | 4da45be |
| 2077 | 7134973</tt></pre> |
| 2078 | </div></div> |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 2079 | <div class="para"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted |
| 2080 | as if it has <tt>tformat:</tt> in front of it. For example, these two are |
| 2081 | equivalent:</p></div> |
| 2082 | <div class="listingblock"> |
| 2083 | <div class="content"> |
| 2084 | <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef |
| 2085 | $ git log -2 --pretty=%h 4da45bef</tt></pre> |
| 2086 | </div></div> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2087 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2088 | </ul></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2089 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2090 | <h2 id="_generating_patches_with_p">Generating patches with -p</h2> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2091 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2092 | <div class="para"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2093 | with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or |
| 2094 | "git log" with the "-p" option, they |
| 2095 | do not produce the output described above; instead they produce a |
| 2096 | patch file. You can customize the creation of such patches via the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2097 | GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div> |
| 2098 | <div class="para"><p>What the -p option produces is slightly different from the traditional |
| 2099 | diff format.</p></div> |
| 2100 | <div class="olist"><ol> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2101 | <li> |
| 2102 | <p> |
| 2103 | It is preceded with a "git diff" header, that looks like |
| 2104 | this: |
| 2105 | </p> |
| 2106 | <div class="literalblock"> |
| 2107 | <div class="content"> |
| 2108 | <pre><tt>diff --git a/file1 b/file2</tt></pre> |
| 2109 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2110 | <div class="para"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2111 | involved. Especially, even for a creation or a deletion, |
Junio C Hamano | 5e4d8de | 2008-09-19 06:27:02 | [diff] [blame] | 2112 | <tt>/dev/null</tt> is _not_ used in place of <tt>a/</tt> or <tt>b/</tt> filenames.</p></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2113 | <div class="para"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2114 | name of the source file of the rename/copy and the name of |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2115 | the file that rename/copy produces, respectively.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2116 | </li> |
| 2117 | <li> |
| 2118 | <p> |
| 2119 | It is followed by one or more extended header lines: |
| 2120 | </p> |
| 2121 | <div class="literalblock"> |
| 2122 | <div class="content"> |
| 2123 | <pre><tt>old mode <mode> |
| 2124 | new mode <mode> |
| 2125 | deleted file mode <mode> |
| 2126 | new file mode <mode> |
| 2127 | copy from <path> |
| 2128 | copy to <path> |
| 2129 | rename from <path> |
| 2130 | rename to <path> |
| 2131 | similarity index <number> |
| 2132 | dissimilarity index <number> |
| 2133 | index <hash>..<hash> <mode></tt></pre> |
| 2134 | </div></div> |
| 2135 | </li> |
| 2136 | <li> |
| 2137 | <p> |
| 2138 | TAB, LF, double quote and backslash characters in pathnames |
| 2139 | are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively. |
| 2140 | If there is need for such substitution then the whole |
| 2141 | pathname is put in double quotes. |
| 2142 | </p> |
| 2143 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2144 | </ol></div> |
| 2145 | <div class="para"><p>The similarity index is the percentage of unchanged lines, and |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2146 | the dissimilarity index is the percentage of changed lines. It |
| 2147 | is a rounded down integer, followed by a percent sign. The |
| 2148 | similarity index value of 100% is thus reserved for two equal |
| 2149 | files, while 100% dissimilarity means that no line from the old |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2150 | file made it into the new one.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2151 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2152 | <h2 id="_combined_diff_format">combined diff format</h2> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2153 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2154 | <div class="para"><p>"git-diff-tree", "git-diff-files" and "git-diff" can take <em>-c</em> or |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2155 | <em>--cc</em> option to produce <em>combined diff</em>. For showing a merge commit |
| 2156 | with "git log -p", this is the default format. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2157 | A <em>combined diff</em> format looks like this:</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2158 | <div class="listingblock"> |
| 2159 | <div class="content"> |
| 2160 | <pre><tt>diff --combined describe.c |
| 2161 | index fabadb8,cc95eb0..4866510 |
| 2162 | --- a/describe.c |
| 2163 | +++ b/describe.c |
| 2164 | @@@ -98,20 -98,12 +98,20 @@@ |
| 2165 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
| 2166 | } |
| 2167 | |
| 2168 | - static void describe(char *arg) |
| 2169 | -static void describe(struct commit *cmit, int last_one) |
| 2170 | ++static void describe(char *arg, int last_one) |
| 2171 | { |
| 2172 | + unsigned char sha1[20]; |
| 2173 | + struct commit *cmit; |
| 2174 | struct commit_list *list; |
| 2175 | static int initialized = 0; |
| 2176 | struct commit_name *n; |
| 2177 | |
| 2178 | + if (get_sha1(arg, sha1) < 0) |
| 2179 | + usage(describe_usage); |
| 2180 | + cmit = lookup_commit_reference(sha1); |
| 2181 | + if (!cmit) |
| 2182 | + usage(describe_usage); |
| 2183 | + |
| 2184 | if (!initialized) { |
| 2185 | initialized = 1; |
| 2186 | for_each_ref(get_name);</tt></pre> |
| 2187 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2188 | <div class="olist"><ol> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2189 | <li> |
| 2190 | <p> |
| 2191 | It is preceded with a "git diff" header, that looks like |
| 2192 | this (when <em>-c</em> option is used): |
| 2193 | </p> |
| 2194 | <div class="literalblock"> |
| 2195 | <div class="content"> |
| 2196 | <pre><tt>diff --combined file</tt></pre> |
| 2197 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2198 | <div class="para"><p>or like this (when <em>--cc</em> option is used):</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2199 | <div class="literalblock"> |
| 2200 | <div class="content"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2201 | <pre><tt>diff --cc file</tt></pre> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2202 | </div></div> |
| 2203 | </li> |
| 2204 | <li> |
| 2205 | <p> |
| 2206 | It is followed by one or more extended header lines |
| 2207 | (this example shows a merge with two parents): |
| 2208 | </p> |
| 2209 | <div class="literalblock"> |
| 2210 | <div class="content"> |
| 2211 | <pre><tt>index <hash>,<hash>..<hash> |
| 2212 | mode <mode>,<mode>..<mode> |
| 2213 | new file mode <mode> |
| 2214 | deleted file mode <mode>,<mode></tt></pre> |
| 2215 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2216 | <div class="para"><p>The <tt>mode <mode>,<mode>..<mode></tt> line appears only if at least one of |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2217 | the <mode> is different from the rest. Extended headers with |
| 2218 | information about detected contents movement (renames and |
| 2219 | copying detection) are designed to work with diff of two |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2220 | <tree-ish> and are not used by combined diff format.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2221 | </li> |
| 2222 | <li> |
| 2223 | <p> |
| 2224 | It is followed by two-line from-file/to-file header |
| 2225 | </p> |
| 2226 | <div class="literalblock"> |
| 2227 | <div class="content"> |
| 2228 | <pre><tt>--- a/file |
| 2229 | +++ b/file</tt></pre> |
| 2230 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2231 | <div class="para"><p>Similar to two-line header for traditional <em>unified</em> diff |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2232 | format, <tt>/dev/null</tt> is used to signal created or deleted |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2233 | files.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2234 | </li> |
| 2235 | <li> |
| 2236 | <p> |
| 2237 | Chunk header format is modified to prevent people from |
| 2238 | accidentally feeding it to <tt>patch -p1</tt>. Combined diff format |
| 2239 | was created for review of merge commit changes, and was not |
| 2240 | meant for apply. The change is similar to the change in the |
| 2241 | extended <em>index</em> header: |
| 2242 | </p> |
| 2243 | <div class="literalblock"> |
| 2244 | <div class="content"> |
| 2245 | <pre><tt>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</tt></pre> |
| 2246 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2247 | <div class="para"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk |
| 2248 | header for combined diff format.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2249 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2250 | </ol></div> |
| 2251 | <div class="para"><p>Unlike the traditional <em>unified</em> diff format, which shows two |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2252 | files A and B with a single column that has <tt>-</tt> (minus — |
| 2253 | appears in A but removed in B), <tt>+</tt> (plus — missing in A but |
| 2254 | added to B), or <tt>" "</tt> (space — unchanged) prefix, this format |
| 2255 | compares two or more files file1, file2,… with one file X, and |
| 2256 | shows how X differs from each of fileN. One column for each of |
| 2257 | fileN is prepended to the output line to note how X's line is |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2258 | different from it.</p></div> |
| 2259 | <div class="para"><p>A <tt>-</tt> character in the column N means that the line appears in |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2260 | fileN but it does not appear in the result. A <tt>+</tt> character |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 2261 | in the column N means that the line appears in the result, |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2262 | and fileN does not have that line (in other words, the line was |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2263 | added, from the point of view of that parent).</p></div> |
| 2264 | <div class="para"><p>In the above example output, the function signature was changed |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2265 | from both files (hence two <tt>-</tt> removals from both file1 and |
Junio C Hamano | 5e4d8de | 2008-09-19 06:27:02 | [diff] [blame] | 2266 | file2, plus <tt>++</tt> to mean one line that was added does not appear |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 2267 | in either file1 nor file2). Also eight other lines are the same |
| 2268 | from file1 but do not appear in file2 (hence prefixed with <tt>+</tt>).</p></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2269 | <div class="para"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2270 | merge commit with the merge result (i.e. file1..fileN are the |
| 2271 | parents). When shown by <tt>git diff-files -c</tt>, it compares the |
| 2272 | two unresolved merge parents with the working tree file |
| 2273 | (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2274 | "their version").</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2275 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2276 | <h2 id="_examples">Examples</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2277 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2278 | <div class="vlist"><dl> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2279 | <dt> |
| 2280 | git log --no-merges |
| 2281 | </dt> |
| 2282 | <dd> |
| 2283 | <p> |
| 2284 | Show the whole commit history, but skip any merges |
| 2285 | </p> |
| 2286 | </dd> |
| 2287 | <dt> |
| 2288 | git log v2.6.12.. include/scsi drivers/scsi |
| 2289 | </dt> |
| 2290 | <dd> |
| 2291 | <p> |
| 2292 | Show all commits since version <em>v2.6.12</em> that changed any file |
| 2293 | in the include/scsi or drivers/scsi subdirectories |
| 2294 | </p> |
| 2295 | </dd> |
| 2296 | <dt> |
Junio C Hamano | 1bb569e | 2006-05-05 23:14:25 | [diff] [blame] | 2297 | git log --since="2 weeks ago" -- gitk |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2298 | </dt> |
| 2299 | <dd> |
| 2300 | <p> |
| 2301 | Show the changes during the last two weeks to the file <em>gitk</em>. |
| 2302 | The "--" is necessary to avoid confusion with the <strong>branch</strong> named |
| 2303 | <em>gitk</em> |
| 2304 | </p> |
| 2305 | </dd> |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 2306 | <dt> |
Junio C Hamano | 7d9e9bd | 2007-08-29 07:31:47 | [diff] [blame] | 2307 | git log --name-status release..test |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 2308 | </dt> |
| 2309 | <dd> |
| 2310 | <p> |
| 2311 | Show the commits that are in the "test" branch but not yet |
| 2312 | in the "release" branch, along with the list of paths |
| 2313 | each commit modifies. |
| 2314 | </p> |
| 2315 | </dd> |
Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 2316 | <dt> |
| 2317 | git log --follow builtin-rev-list.c |
| 2318 | </dt> |
| 2319 | <dd> |
| 2320 | <p> |
| 2321 | Shows the commits that changed builtin-rev-list.c, including |
| 2322 | those commits that occurred before the file was given its |
| 2323 | present name. |
| 2324 | </p> |
| 2325 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2326 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2327 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2328 | <h2 id="_discussion">Discussion</h2> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2329 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2330 | <div class="para"><p>At the core level, git is character encoding agnostic.</p></div> |
| 2331 | <div class="ilist"><ul> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2332 | <li> |
| 2333 | <p> |
| 2334 | The pathnames recorded in the index and in the tree objects |
| 2335 | are treated as uninterpreted sequences of non-NUL bytes. |
| 2336 | What readdir(2) returns are what are recorded and compared |
| 2337 | with the data git keeps track of, which in turn are expected |
| 2338 | to be what lstat(2) and creat(2) accepts. There is no such |
| 2339 | thing as pathname encoding translation. |
| 2340 | </p> |
| 2341 | </li> |
| 2342 | <li> |
| 2343 | <p> |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 2344 | The contents of the blob objects are uninterpreted sequences |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2345 | of bytes. There is no encoding translation at the core |
| 2346 | level. |
| 2347 | </p> |
| 2348 | </li> |
| 2349 | <li> |
| 2350 | <p> |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 2351 | The commit log messages are uninterpreted sequences of non-NUL |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2352 | bytes. |
| 2353 | </p> |
| 2354 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2355 | </ul></div> |
| 2356 | <div class="para"><p>Although we encourage that the commit log messages are encoded |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2357 | in UTF-8, both the core and git Porcelain are designed not to |
| 2358 | force UTF-8 on projects. If all participants of a particular |
| 2359 | project find it more convenient to use legacy encodings, git |
| 2360 | does not forbid it. However, there are a few things to keep in |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2361 | mind.</p></div> |
| 2362 | <div class="olist"><ol> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2363 | <li> |
| 2364 | <p> |
Junio C Hamano | 3727619 | 2008-09-04 00:24:07 | [diff] [blame] | 2365 | <em>git-commit</em> and <em>git-commit-tree</em> issues |
Junio C Hamano | 14b7648 | 2008-01-05 10:32:26 | [diff] [blame] | 2366 | a warning if the commit log message given to it does not look |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2367 | like a valid UTF-8 string, unless you explicitly say your |
| 2368 | project uses a legacy encoding. The way to say this is to |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 2369 | have i18n.commitencoding in <tt>.git/config</tt> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2370 | </p> |
| 2371 | <div class="listingblock"> |
| 2372 | <div class="content"> |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 2373 | <pre><tt>[i18n] |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2374 | commitencoding = ISO-8859-1</tt></pre> |
| 2375 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2376 | <div class="para"><p>Commit objects created with the above setting record the value |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 2377 | of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2378 | help other people who look at them later. Lack of this header |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2379 | implies that the commit log message is encoded in UTF-8.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2380 | </li> |
| 2381 | <li> |
| 2382 | <p> |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 2383 | <em>git-log</em>, <em>git-show</em>, <em>git-blame</em> and friends look at the |
| 2384 | <tt>encoding</tt> header of a commit object, and try to re-code the |
| 2385 | log message into UTF-8 unless otherwise specified. You can |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2386 | specify the desired output encoding with |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 2387 | <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2388 | </p> |
| 2389 | <div class="listingblock"> |
| 2390 | <div class="content"> |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 2391 | <pre><tt>[i18n] |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2392 | logoutputencoding = ISO-8859-1</tt></pre> |
| 2393 | </div></div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2394 | <div class="para"><p>If you do not have this configuration variable, the value of |
| 2395 | <tt>i18n.commitencoding</tt> is used instead.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2396 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2397 | </ol></div> |
| 2398 | <div class="para"><p>Note that we deliberately chose not to re-code the commit log |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2399 | message when a commit is made to force UTF-8 at the commit |
| 2400 | object level, because re-coding to UTF-8 is not necessarily a |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2401 | reversible operation.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 2402 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2403 | <h2 id="_author">Author</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2404 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2405 | <div class="para"><p>Written by Linus Torvalds <torvalds@osdl.org></p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2406 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2407 | <h2 id="_documentation">Documentation</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2408 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2409 | <div class="para"><p>Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2410 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2411 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2412 | <div class="sectionbody"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2413 | <div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2414 | </div> |
| 2415 | <div id="footer"> |
| 2416 | <div id="footer-text"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 2417 | Last updated 2009-04-08 07:36:11 UTC |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2418 | </div> |
| 2419 | </div> |
| 2420 | </body> |
| 2421 | </html> |