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