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 | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.4.5" /> |
| 7 | <title>git-diff-tree(1)</title> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 8 | <style type="text/css"> |
| 9 | /* Debug borders */ |
| 10 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 11 | /* |
| 12 | border: 1px solid red; |
| 13 | */ |
| 14 | } |
| 15 | |
| 16 | body { |
| 17 | margin: 1em 5% 1em 5%; |
| 18 | } |
| 19 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 20 | a { |
| 21 | color: blue; |
| 22 | text-decoration: underline; |
| 23 | } |
| 24 | a:visited { |
| 25 | color: fuchsia; |
| 26 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 27 | |
| 28 | em { |
| 29 | font-style: italic; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 30 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | strong { |
| 34 | font-weight: bold; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 35 | color: #083194; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | tt { |
| 39 | color: navy; |
| 40 | } |
| 41 | |
| 42 | h1, h2, h3, h4, h5, h6 { |
| 43 | color: #527bbd; |
| 44 | font-family: sans-serif; |
| 45 | margin-top: 1.2em; |
| 46 | margin-bottom: 0.5em; |
| 47 | line-height: 1.3; |
| 48 | } |
| 49 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 50 | h1, h2, h3 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 51 | border-bottom: 2px solid silver; |
| 52 | } |
| 53 | h2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 54 | padding-top: 0.5em; |
| 55 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 56 | h3 { |
| 57 | float: left; |
| 58 | } |
| 59 | h3 + * { |
| 60 | clear: left; |
| 61 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 62 | |
| 63 | div.sectionbody { |
| 64 | font-family: serif; |
| 65 | margin-left: 0; |
| 66 | } |
| 67 | |
| 68 | hr { |
| 69 | border: 1px solid silver; |
| 70 | } |
| 71 | |
| 72 | p { |
| 73 | margin-top: 0.5em; |
| 74 | margin-bottom: 0.5em; |
| 75 | } |
| 76 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 77 | ul, ol, li > p { |
| 78 | margin-top: 0; |
| 79 | } |
| 80 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 81 | pre { |
| 82 | padding: 0; |
| 83 | margin: 0; |
| 84 | } |
| 85 | |
| 86 | span#author { |
| 87 | color: #527bbd; |
| 88 | font-family: sans-serif; |
| 89 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 90 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 91 | } |
| 92 | span#email { |
| 93 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 94 | span#revnumber, span#revdate, span#revremark { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 95 | font-family: sans-serif; |
| 96 | } |
| 97 | |
| 98 | div#footer { |
| 99 | font-family: sans-serif; |
| 100 | font-size: small; |
| 101 | border-top: 2px solid silver; |
| 102 | padding-top: 0.5em; |
| 103 | margin-top: 4.0em; |
| 104 | } |
| 105 | div#footer-text { |
| 106 | float: left; |
| 107 | padding-bottom: 0.5em; |
| 108 | } |
| 109 | div#footer-badges { |
| 110 | float: right; |
| 111 | padding-bottom: 0.5em; |
| 112 | } |
| 113 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 114 | div#preamble { |
| 115 | margin-top: 1.5em; |
| 116 | margin-bottom: 1.5em; |
| 117 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 118 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 119 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 120 | div.admonitionblock { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 121 | margin-top: 1.5em; |
| 122 | margin-bottom: 1.5em; |
| 123 | } |
| 124 | div.admonitionblock { |
| 125 | margin-top: 2.5em; |
| 126 | margin-bottom: 2.5em; |
| 127 | } |
| 128 | |
| 129 | div.content { /* Block element content. */ |
| 130 | padding: 0; |
| 131 | } |
| 132 | |
| 133 | /* Block element titles. */ |
| 134 | div.title, caption.title { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 135 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 136 | font-family: sans-serif; |
| 137 | font-weight: bold; |
| 138 | text-align: left; |
| 139 | margin-top: 1.0em; |
| 140 | margin-bottom: 0.5em; |
| 141 | } |
| 142 | div.title + * { |
| 143 | margin-top: 0; |
| 144 | } |
| 145 | |
| 146 | td div.title:first-child { |
| 147 | margin-top: 0.0em; |
| 148 | } |
| 149 | div.content div.title:first-child { |
| 150 | margin-top: 0.0em; |
| 151 | } |
| 152 | div.content + div.title { |
| 153 | margin-top: 0.0em; |
| 154 | } |
| 155 | |
| 156 | div.sidebarblock > div.content { |
| 157 | background: #ffffee; |
| 158 | border: 1px solid silver; |
| 159 | padding: 0.5em; |
| 160 | } |
| 161 | |
| 162 | div.listingblock > div.content { |
| 163 | border: 1px solid silver; |
| 164 | background: #f4f4f4; |
| 165 | padding: 0.5em; |
| 166 | } |
| 167 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 168 | div.quoteblock { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 169 | padding-left: 2.0em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 170 | margin-right: 10%; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 171 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 172 | div.quoteblock > div.attribution { |
| 173 | padding-top: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 174 | text-align: right; |
| 175 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 176 | |
| 177 | div.verseblock { |
| 178 | padding-left: 2.0em; |
| 179 | margin-right: 10%; |
| 180 | } |
| 181 | div.verseblock > div.content { |
| 182 | white-space: pre; |
| 183 | } |
| 184 | div.verseblock > div.attribution { |
| 185 | padding-top: 0.75em; |
| 186 | text-align: left; |
| 187 | } |
| 188 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 189 | div.verseblock + div.attribution { |
| 190 | text-align: left; |
| 191 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 192 | |
| 193 | div.admonitionblock .icon { |
| 194 | vertical-align: top; |
| 195 | font-size: 1.1em; |
| 196 | font-weight: bold; |
| 197 | text-decoration: underline; |
| 198 | color: #527bbd; |
| 199 | padding-right: 0.5em; |
| 200 | } |
| 201 | div.admonitionblock td.content { |
| 202 | padding-left: 0.5em; |
| 203 | border-left: 2px solid silver; |
| 204 | } |
| 205 | |
| 206 | div.exampleblock > div.content { |
| 207 | border-left: 2px solid silver; |
| 208 | padding: 0.5em; |
| 209 | } |
| 210 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 211 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 212 | span.image img { border-style: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 213 | a.image:visited { color: white; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 214 | |
| 215 | dl { |
| 216 | margin-top: 0.8em; |
| 217 | margin-bottom: 0.8em; |
| 218 | } |
| 219 | dt { |
| 220 | margin-top: 0.5em; |
| 221 | margin-bottom: 0; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 222 | font-style: normal; |
| 223 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 224 | } |
| 225 | dd > *:first-child { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 226 | margin-top: 0.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 227 | } |
| 228 | |
| 229 | ul, ol { |
| 230 | list-style-position: outside; |
| 231 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 232 | ol.arabic { |
| 233 | list-style-type: decimal; |
| 234 | } |
| 235 | ol.loweralpha { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 236 | list-style-type: lower-alpha; |
| 237 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 238 | ol.upperalpha { |
| 239 | list-style-type: upper-alpha; |
| 240 | } |
| 241 | ol.lowerroman { |
| 242 | list-style-type: lower-roman; |
| 243 | } |
| 244 | ol.upperroman { |
| 245 | list-style-type: upper-roman; |
| 246 | } |
| 247 | |
| 248 | div.compact ul, div.compact ol, |
| 249 | div.compact p, div.compact p, |
| 250 | div.compact div, div.compact div { |
| 251 | margin-top: 0.1em; |
| 252 | margin-bottom: 0.1em; |
| 253 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 254 | |
| 255 | div.tableblock > table { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 256 | border: 3px solid #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 257 | } |
| 258 | thead { |
| 259 | font-family: sans-serif; |
| 260 | font-weight: bold; |
| 261 | } |
| 262 | tfoot { |
| 263 | font-weight: bold; |
| 264 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 265 | td > div.verse { |
| 266 | white-space: pre; |
| 267 | } |
| 268 | p.table { |
| 269 | margin-top: 0; |
| 270 | } |
| 271 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 272 | div.tableblock > table[frame="void"] { |
| 273 | border-style: none; |
| 274 | } |
| 275 | div.tableblock > table[frame="hsides"] { |
| 276 | border-left-style: none; |
| 277 | border-right-style: none; |
| 278 | } |
| 279 | div.tableblock > table[frame="vsides"] { |
| 280 | border-top-style: none; |
| 281 | border-bottom-style: none; |
| 282 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 283 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 284 | |
| 285 | div.hdlist { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 286 | margin-top: 0.8em; |
| 287 | margin-bottom: 0.8em; |
| 288 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 289 | div.hdlist tr { |
| 290 | padding-bottom: 15px; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 291 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 292 | dt.hdlist1.strong, td.hdlist1.strong { |
| 293 | font-weight: bold; |
| 294 | } |
| 295 | td.hdlist1 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 296 | vertical-align: top; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 297 | font-style: normal; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 298 | padding-right: 0.8em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 299 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 300 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 301 | td.hdlist2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 302 | vertical-align: top; |
| 303 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 304 | div.hdlist.compact tr { |
| 305 | margin: 0; |
| 306 | padding-bottom: 0; |
| 307 | } |
| 308 | |
| 309 | .comment { |
| 310 | background: yellow; |
| 311 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 312 | |
| 313 | @media print { |
| 314 | div#footer-badges { display: none; } |
| 315 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 316 | |
| 317 | div#toctitle { |
| 318 | color: #527bbd; |
| 319 | font-family: sans-serif; |
| 320 | font-size: 1.1em; |
| 321 | font-weight: bold; |
| 322 | margin-top: 1.0em; |
| 323 | margin-bottom: 0.1em; |
| 324 | } |
| 325 | |
| 326 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 327 | margin-top: 0; |
| 328 | margin-bottom: 0; |
| 329 | } |
| 330 | div.toclevel2 { |
| 331 | margin-left: 2em; |
| 332 | font-size: 0.9em; |
| 333 | } |
| 334 | div.toclevel3 { |
| 335 | margin-left: 4em; |
| 336 | font-size: 0.9em; |
| 337 | } |
| 338 | div.toclevel4 { |
| 339 | margin-left: 6em; |
| 340 | font-size: 0.9em; |
| 341 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 342 | /* Overrides for manpage documents */ |
| 343 | h1 { |
| 344 | padding-top: 0.5em; |
| 345 | padding-bottom: 0.5em; |
| 346 | border-top: 2px solid silver; |
| 347 | border-bottom: 2px solid silver; |
| 348 | } |
| 349 | h2 { |
| 350 | border-style: none; |
| 351 | } |
| 352 | div.sectionbody { |
| 353 | margin-left: 5%; |
| 354 | } |
| 355 | |
| 356 | @media print { |
| 357 | div#toc { display: none; } |
| 358 | } |
| 359 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 360 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 361 | |
| 362 | div.sidebar-content { |
| 363 | background: #ffffee; |
| 364 | border: 1px solid silver; |
| 365 | padding: 0.5em; |
| 366 | } |
| 367 | div.sidebar-title, div.image-title { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 368 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 369 | font-family: sans-serif; |
| 370 | font-weight: bold; |
| 371 | margin-top: 0.0em; |
| 372 | margin-bottom: 0.5em; |
| 373 | } |
| 374 | |
| 375 | div.listingblock div.content { |
| 376 | border: 1px solid silver; |
| 377 | background: #f4f4f4; |
| 378 | padding: 0.5em; |
| 379 | } |
| 380 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 381 | div.quoteblock-attribution { |
| 382 | padding-top: 0.5em; |
| 383 | text-align: right; |
| 384 | } |
| 385 | |
| 386 | div.verseblock-content { |
| 387 | white-space: pre; |
| 388 | } |
| 389 | div.verseblock-attribution { |
| 390 | padding-top: 0.75em; |
| 391 | text-align: left; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 392 | } |
| 393 | |
| 394 | div.exampleblock-content { |
| 395 | border-left: 2px solid silver; |
| 396 | padding-left: 0.5em; |
| 397 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 398 | |
| 399 | /* IE6 sets dynamically generated links as visited. */ |
| 400 | div#toc a:visited { color: blue; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 401 | </style> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 402 | </head> |
| 403 | <body> |
| 404 | <div id="header"> |
| 405 | <h1> |
| 406 | git-diff-tree(1) Manual Page |
| 407 | </h1> |
| 408 | <h2>NAME</h2> |
| 409 | <div class="sectionbody"> |
| 410 | <p>git-diff-tree - |
| 411 | Compares the content and mode of blobs found via two tree objects |
| 412 | </p> |
| 413 | </div> |
| 414 | </div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 415 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 416 | <div class="sectionbody"> |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 417 | <div class="verseblock"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 418 | <div class="verseblock-content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 419 | [-t] [-r] [-c | --cc] [--root] [<common diff options>] |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 420 | <tree-ish> [<tree-ish>] [<path>…]</div> |
| 421 | <div class="verseblock-attribution"> |
| 422 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 423 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 424 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 425 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 426 | <div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div> |
| 427 | <div class="paragraph"><p>If there is only one <tree-ish> given, the commit is compared with its parents |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 428 | (see --stdin below).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 429 | <div class="paragraph"><p>Note that <em>git diff-tree</em> can use the tree encapsulated in a commit object.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 430 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 431 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 432 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 433 | <div class="dlist"><dl> |
| 434 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 435 | -p |
| 436 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 437 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 438 | -u |
| 439 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 440 | <dt class="hdlist1"> |
Junio C Hamano | e97d577 | 2010-05-19 08:13:58 | [diff] [blame] | 441 | --patch |
| 442 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 443 | <dd> |
| 444 | <p> |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 445 | Generate patch (see section on generating patches). |
| 446 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 447 | </p> |
| 448 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 449 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 450 | -U<n> |
| 451 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 452 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 453 | --unified=<n> |
| 454 | </dt> |
| 455 | <dd> |
| 456 | <p> |
| 457 | Generate diffs with <n> lines of context instead of |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 458 | the usual three. |
| 459 | Implies <tt>-p</tt>. |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 460 | </p> |
| 461 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 462 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 463 | --raw |
| 464 | </dt> |
| 465 | <dd> |
| 466 | <p> |
| 467 | Generate the raw format. |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 468 | This is the default. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 469 | </p> |
| 470 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 471 | <dt class="hdlist1"> |
Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 472 | --patch-with-raw |
| 473 | </dt> |
| 474 | <dd> |
| 475 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 476 | Synonym for <tt>-p --raw</tt>. |
Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 477 | </p> |
| 478 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 479 | <dt class="hdlist1"> |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 480 | --patience |
| 481 | </dt> |
| 482 | <dd> |
| 483 | <p> |
| 484 | Generate a diff using the "patience diff" algorithm. |
| 485 | </p> |
| 486 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 487 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 488 | --stat[=<width>[,<name-width>]] |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 489 | </dt> |
| 490 | <dd> |
| 491 | <p> |
Junio C Hamano | 4a9a76a | 2006-10-01 05:40:29 | [diff] [blame] | 492 | Generate a diffstat. You can override the default |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 493 | output width for 80-column terminal by <tt>--stat=<width></tt>. |
Junio C Hamano | 4a9a76a | 2006-10-01 05:40:29 | [diff] [blame] | 494 | The width of the filename part can be controlled by |
| 495 | giving another width to it separated by a comma. |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 496 | </p> |
| 497 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 498 | <dt class="hdlist1"> |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 499 | --numstat |
| 500 | </dt> |
| 501 | <dd> |
| 502 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 503 | Similar to <tt>--stat</tt>, but shows number of added and |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 504 | deleted lines in decimal notation and pathname without |
Junio C Hamano | d793de5 | 2006-12-26 09:11:43 | [diff] [blame] | 505 | abbreviation, to make it more machine friendly. For |
| 506 | binary files, outputs two <tt>-</tt> instead of saying |
| 507 | <tt>0 0</tt>. |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 508 | </p> |
| 509 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 510 | <dt class="hdlist1"> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 511 | --shortstat |
| 512 | </dt> |
| 513 | <dd> |
| 514 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 515 | Output only the last line of the <tt>--stat</tt> format containing total |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 516 | number of modified files, as well as number of added and deleted |
| 517 | lines. |
| 518 | </p> |
| 519 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 520 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 521 | --dirstat[=<limit>] |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 522 | </dt> |
| 523 | <dd> |
| 524 | <p> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 525 | Output the distribution of relative amount of changes (number of lines added or |
| 526 | removed) for each sub-directory. Directories with changes below |
| 527 | a cut-off percent (3% by default) are not shown. The cut-off percent |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 528 | can be set with <tt>--dirstat=<limit></tt>. Changes in a child directory are not |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 529 | counted for the parent directory, unless <tt>--cumulative</tt> is used. |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 530 | </p> |
| 531 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 532 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 533 | --dirstat-by-file[=<limit>] |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 534 | </dt> |
| 535 | <dd> |
| 536 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 537 | Same as <tt>--dirstat</tt>, but counts changed files instead of lines. |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 538 | </p> |
| 539 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 540 | <dt class="hdlist1"> |
Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 541 | --summary |
| 542 | </dt> |
| 543 | <dd> |
| 544 | <p> |
| 545 | Output a condensed summary of extended header information |
| 546 | such as creations, renames and mode changes. |
| 547 | </p> |
| 548 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 549 | <dt class="hdlist1"> |
Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 550 | --patch-with-stat |
| 551 | </dt> |
| 552 | <dd> |
| 553 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 554 | Synonym for <tt>-p --stat</tt>. |
Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 555 | </p> |
| 556 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 557 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 558 | -z |
| 559 | </dt> |
| 560 | <dd> |
| 561 | <p> |
Junio C Hamano | 0c053e8 | 2010-04-19 06:46:34 | [diff] [blame] | 562 | When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been |
| 563 | given, do not munge pathnames and use NULs as output field terminators. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 564 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 565 | <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes, |
Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 566 | and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>, |
| 567 | respectively, and the pathname will be enclosed in double quotes if |
| 568 | any of those replacements occurred.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 569 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 570 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 571 | --name-only |
| 572 | </dt> |
| 573 | <dd> |
| 574 | <p> |
| 575 | Show only names of changed files. |
| 576 | </p> |
| 577 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 578 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 579 | --name-status |
| 580 | </dt> |
| 581 | <dd> |
| 582 | <p> |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 583 | Show only names and status of changed files. See the description |
| 584 | of the <tt>--diff-filter</tt> option on what the status letters mean. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 585 | </p> |
| 586 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 587 | <dt class="hdlist1"> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 588 | --submodule[=<format>] |
| 589 | </dt> |
| 590 | <dd> |
| 591 | <p> |
| 592 | Chose the output format for submodule differences. <format> can be one of |
| 593 | <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format |
| 594 | is used when this option is not given. <em>log</em> is the default value for this |
| 595 | option and lists the commits in that commit range like the <em>summary</em> |
| 596 | option of <a href="git-submodule.html">git-submodule(1)</a> does. |
| 597 | </p> |
| 598 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 599 | <dt class="hdlist1"> |
Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [diff] [blame] | 600 | --color[=<when>] |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 601 | </dt> |
| 602 | <dd> |
| 603 | <p> |
| 604 | Show colored diff. |
Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [diff] [blame] | 605 | The value must be always (the default), never, or auto. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 606 | </p> |
| 607 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 608 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 609 | --no-color |
| 610 | </dt> |
| 611 | <dd> |
| 612 | <p> |
| 613 | Turn off colored diff, even when the configuration file |
| 614 | gives the default to color output. |
Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [diff] [blame] | 615 | Same as <tt>--color=never</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 616 | </p> |
| 617 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 618 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 619 | --word-diff[=<mode>] |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 620 | </dt> |
| 621 | <dd> |
| 622 | <p> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 623 | Show a word diff, using the <mode> to delimit changed words. |
| 624 | By default, words are delimited by whitespace; see |
| 625 | <tt>--word-diff-regex</tt> below. The <mode> defaults to <em>plain</em>, and |
| 626 | must be one of: |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 627 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 628 | <div class="dlist"><dl> |
| 629 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 630 | color |
| 631 | </dt> |
| 632 | <dd> |
| 633 | <p> |
| 634 | Highlight changed words using only colors. Implies <tt>--color</tt>. |
| 635 | </p> |
| 636 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 637 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 638 | plain |
| 639 | </dt> |
| 640 | <dd> |
| 641 | <p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 642 | Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 643 | attempts to escape the delimiters if they appear in the input, |
| 644 | so the output may be ambiguous. |
| 645 | </p> |
| 646 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 647 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 648 | porcelain |
| 649 | </dt> |
| 650 | <dd> |
| 651 | <p> |
| 652 | Use a special line-based format intended for script |
| 653 | consumption. Added/removed/unchanged runs are printed in the |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 654 | usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` ` |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 655 | character at the beginning of the line and extending to the |
| 656 | end of the line. Newlines in the input are represented by a |
| 657 | tilde <tt>~</tt> on a line of its own. |
| 658 | </p> |
| 659 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 660 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 661 | none |
| 662 | </dt> |
| 663 | <dd> |
| 664 | <p> |
| 665 | Disable word diff again. |
| 666 | </p> |
| 667 | </dd> |
| 668 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 669 | <div class="paragraph"><p>Note that despite the name of the first mode, color is used to |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 670 | highlight the changed parts in all modes if enabled.</p></div> |
| 671 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 672 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 673 | --word-diff-regex=<regex> |
| 674 | </dt> |
| 675 | <dd> |
| 676 | <p> |
| 677 | Use <regex> to decide what a word is, instead of considering |
| 678 | runs of non-whitespace to be a word. Also implies |
| 679 | <tt>--word-diff</tt> unless it was already enabled. |
| 680 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 681 | <div class="paragraph"><p>Every non-overlapping match of the |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 682 | <regex> is considered a word. Anything between these matches is |
| 683 | considered whitespace and ignored(!) for the purposes of finding |
| 684 | differences. You may want to append <tt>|[^[:space:]]</tt> to your regular |
| 685 | expression to make sure that it matches all non-whitespace characters. |
| 686 | A match that contains a newline is silently truncated(!) at the |
| 687 | newline.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 688 | <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 689 | <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly |
| 690 | overrides any diff driver or configuration setting. Diff drivers |
| 691 | override configuration settings.</p></div> |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 692 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 693 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 694 | --color-words[=<regex>] |
| 695 | </dt> |
| 696 | <dd> |
| 697 | <p> |
| 698 | Equivalent to <tt>--word-diff=color</tt> plus (if a regex was |
| 699 | specified) <tt>--word-diff-regex=<regex></tt>. |
| 700 | </p> |
| 701 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 702 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 703 | --no-renames |
| 704 | </dt> |
| 705 | <dd> |
| 706 | <p> |
| 707 | Turn off rename detection, even when the configuration |
| 708 | file gives the default to do so. |
| 709 | </p> |
| 710 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 711 | <dt class="hdlist1"> |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 712 | --check |
| 713 | </dt> |
| 714 | <dd> |
| 715 | <p> |
| 716 | Warn if changes introduce trailing whitespace |
Junio C Hamano | 3dac504 | 2007-12-15 08:40:54 | [diff] [blame] | 717 | or an indent that uses a space before a tab. Exits with |
| 718 | non-zero status if problems are found. Not compatible with |
| 719 | --exit-code. |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 720 | </p> |
| 721 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 722 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 723 | --full-index |
| 724 | </dt> |
| 725 | <dd> |
| 726 | <p> |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 727 | Instead of the first handful of characters, show the full |
| 728 | pre- and post-image blob object names on the "index" |
| 729 | line when generating patch format output. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 730 | </p> |
| 731 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 732 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 733 | --binary |
| 734 | </dt> |
| 735 | <dd> |
| 736 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 737 | In addition to <tt>--full-index</tt>, output a binary diff that |
| 738 | can be applied with <tt>git-apply</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 739 | </p> |
| 740 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 741 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 742 | --abbrev[=<n>] |
| 743 | </dt> |
| 744 | <dd> |
| 745 | <p> |
| 746 | Instead of showing the full 40-byte hexadecimal object |
| 747 | name in diff-raw format output and diff-tree header |
Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 748 | lines, show only a partial prefix. This is |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 749 | independent of the <tt>--full-index</tt> option above, which controls |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 750 | the diff-patch output format. Non default number of |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 751 | digits can be specified with <tt>--abbrev=<n></tt>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 752 | </p> |
| 753 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 754 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 755 | -B[<n>][/<m>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 756 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 757 | <dt class="hdlist1"> |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 758 | --break-rewrites[=[<n>][/<m>]] |
| 759 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 760 | <dd> |
| 761 | <p> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 762 | Break complete rewrite changes into pairs of delete and |
| 763 | create. This serves two purposes: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 764 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 765 | <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 766 | not as a series of deletion and insertion mixed together with a very |
| 767 | few lines that happen to match textually as the context, but as a |
| 768 | single deletion of everything old followed by a single insertion of |
| 769 | everything new, and the number <tt>m</tt> controls this aspect of the -B |
| 770 | option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the |
| 771 | original should remain in the result for git to consider it a total |
| 772 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 773 | deletion and insertion mixed together with context lines).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 774 | <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 775 | source of a rename (usually -M only considers a file that disappeared |
| 776 | as the source of a rename), and the number <tt>n</tt> controls this aspect of |
| 777 | the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 778 | addition and deletion compared to 20% or more of the file’s size are |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 779 | eligible for being picked up as a possible source of a rename to |
| 780 | another file.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 781 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 782 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 783 | -M[<n>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 784 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 785 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 786 | --find-renames[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 787 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 788 | <dd> |
| 789 | <p> |
| 790 | Detect renames. |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 791 | If <tt>n</tt> is specified, it is a is a threshold on the similarity |
| 792 | index (i.e. amount of addition/deletions compared to the |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 793 | file’s size). For example, <tt>-M90%</tt> means git should consider a |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 794 | delete/add pair to be a rename if more than 90% of the file |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 795 | hasn’t changed. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 796 | </p> |
| 797 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 798 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 799 | -C[<n>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 800 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 801 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 802 | --find-copies[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 803 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 804 | <dd> |
| 805 | <p> |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 806 | Detect copies as well as renames. See also <tt>--find-copies-harder</tt>. |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 807 | If <tt>n</tt> is specified, it has the same meaning as for <tt>-M<n></tt>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 808 | </p> |
| 809 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 810 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 811 | --find-copies-harder |
| 812 | </dt> |
| 813 | <dd> |
| 814 | <p> |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 815 | For performance reasons, by default, <tt>-C</tt> option finds copies only |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 816 | if the original file of the copy was modified in the same |
| 817 | changeset. This flag makes the command |
| 818 | inspect unmodified files as candidates for the source of |
| 819 | copy. This is a very expensive operation for large |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 820 | projects, so use it with caution. Giving more than one |
| 821 | <tt>-C</tt> option has the same effect. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 822 | </p> |
| 823 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 824 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 825 | -l<num> |
| 826 | </dt> |
| 827 | <dd> |
| 828 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 829 | The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 830 | is the number of potential rename/copy targets. This |
| 831 | option prevents rename/copy detection from running if |
| 832 | the number of rename/copy targets exceeds the specified |
| 833 | number. |
| 834 | </p> |
| 835 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 836 | <dt class="hdlist1"> |
Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 837 | --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] |
| 838 | </dt> |
| 839 | <dd> |
| 840 | <p> |
| 841 | Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>), |
| 842 | Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their |
| 843 | type (i.e. regular file, symlink, submodule, …) changed (<tt>T</tt>), |
| 844 | are Unmerged (<tt>U</tt>), are |
| 845 | Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>). |
| 846 | Any combination of the filter characters (including none) can be used. |
| 847 | When <tt>*</tt> (All-or-none) is added to the combination, all |
| 848 | paths are selected if there is any file that matches |
| 849 | other criteria in the comparison; if there is no file |
| 850 | that matches other criteria, nothing is selected. |
| 851 | </p> |
| 852 | </dd> |
| 853 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 854 | -S<string> |
| 855 | </dt> |
| 856 | <dd> |
| 857 | <p> |
Junio C Hamano | 5217a27 | 2009-03-21 00:39:33 | [diff] [blame] | 858 | Look for differences that introduce or remove an instance of |
| 859 | <string>. Note that this is different than the string simply |
| 860 | appearing in diff output; see the <em>pickaxe</em> entry in |
| 861 | <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 862 | </p> |
| 863 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 864 | <dt class="hdlist1"> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 865 | -G<regex> |
| 866 | </dt> |
| 867 | <dd> |
| 868 | <p> |
| 869 | Look for differences whose added or removed line matches |
| 870 | the given <regex>. |
| 871 | </p> |
| 872 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 873 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 874 | --pickaxe-all |
| 875 | </dt> |
| 876 | <dd> |
| 877 | <p> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 878 | When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 879 | changeset, not just the files that contain the change |
| 880 | in <string>. |
| 881 | </p> |
| 882 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 883 | <dt class="hdlist1"> |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 884 | --pickaxe-regex |
| 885 | </dt> |
| 886 | <dd> |
| 887 | <p> |
| 888 | Make the <string> not a plain string but an extended POSIX |
| 889 | regex to match. |
| 890 | </p> |
| 891 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 892 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 893 | -O<orderfile> |
| 894 | </dt> |
| 895 | <dd> |
| 896 | <p> |
| 897 | Output the patch in the order specified in the |
| 898 | <orderfile>, which has one shell glob pattern per line. |
| 899 | </p> |
| 900 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 901 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 902 | -R |
| 903 | </dt> |
| 904 | <dd> |
| 905 | <p> |
| 906 | Swap two inputs; that is, show differences from index or |
| 907 | on-disk file to tree contents. |
| 908 | </p> |
| 909 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 910 | <dt class="hdlist1"> |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 911 | --relative[=<path>] |
| 912 | </dt> |
| 913 | <dd> |
| 914 | <p> |
| 915 | When run from a subdirectory of the project, it can be |
| 916 | told to exclude changes outside the directory and show |
| 917 | pathnames relative to it with this option. When you are |
| 918 | not in a subdirectory (e.g. in a bare repository), you |
| 919 | can name which subdirectory to make the output relative |
| 920 | to by giving a <path> as an argument. |
| 921 | </p> |
| 922 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 923 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 924 | -a |
| 925 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 926 | <dt class="hdlist1"> |
Junio C Hamano | c26f548 | 2006-07-09 09:38:14 | [diff] [blame] | 927 | --text |
| 928 | </dt> |
| 929 | <dd> |
| 930 | <p> |
| 931 | Treat all files as text. |
| 932 | </p> |
| 933 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 934 | <dt class="hdlist1"> |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 935 | --ignore-space-at-eol |
| 936 | </dt> |
| 937 | <dd> |
| 938 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 939 | Ignore changes in whitespace at EOL. |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 940 | </p> |
| 941 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 942 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 943 | -b |
| 944 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 945 | <dt class="hdlist1"> |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 946 | --ignore-space-change |
| 947 | </dt> |
| 948 | <dd> |
| 949 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 950 | Ignore changes in amount of whitespace. This ignores whitespace |
| 951 | at line end, and considers all other sequences of one or |
| 952 | more whitespace characters to be equivalent. |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 953 | </p> |
| 954 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 955 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 956 | -w |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 957 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 958 | <dt class="hdlist1"> |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 959 | --ignore-all-space |
| 960 | </dt> |
| 961 | <dd> |
| 962 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 963 | Ignore whitespace when comparing lines. This ignores |
| 964 | differences even if one line has whitespace where the other |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 965 | line has none. |
| 966 | </p> |
| 967 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 968 | <dt class="hdlist1"> |
Junio C Hamano | 1d40ee8 | 2009-01-07 10:14:16 | [diff] [blame] | 969 | --inter-hunk-context=<lines> |
| 970 | </dt> |
| 971 | <dd> |
| 972 | <p> |
| 973 | Show the context between diff hunks, up to the specified number |
| 974 | of lines, thereby fusing hunks that are close to each other. |
| 975 | </p> |
| 976 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 977 | <dt class="hdlist1"> |
Junio C Hamano | 48fd2f6 | 2007-03-19 02:02:30 | [diff] [blame] | 978 | --exit-code |
| 979 | </dt> |
| 980 | <dd> |
| 981 | <p> |
| 982 | Make the program exit with codes similar to diff(1). |
| 983 | That is, it exits with 1 if there were differences and |
| 984 | 0 means no differences. |
| 985 | </p> |
| 986 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 987 | <dt class="hdlist1"> |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 988 | --quiet |
| 989 | </dt> |
| 990 | <dd> |
| 991 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 992 | Disable all output of the program. Implies <tt>--exit-code</tt>. |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 993 | </p> |
| 994 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 995 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 996 | --ext-diff |
| 997 | </dt> |
| 998 | <dd> |
| 999 | <p> |
| 1000 | Allow an external diff helper to be executed. If you set an |
Junio C Hamano | 1b50ce9 | 2007-10-03 12:05:53 | [diff] [blame] | 1001 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 1002 | to use this option with <a href="git-log.html">git-log(1)</a> and friends. |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1003 | </p> |
| 1004 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1005 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1006 | --no-ext-diff |
| 1007 | </dt> |
| 1008 | <dd> |
| 1009 | <p> |
| 1010 | Disallow external diff drivers. |
| 1011 | </p> |
| 1012 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1013 | <dt class="hdlist1"> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1014 | --ignore-submodules[=<when>] |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 1015 | </dt> |
| 1016 | <dd> |
| 1017 | <p> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1018 | Ignore changes to submodules in the diff generation. <when> can be |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1019 | either "none", "untracked", "dirty" or "all", which is the default |
| 1020 | Using "none" will consider the submodule modified when it either contains |
| 1021 | untracked or modified files or its HEAD differs from the commit recorded |
| 1022 | in the superproject and can be used to override any settings of the |
| 1023 | <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1024 | "untracked" is used submodules are not considered dirty when they only |
| 1025 | contain untracked content (but they are still scanned for modified |
| 1026 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 1027 | only changes to the commits stored in the superproject are shown (this was |
| 1028 | 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] | 1029 | </p> |
| 1030 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1031 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1032 | --src-prefix=<prefix> |
| 1033 | </dt> |
| 1034 | <dd> |
| 1035 | <p> |
| 1036 | Show the given source prefix instead of "a/". |
| 1037 | </p> |
| 1038 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1039 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1040 | --dst-prefix=<prefix> |
| 1041 | </dt> |
| 1042 | <dd> |
| 1043 | <p> |
| 1044 | Show the given destination prefix instead of "b/". |
| 1045 | </p> |
| 1046 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1047 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1048 | --no-prefix |
| 1049 | </dt> |
| 1050 | <dd> |
| 1051 | <p> |
| 1052 | Do not show any source or destination prefix. |
| 1053 | </p> |
| 1054 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1055 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1056 | <div class="paragraph"><p>For more detailed explanation on these common options, see also |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1057 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1058 | <div class="dlist"><dl> |
| 1059 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1060 | <tree-ish> |
| 1061 | </dt> |
| 1062 | <dd> |
| 1063 | <p> |
| 1064 | The id of a tree object. |
| 1065 | </p> |
| 1066 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1067 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1068 | <path>… |
| 1069 | </dt> |
| 1070 | <dd> |
| 1071 | <p> |
| 1072 | If provided, the results are limited to a subset of files |
| 1073 | matching one of these prefix strings. |
Junio C Hamano | 341071d | 2006-06-04 07:24:48 | [diff] [blame] | 1074 | i.e., file matches <tt>/^<pattern1>|<pattern2>|…/</tt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1075 | Note that this parameter does not provide any wildcard or regexp |
| 1076 | features. |
| 1077 | </p> |
| 1078 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1079 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1080 | -r |
| 1081 | </dt> |
| 1082 | <dd> |
| 1083 | <p> |
| 1084 | recurse into sub-trees |
| 1085 | </p> |
| 1086 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1087 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1088 | -t |
| 1089 | </dt> |
| 1090 | <dd> |
| 1091 | <p> |
| 1092 | show tree entry itself as well as subtrees. Implies -r. |
| 1093 | </p> |
| 1094 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1095 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1096 | --root |
| 1097 | </dt> |
| 1098 | <dd> |
| 1099 | <p> |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 1100 | When <em>--root</em> is specified the initial commit will be shown as a big |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1101 | creation event. This is equivalent to a diff against the NULL tree. |
| 1102 | </p> |
| 1103 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1104 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1105 | --stdin |
| 1106 | </dt> |
| 1107 | <dd> |
| 1108 | <p> |
| 1109 | When <em>--stdin</em> is specified, the command does not take |
| 1110 | <tree-ish> arguments from the command line. Instead, it |
Junio C Hamano | 3f2f6e5 | 2008-08-21 10:34:22 | [diff] [blame] | 1111 | reads lines containing either two <tree>, one <commit>, or a |
| 1112 | list of <commit> from its standard input. (Use a single space |
| 1113 | as separator.) |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1114 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1115 | <div class="paragraph"><p>When two trees are given, it compares the first tree with the second. |
Junio C Hamano | 3f2f6e5 | 2008-08-21 10:34:22 | [diff] [blame] | 1116 | When a single commit is given, it compares the commit with its |
| 1117 | parents. The remaining commits, when given, are used as if they are |
Junio C Hamano | b53db3c | 2008-08-07 00:17:52 | [diff] [blame] | 1118 | parents of the first commit.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1119 | <div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space |
Junio C Hamano | 3f2f6e5 | 2008-08-21 10:34:22 | [diff] [blame] | 1120 | and terminated by a newline) is printed before the difference. When |
| 1121 | comparing commits, the ID of the first (or only) commit, followed by a |
| 1122 | newline, is printed.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1123 | <div class="paragraph"><p>The following flags further affect the behavior when comparing |
Junio C Hamano | 3f2f6e5 | 2008-08-21 10:34:22 | [diff] [blame] | 1124 | commits (but not trees).</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1125 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1126 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1127 | -m |
| 1128 | </dt> |
| 1129 | <dd> |
| 1130 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1131 | By default, <em>git diff-tree --stdin</em> does not show |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1132 | differences for merge commits. With this flag, it shows |
Junio C Hamano | a8adb1e | 2006-04-10 23:46:16 | [diff] [blame] | 1133 | differences to that commit from all of its parents. See |
| 1134 | also <em>-c</em>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1135 | </p> |
| 1136 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1137 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1138 | -s |
| 1139 | </dt> |
| 1140 | <dd> |
| 1141 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1142 | By default, <em>git diff-tree --stdin</em> shows differences, |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1143 | either in machine-readable form (without <em>-p</em>) or in patch |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 1144 | form (with <em>-p</em>). This output can be suppressed. It is |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1145 | only useful with <em>-v</em> flag. |
| 1146 | </p> |
| 1147 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1148 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1149 | -v |
| 1150 | </dt> |
| 1151 | <dd> |
| 1152 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1153 | This flag causes <em>git diff-tree --stdin</em> to also show |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1154 | the commit message before the differences. |
| 1155 | </p> |
| 1156 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1157 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1158 | --pretty[=<format>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1159 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1160 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1161 | --format=<format> |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 1162 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1163 | <dd> |
| 1164 | <p> |
Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 1165 | Pretty-print the contents of the commit logs in a given format, |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1166 | 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] | 1167 | <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:<string></em>. See |
| 1168 | the "PRETTY FORMATS" section for some additional details for each |
| 1169 | format. When omitted, the format defaults to <em>medium</em>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1170 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1171 | <div class="paragraph"><p>Note: you can specify the default pretty format in the repository |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1172 | configuration (see <a href="git-config.html">git-config(1)</a>).</p></div> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1173 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1174 | <dt class="hdlist1"> |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1175 | --abbrev-commit |
| 1176 | </dt> |
| 1177 | <dd> |
| 1178 | <p> |
| 1179 | Instead of showing the full 40-byte hexadecimal commit object |
Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 1180 | name, show only a partial prefix. Non default number of |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1181 | digits can be specified with "--abbrev=<n>" (which also modifies |
| 1182 | diff output, if it is displayed). |
| 1183 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1184 | <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1185 | people using 80-column terminals.</p></div> |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1186 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1187 | <dt class="hdlist1"> |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 1188 | --oneline |
| 1189 | </dt> |
| 1190 | <dd> |
| 1191 | <p> |
| 1192 | This is a shorthand for "--pretty=oneline --abbrev-commit" |
| 1193 | used together. |
| 1194 | </p> |
| 1195 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1196 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1197 | --encoding[=<encoding>] |
| 1198 | </dt> |
| 1199 | <dd> |
| 1200 | <p> |
| 1201 | The commit objects record the encoding used for the log message |
| 1202 | in their encoding header; this option can be used to tell the |
| 1203 | command to re-code the commit log message in the encoding |
| 1204 | preferred by the user. For non plumbing commands this |
| 1205 | defaults to UTF-8. |
| 1206 | </p> |
| 1207 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1208 | <dt class="hdlist1"> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1209 | --no-notes |
| 1210 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1211 | <dt class="hdlist1"> |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1212 | --show-notes[=<ref>] |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1213 | </dt> |
| 1214 | <dd> |
| 1215 | <p> |
| 1216 | Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the |
| 1217 | commit, when showing the commit log message. This is the default |
| 1218 | for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when |
| 1219 | there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option is |
| 1220 | given on the command line. |
| 1221 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1222 | <div class="paragraph"><p>With an optional argument, add this ref to the list of notes. The ref |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1223 | is taken to be in <tt>refs/notes/</tt> if it is not qualified.</p></div> |
| 1224 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1225 | <dt class="hdlist1"> |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1226 | --[no-]standard-notes |
| 1227 | </dt> |
| 1228 | <dd> |
| 1229 | <p> |
| 1230 | Enable or disable populating the notes ref list from the |
| 1231 | <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or |
| 1232 | corresponding environment overrides). Enabled by default. |
| 1233 | See <a href="git-config.html">git-config(1)</a>. |
| 1234 | </p> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1235 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1236 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1237 | --no-commit-id |
| 1238 | </dt> |
| 1239 | <dd> |
| 1240 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1241 | <em>git diff-tree</em> outputs a line with the commit ID when |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1242 | applicable. This flag suppressed the commit ID output. |
| 1243 | </p> |
| 1244 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1245 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1246 | -c |
| 1247 | </dt> |
| 1248 | <dd> |
| 1249 | <p> |
| 1250 | This flag changes the way a merge commit is displayed |
| 1251 | (which means it is useful only when the command is given |
| 1252 | one <tree-ish>, or <em>--stdin</em>). It shows the differences |
| 1253 | from each of the parents to the merge result simultaneously |
| 1254 | instead of showing pairwise diff between a parent and the |
| 1255 | result one at a time (which is what the <em>-m</em> option does). |
| 1256 | Furthermore, it lists only files which were modified |
| 1257 | from all parents. |
| 1258 | </p> |
| 1259 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1260 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1261 | --cc |
| 1262 | </dt> |
| 1263 | <dd> |
| 1264 | <p> |
| 1265 | This flag changes the way a merge commit patch is displayed, |
| 1266 | in a similar way to the <em>-c</em> option. It implies the <em>-c</em> |
| 1267 | and <em>-p</em> options and further compresses the patch output |
Junio C Hamano | ccc2f76 | 2008-07-24 04:03:33 | [diff] [blame] | 1268 | by omitting uninteresting hunks whose the contents in the parents |
| 1269 | have only two variants and the merge result picks one of them |
| 1270 | without modification. When all hunks are uninteresting, the commit |
| 1271 | itself and the commit log message is not shown, just like in any other |
| 1272 | "empty diff" case. |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1273 | </p> |
| 1274 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1275 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1276 | --always |
| 1277 | </dt> |
| 1278 | <dd> |
| 1279 | <p> |
| 1280 | Show the commit itself and the commit log message even |
| 1281 | if the diff itself is empty. |
| 1282 | </p> |
| 1283 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1284 | </dl></div> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1285 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1286 | <h2 id="_pretty_formats">PRETTY FORMATS</h2> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1287 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1288 | <div class="paragraph"><p>If the commit is a merge, and if the pretty-format |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1289 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 1290 | inserted before the <em>Author:</em> line. This line begins with |
| 1291 | "Merge: " and the sha1s of ancestral commits are printed, |
| 1292 | separated by spaces. Note that the listed commits may not |
| 1293 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 1294 | have limited your view of history: for example, if you are |
| 1295 | only interested in changes related to a certain directory or |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1296 | file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1297 | <div class="paragraph"><p>There are several built-in formats, and you can define |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 1298 | additional formats by setting a pretty.<name> |
| 1299 | config option to either another format name, or a |
| 1300 | <em>format:</em> string, as described below (see |
| 1301 | <a href="git-config.html">git-config(1)</a>). Here are the details of the |
| 1302 | built-in formats:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1303 | <div class="ulist"><ul> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1304 | <li> |
| 1305 | <p> |
| 1306 | <em>oneline</em> |
| 1307 | </p> |
| 1308 | <div class="literalblock"> |
| 1309 | <div class="content"> |
| 1310 | <pre><tt><sha1> <title line></tt></pre> |
| 1311 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1312 | <div class="paragraph"><p>This is designed to be as compact as possible.</p></div> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1313 | </li> |
| 1314 | <li> |
| 1315 | <p> |
| 1316 | <em>short</em> |
| 1317 | </p> |
| 1318 | <div class="literalblock"> |
| 1319 | <div class="content"> |
| 1320 | <pre><tt>commit <sha1> |
| 1321 | Author: <author></tt></pre> |
| 1322 | </div></div> |
| 1323 | <div class="literalblock"> |
| 1324 | <div class="content"> |
| 1325 | <pre><tt><title line></tt></pre> |
| 1326 | </div></div> |
| 1327 | </li> |
| 1328 | <li> |
| 1329 | <p> |
| 1330 | <em>medium</em> |
| 1331 | </p> |
| 1332 | <div class="literalblock"> |
| 1333 | <div class="content"> |
| 1334 | <pre><tt>commit <sha1> |
| 1335 | Author: <author> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 1336 | Date: <author date></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1337 | </div></div> |
| 1338 | <div class="literalblock"> |
| 1339 | <div class="content"> |
| 1340 | <pre><tt><title line></tt></pre> |
| 1341 | </div></div> |
| 1342 | <div class="literalblock"> |
| 1343 | <div class="content"> |
| 1344 | <pre><tt><full commit message></tt></pre> |
| 1345 | </div></div> |
| 1346 | </li> |
| 1347 | <li> |
| 1348 | <p> |
| 1349 | <em>full</em> |
| 1350 | </p> |
| 1351 | <div class="literalblock"> |
| 1352 | <div class="content"> |
| 1353 | <pre><tt>commit <sha1> |
| 1354 | Author: <author> |
| 1355 | Commit: <committer></tt></pre> |
| 1356 | </div></div> |
| 1357 | <div class="literalblock"> |
| 1358 | <div class="content"> |
| 1359 | <pre><tt><title line></tt></pre> |
| 1360 | </div></div> |
| 1361 | <div class="literalblock"> |
| 1362 | <div class="content"> |
| 1363 | <pre><tt><full commit message></tt></pre> |
| 1364 | </div></div> |
| 1365 | </li> |
| 1366 | <li> |
| 1367 | <p> |
| 1368 | <em>fuller</em> |
| 1369 | </p> |
| 1370 | <div class="literalblock"> |
| 1371 | <div class="content"> |
| 1372 | <pre><tt>commit <sha1> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 1373 | Author: <author> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1374 | AuthorDate: <author date> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 1375 | Commit: <committer> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1376 | CommitDate: <committer date></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1377 | </div></div> |
| 1378 | <div class="literalblock"> |
| 1379 | <div class="content"> |
| 1380 | <pre><tt><title line></tt></pre> |
| 1381 | </div></div> |
| 1382 | <div class="literalblock"> |
| 1383 | <div class="content"> |
| 1384 | <pre><tt><full commit message></tt></pre> |
| 1385 | </div></div> |
| 1386 | </li> |
| 1387 | <li> |
| 1388 | <p> |
| 1389 | <em>email</em> |
| 1390 | </p> |
| 1391 | <div class="literalblock"> |
| 1392 | <div class="content"> |
| 1393 | <pre><tt>From <sha1> <date> |
| 1394 | From: <author> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1395 | Date: <author date> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1396 | Subject: [PATCH] <title line></tt></pre> |
| 1397 | </div></div> |
| 1398 | <div class="literalblock"> |
| 1399 | <div class="content"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1400 | <pre><tt><full commit message></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1401 | </div></div> |
| 1402 | </li> |
| 1403 | <li> |
| 1404 | <p> |
| 1405 | <em>raw</em> |
| 1406 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1407 | <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1408 | stored in the commit object. Notably, the SHA1s are |
| 1409 | displayed in full, regardless of whether --abbrev or |
| 1410 | --no-abbrev are used, and <em>parents</em> information show the |
| 1411 | true parent commits, without taking grafts nor history |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1412 | simplification into account.</p></div> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1413 | </li> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1414 | <li> |
| 1415 | <p> |
Junio C Hamano | e32ec8b | 2010-06-02 23:32:31 | [diff] [blame] | 1416 | <em>format:<string></em> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1417 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1418 | <div class="paragraph"><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] | 1419 | you want to show. It works a little bit like printf format, |
| 1420 | 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] | 1421 | instead of <em>\n</em>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1422 | <div class="paragraph"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"</em> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1423 | would show something like this:</p></div> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1424 | <div class="listingblock"> |
| 1425 | <div class="content"> |
| 1426 | <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1427 | The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<</tt></pre> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1428 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1429 | <div class="paragraph"><p>The placeholders are:</p></div> |
| 1430 | <div class="ulist"><ul> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1431 | <li> |
| 1432 | <p> |
| 1433 | <em>%H</em>: commit hash |
| 1434 | </p> |
| 1435 | </li> |
| 1436 | <li> |
| 1437 | <p> |
| 1438 | <em>%h</em>: abbreviated commit hash |
| 1439 | </p> |
| 1440 | </li> |
| 1441 | <li> |
| 1442 | <p> |
| 1443 | <em>%T</em>: tree hash |
| 1444 | </p> |
| 1445 | </li> |
| 1446 | <li> |
| 1447 | <p> |
| 1448 | <em>%t</em>: abbreviated tree hash |
| 1449 | </p> |
| 1450 | </li> |
| 1451 | <li> |
| 1452 | <p> |
| 1453 | <em>%P</em>: parent hashes |
| 1454 | </p> |
| 1455 | </li> |
| 1456 | <li> |
| 1457 | <p> |
| 1458 | <em>%p</em>: abbreviated parent hashes |
| 1459 | </p> |
| 1460 | </li> |
| 1461 | <li> |
| 1462 | <p> |
| 1463 | <em>%an</em>: author name |
| 1464 | </p> |
| 1465 | </li> |
| 1466 | <li> |
| 1467 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1468 | <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] | 1469 | </p> |
| 1470 | </li> |
| 1471 | <li> |
| 1472 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1473 | <em>%ae</em>: author email |
| 1474 | </p> |
| 1475 | </li> |
| 1476 | <li> |
| 1477 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1478 | <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>) |
| 1479 | </p> |
| 1480 | </li> |
| 1481 | <li> |
| 1482 | <p> |
Junio C Hamano | a387df3 | 2008-08-29 08:56:58 | [diff] [blame] | 1483 | <em>%ad</em>: author date (format respects --date= option) |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1484 | </p> |
| 1485 | </li> |
| 1486 | <li> |
| 1487 | <p> |
| 1488 | <em>%aD</em>: author date, RFC2822 style |
| 1489 | </p> |
| 1490 | </li> |
| 1491 | <li> |
| 1492 | <p> |
| 1493 | <em>%ar</em>: author date, relative |
| 1494 | </p> |
| 1495 | </li> |
| 1496 | <li> |
| 1497 | <p> |
| 1498 | <em>%at</em>: author date, UNIX timestamp |
| 1499 | </p> |
| 1500 | </li> |
| 1501 | <li> |
| 1502 | <p> |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 1503 | <em>%ai</em>: author date, ISO 8601 format |
| 1504 | </p> |
| 1505 | </li> |
| 1506 | <li> |
| 1507 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1508 | <em>%cn</em>: committer name |
| 1509 | </p> |
| 1510 | </li> |
| 1511 | <li> |
| 1512 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1513 | <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] | 1514 | </p> |
| 1515 | </li> |
| 1516 | <li> |
| 1517 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1518 | <em>%ce</em>: committer email |
| 1519 | </p> |
| 1520 | </li> |
| 1521 | <li> |
| 1522 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1523 | <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>) |
| 1524 | </p> |
| 1525 | </li> |
| 1526 | <li> |
| 1527 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1528 | <em>%cd</em>: committer date |
| 1529 | </p> |
| 1530 | </li> |
| 1531 | <li> |
| 1532 | <p> |
| 1533 | <em>%cD</em>: committer date, RFC2822 style |
| 1534 | </p> |
| 1535 | </li> |
| 1536 | <li> |
| 1537 | <p> |
| 1538 | <em>%cr</em>: committer date, relative |
| 1539 | </p> |
| 1540 | </li> |
| 1541 | <li> |
| 1542 | <p> |
| 1543 | <em>%ct</em>: committer date, UNIX timestamp |
| 1544 | </p> |
| 1545 | </li> |
| 1546 | <li> |
| 1547 | <p> |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 1548 | <em>%ci</em>: committer date, ISO 8601 format |
| 1549 | </p> |
| 1550 | </li> |
| 1551 | <li> |
| 1552 | <p> |
Junio C Hamano | 5e4d8de | 2008-09-19 06:27:02 | [diff] [blame] | 1553 | <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a> |
| 1554 | </p> |
| 1555 | </li> |
| 1556 | <li> |
| 1557 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1558 | <em>%e</em>: encoding |
| 1559 | </p> |
| 1560 | </li> |
| 1561 | <li> |
| 1562 | <p> |
| 1563 | <em>%s</em>: subject |
| 1564 | </p> |
| 1565 | </li> |
| 1566 | <li> |
| 1567 | <p> |
Junio C Hamano | 5f9a6f0 | 2009-04-06 08:26:56 | [diff] [blame] | 1568 | <em>%f</em>: sanitized subject line, suitable for a filename |
| 1569 | </p> |
| 1570 | </li> |
| 1571 | <li> |
| 1572 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1573 | <em>%b</em>: body |
| 1574 | </p> |
| 1575 | </li> |
| 1576 | <li> |
| 1577 | <p> |
Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 1578 | <em>%B</em>: raw body (unwrapped subject and body) |
| 1579 | </p> |
| 1580 | </li> |
| 1581 | <li> |
| 1582 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1583 | <em>%N</em>: commit notes |
| 1584 | </p> |
| 1585 | </li> |
| 1586 | <li> |
| 1587 | <p> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1588 | <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt> |
| 1589 | </p> |
| 1590 | </li> |
| 1591 | <li> |
| 1592 | <p> |
| 1593 | <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt> |
| 1594 | </p> |
| 1595 | </li> |
| 1596 | <li> |
| 1597 | <p> |
| 1598 | <em>%gs</em>: reflog subject |
| 1599 | </p> |
| 1600 | </li> |
| 1601 | <li> |
| 1602 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1603 | <em>%Cred</em>: switch color to red |
| 1604 | </p> |
| 1605 | </li> |
| 1606 | <li> |
| 1607 | <p> |
| 1608 | <em>%Cgreen</em>: switch color to green |
| 1609 | </p> |
| 1610 | </li> |
| 1611 | <li> |
| 1612 | <p> |
| 1613 | <em>%Cblue</em>: switch color to blue |
| 1614 | </p> |
| 1615 | </li> |
| 1616 | <li> |
| 1617 | <p> |
| 1618 | <em>%Creset</em>: reset color |
| 1619 | </p> |
| 1620 | </li> |
| 1621 | <li> |
| 1622 | <p> |
Junio C Hamano | cc0cb31 | 2009-01-22 03:38:50 | [diff] [blame] | 1623 | <em>%C(…)</em>: color specification, as described in color.branch.* config option |
| 1624 | </p> |
| 1625 | </li> |
| 1626 | <li> |
| 1627 | <p> |
Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 1628 | <em>%m</em>: left, right or boundary mark |
| 1629 | </p> |
| 1630 | </li> |
| 1631 | <li> |
| 1632 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1633 | <em>%n</em>: newline |
| 1634 | </p> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1635 | </li> |
Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 1636 | <li> |
| 1637 | <p> |
Junio C Hamano | a9701f0 | 2010-01-21 00:42:16 | [diff] [blame] | 1638 | <em>%%</em>: a raw <em>%</em> |
| 1639 | </p> |
| 1640 | </li> |
| 1641 | <li> |
| 1642 | <p> |
Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 1643 | <em>%x00</em>: print a byte from a hex code |
| 1644 | </p> |
| 1645 | </li> |
Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 1646 | <li> |
| 1647 | <p> |
| 1648 | <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] | 1649 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 1650 | </p> |
| 1651 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1652 | </ul></div> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1653 | </li> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1654 | </ul></div> |
| 1655 | <div class="admonitionblock"> |
| 1656 | <table><tr> |
| 1657 | <td class="icon"> |
| 1658 | <div class="title">Note</div> |
| 1659 | </td> |
| 1660 | <td class="content">Some placeholders may depend on other options given to the |
| 1661 | revision traversal engine. For example, the <tt>%g*</tt> reflog options will |
| 1662 | insert an empty string unless we are traversing reflog entries (e.g., by |
| 1663 | <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration |
| 1664 | format if <tt>--decorate</tt> was not already provided on the command line.</td> |
| 1665 | </tr></table> |
| 1666 | </div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1667 | <div class="paragraph"><p>If you add a <tt>+</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed |
Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 1668 | is inserted immediately before the expansion if and only if the |
| 1669 | placeholder expands to a non-empty string.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1670 | <div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that |
Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 1671 | immediately precede the expansion are deleted if and only if the |
| 1672 | placeholder expands to an empty string.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1673 | <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1674 | is inserted immediately before the expansion if and only if the |
| 1675 | placeholder expands to a non-empty string.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1676 | <div class="ulist"><ul> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 1677 | <li> |
| 1678 | <p> |
| 1679 | <em>tformat:</em> |
| 1680 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1681 | <div class="paragraph"><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] | 1682 | provides "terminator" semantics instead of "separator" semantics. In |
| 1683 | other words, each commit has the message terminator character (usually a |
| 1684 | newline) appended, rather than a separator placed between entries. |
| 1685 | This means that the final entry of a single-line format will be properly |
| 1686 | terminated with a new line, just as the "oneline" format does. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1687 | For example:</p></div> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 1688 | <div class="listingblock"> |
| 1689 | <div class="content"> |
| 1690 | <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \ |
| 1691 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 1692 | 4da45be |
| 1693 | 7134973 -- NO NEWLINE |
| 1694 | |
| 1695 | $ git log -2 --pretty=tformat:%h 4da45bef \ |
| 1696 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 1697 | 4da45be |
| 1698 | 7134973</tt></pre> |
| 1699 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1700 | <div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 1701 | as if it has <tt>tformat:</tt> in front of it. For example, these two are |
| 1702 | equivalent:</p></div> |
| 1703 | <div class="listingblock"> |
| 1704 | <div class="content"> |
| 1705 | <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef |
| 1706 | $ git log -2 --pretty=%h 4da45bef</tt></pre> |
| 1707 | </div></div> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 1708 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1709 | </ul></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1710 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1711 | <h2 id="_limiting_output">Limiting Output</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1712 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1713 | <div class="paragraph"><p>If you’re only interested in differences in a subset of files, for |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1714 | example some architecture-specific files, you might do:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1715 | <div class="literalblock"> |
| 1716 | <div class="content"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 1717 | <pre><tt>git diff-tree -r <tree-ish> <tree-ish> arch/ia64 include/asm-ia64</tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1718 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1719 | <div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div> |
| 1720 | <div class="paragraph"><p>Or if you are searching for what changed in just <tt>kernel/sched.c</tt>, just do</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1721 | <div class="literalblock"> |
| 1722 | <div class="content"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 1723 | <pre><tt>git diff-tree -r <tree-ish> <tree-ish> kernel/sched.c</tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1724 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1725 | <div class="paragraph"><p>and it will ignore all differences to other files.</p></div> |
| 1726 | <div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1727 | wildcards. Even stricter, it has to match a complete path component. |
| 1728 | I.e. "foo" does not pick up <tt>foobar.h</tt>. "foo" does match <tt>foo/bar.h</tt> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1729 | so it can be used to name subdirectories.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1730 | <div class="paragraph"><p>An example of normal usage is:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1731 | <div class="literalblock"> |
| 1732 | <div class="content"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 1733 | <pre><tt>torvalds@ppc970:~/git> git diff-tree 5319e4...... |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1734 | *100664->100664 blob ac348b.......->a01513....... git-fsck-objects.c</tt></pre> |
| 1735 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1736 | <div class="paragraph"><p>which tells you that the last commit changed just one file (it’s from |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1737 | this one:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1738 | <div class="listingblock"> |
| 1739 | <div class="content"> |
| 1740 | <pre><tt>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8 |
| 1741 | tree 5319e4d609cdd282069cc4dce33c1db559539b03 |
| 1742 | parent b4e628ea30d5ab3606119d2ea5caeab141d38df7 |
| 1743 | author Linus Torvalds <torvalds@ppc970.osdl.org> Sat Apr 9 12:02:30 2005 |
| 1744 | committer Linus Torvalds <torvalds@ppc970.osdl.org> Sat Apr 9 12:02:30 2005 |
| 1745 | |
| 1746 | Make "git-fsck-objects" print out all the root commits it finds. |
| 1747 | |
| 1748 | Once I do the reference tracking, I'll also make it print out all the |
| 1749 | HEAD commits it finds, which is even more interesting.</tt></pre> |
| 1750 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1751 | <div class="paragraph"><p>in case you care).</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1752 | </div> |
Junio C Hamano | 543f8d6 | 2009-07-29 08:35:21 | [diff] [blame] | 1753 | <h2 id="_raw_output_format">Raw output format</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1754 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1755 | <div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree", |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1756 | "git-diff-files" and "git diff --raw" are very similar.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1757 | <div class="paragraph"><p>These commands all compare two sets of things; what is |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1758 | compared differs:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1759 | <div class="dlist"><dl> |
| 1760 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1761 | git-diff-index <tree-ish> |
| 1762 | </dt> |
| 1763 | <dd> |
| 1764 | <p> |
| 1765 | compares the <tree-ish> and the files on the filesystem. |
| 1766 | </p> |
| 1767 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1768 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1769 | git-diff-index --cached <tree-ish> |
| 1770 | </dt> |
| 1771 | <dd> |
| 1772 | <p> |
| 1773 | compares the <tree-ish> and the index. |
| 1774 | </p> |
| 1775 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1776 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1777 | git-diff-tree [-r] <tree-ish-1> <tree-ish-2> [<pattern>…] |
| 1778 | </dt> |
| 1779 | <dd> |
| 1780 | <p> |
| 1781 | compares the trees named by the two arguments. |
| 1782 | </p> |
| 1783 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1784 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1785 | git-diff-files [<pattern>…] |
| 1786 | </dt> |
| 1787 | <dd> |
| 1788 | <p> |
| 1789 | compares the index and the files on the filesystem. |
| 1790 | </p> |
| 1791 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1792 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1793 | <div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of |
Junio C Hamano | 543f8d6 | 2009-07-29 08:35:21 | [diff] [blame] | 1794 | what is being compared. After that, all the commands print one output |
| 1795 | line per changed file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1796 | <div class="paragraph"><p>An output line is formatted this way:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1797 | <div class="listingblock"> |
| 1798 | <div class="content"> |
| 1799 | <pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0 |
| 1800 | copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2 |
| 1801 | rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3 |
| 1802 | create :000000 100644 0000000... 1234567... A file4 |
| 1803 | delete :100644 000000 1234567... 0000000... D file5 |
| 1804 | unmerged :000000 000000 0000000... 0000000... U file6</tt></pre> |
| 1805 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1806 | <div class="paragraph"><p>That is, from the left to the right:</p></div> |
| 1807 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1808 | <li> |
| 1809 | <p> |
| 1810 | a colon. |
| 1811 | </p> |
| 1812 | </li> |
| 1813 | <li> |
| 1814 | <p> |
| 1815 | mode for "src"; 000000 if creation or unmerged. |
| 1816 | </p> |
| 1817 | </li> |
| 1818 | <li> |
| 1819 | <p> |
| 1820 | a space. |
| 1821 | </p> |
| 1822 | </li> |
| 1823 | <li> |
| 1824 | <p> |
| 1825 | mode for "dst"; 000000 if deletion or unmerged. |
| 1826 | </p> |
| 1827 | </li> |
| 1828 | <li> |
| 1829 | <p> |
| 1830 | a space. |
| 1831 | </p> |
| 1832 | </li> |
| 1833 | <li> |
| 1834 | <p> |
| 1835 | sha1 for "src"; 0{40} if creation or unmerged. |
| 1836 | </p> |
| 1837 | </li> |
| 1838 | <li> |
| 1839 | <p> |
| 1840 | a space. |
| 1841 | </p> |
| 1842 | </li> |
| 1843 | <li> |
| 1844 | <p> |
| 1845 | sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree". |
| 1846 | </p> |
| 1847 | </li> |
| 1848 | <li> |
| 1849 | <p> |
| 1850 | a space. |
| 1851 | </p> |
| 1852 | </li> |
| 1853 | <li> |
| 1854 | <p> |
| 1855 | status, followed by optional "score" number. |
| 1856 | </p> |
| 1857 | </li> |
| 1858 | <li> |
| 1859 | <p> |
| 1860 | a tab or a NUL when <em>-z</em> option is used. |
| 1861 | </p> |
| 1862 | </li> |
| 1863 | <li> |
| 1864 | <p> |
| 1865 | path for "src" |
| 1866 | </p> |
| 1867 | </li> |
| 1868 | <li> |
| 1869 | <p> |
| 1870 | a tab or a NUL when <em>-z</em> option is used; only exists for C or R. |
| 1871 | </p> |
| 1872 | </li> |
| 1873 | <li> |
| 1874 | <p> |
| 1875 | path for "dst"; only exists for C or R. |
| 1876 | </p> |
| 1877 | </li> |
| 1878 | <li> |
| 1879 | <p> |
| 1880 | an LF or a NUL when <em>-z</em> option is used, to terminate the record. |
| 1881 | </p> |
| 1882 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1883 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1884 | <div class="paragraph"><p>Possible status letters are:</p></div> |
| 1885 | <div class="ulist"><ul> |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1886 | <li> |
| 1887 | <p> |
| 1888 | A: addition of a file |
| 1889 | </p> |
| 1890 | </li> |
| 1891 | <li> |
| 1892 | <p> |
| 1893 | C: copy of a file into a new one |
| 1894 | </p> |
| 1895 | </li> |
| 1896 | <li> |
| 1897 | <p> |
| 1898 | D: deletion of a file |
| 1899 | </p> |
| 1900 | </li> |
| 1901 | <li> |
| 1902 | <p> |
| 1903 | M: modification of the contents or mode of a file |
| 1904 | </p> |
| 1905 | </li> |
| 1906 | <li> |
| 1907 | <p> |
| 1908 | R: renaming of a file |
| 1909 | </p> |
| 1910 | </li> |
| 1911 | <li> |
| 1912 | <p> |
| 1913 | T: change in the type of the file |
| 1914 | </p> |
| 1915 | </li> |
| 1916 | <li> |
| 1917 | <p> |
| 1918 | U: file is unmerged (you must complete the merge before it can |
| 1919 | be committed) |
| 1920 | </p> |
| 1921 | </li> |
| 1922 | <li> |
| 1923 | <p> |
| 1924 | X: "unknown" change type (most probably a bug, please report it) |
| 1925 | </p> |
| 1926 | </li> |
| 1927 | </ul></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1928 | <div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1929 | percentage of similarity between the source and target of the move or |
| 1930 | copy), and are the only ones to be so.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1931 | <div class="paragraph"><p><sha1> is shown as all 0’s if a file is new on the filesystem |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1932 | and it is out of sync with the index.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1933 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1934 | <div class="listingblock"> |
| 1935 | <div class="content"> |
| 1936 | <pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre> |
| 1937 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1938 | <div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1939 | in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1940 | respectively.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1941 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1942 | <h2 id="_diff_format_for_merges">diff format for merges</h2> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1943 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1944 | <div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw" |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1945 | can take <em>-c</em> or <em>--cc</em> option |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1946 | to generate diff output also for merge commits. The output differs |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1947 | from the format described above in the following way:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1948 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1949 | <li> |
| 1950 | <p> |
| 1951 | there is a colon for each parent |
| 1952 | </p> |
| 1953 | </li> |
| 1954 | <li> |
| 1955 | <p> |
| 1956 | there are more "src" modes and "src" sha1 |
| 1957 | </p> |
| 1958 | </li> |
| 1959 | <li> |
| 1960 | <p> |
| 1961 | status is concatenated status characters for each parent |
| 1962 | </p> |
| 1963 | </li> |
| 1964 | <li> |
| 1965 | <p> |
| 1966 | no optional "score" number |
| 1967 | </p> |
| 1968 | </li> |
| 1969 | <li> |
| 1970 | <p> |
| 1971 | single path, only for "dst" |
| 1972 | </p> |
| 1973 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1974 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1975 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1976 | <div class="listingblock"> |
| 1977 | <div class="content"> |
| 1978 | <pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre> |
| 1979 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1980 | <div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1981 | all parents.</p></div> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1982 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1983 | <h2 id="_generating_patches_with_p">Generating patches with -p</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1984 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1985 | <div class="paragraph"><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] | 1986 | with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or |
| 1987 | "git log" with the "-p" option, they |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1988 | do not produce the output described above; instead they produce a |
| 1989 | patch file. You can customize the creation of such patches via the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1990 | GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1991 | <div class="paragraph"><p>What the -p option produces is slightly different from the traditional |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1992 | diff format:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1993 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1994 | <li> |
| 1995 | <p> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1996 | It is preceded with a "git diff" header that looks like this: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1997 | </p> |
| 1998 | <div class="literalblock"> |
| 1999 | <div class="content"> |
| 2000 | <pre><tt>diff --git a/file1 b/file2</tt></pre> |
| 2001 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2002 | <div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2003 | involved. Especially, even for a creation or a deletion, |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2004 | <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div> |
| 2005 | <div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2006 | 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] | 2007 | the file that rename/copy produces, respectively.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2008 | </li> |
| 2009 | <li> |
| 2010 | <p> |
| 2011 | It is followed by one or more extended header lines: |
| 2012 | </p> |
| 2013 | <div class="literalblock"> |
| 2014 | <div class="content"> |
| 2015 | <pre><tt>old mode <mode> |
| 2016 | new mode <mode> |
| 2017 | deleted file mode <mode> |
| 2018 | new file mode <mode> |
| 2019 | copy from <path> |
| 2020 | copy to <path> |
| 2021 | rename from <path> |
| 2022 | rename to <path> |
| 2023 | similarity index <number> |
| 2024 | dissimilarity index <number> |
| 2025 | index <hash>..<hash> <mode></tt></pre> |
| 2026 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2027 | <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 2028 | and file permission bits.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2029 | <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div> |
| 2030 | <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 2031 | the dissimilarity index is the percentage of changed lines. It |
| 2032 | is a rounded down integer, followed by a percent sign. The |
| 2033 | similarity index value of 100% is thus reserved for two equal |
| 2034 | files, while 100% dissimilarity means that no line from the old |
| 2035 | file made it into the new one.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2036 | <div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change. |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 2037 | The <mode> is included if the file mode does not change; otherwise, |
| 2038 | separate lines indicate the old and the new mode.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2039 | </li> |
| 2040 | <li> |
| 2041 | <p> |
Junio C Hamano | a053d54 | 2006-10-27 09:29:13 | [diff] [blame] | 2042 | TAB, LF, double quote and backslash characters in pathnames |
| 2043 | are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively. |
| 2044 | If there is need for such substitution then the whole |
| 2045 | pathname is put in double quotes. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2046 | </p> |
| 2047 | </li> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 2048 | <li> |
| 2049 | <p> |
| 2050 | All the <tt>file1</tt> files in the output refer to files before the |
| 2051 | commit, and all the <tt>file2</tt> files refer to files after the commit. |
| 2052 | It is incorrect to apply each change to each file sequentially. For |
| 2053 | example, this patch will swap a and b: |
| 2054 | </p> |
| 2055 | <div class="literalblock"> |
| 2056 | <div class="content"> |
| 2057 | <pre><tt>diff --git a/a b/b |
| 2058 | rename from a |
| 2059 | rename to b |
| 2060 | diff --git a/b b/a |
| 2061 | rename from b |
| 2062 | rename to a</tt></pre> |
| 2063 | </div></div> |
| 2064 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2065 | </ol></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2066 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2067 | <h2 id="_combined_diff_format">combined diff format</h2> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2068 | <div class="sectionbody"> |
Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 2069 | <div class="paragraph"><p>Any diff-generating command can take the ‘-c` or <tt>--cc</tt> option to |
| 2070 | produce a <em>combined diff</em> when showing a merge. This is the default |
| 2071 | format when showing merges with <a href="git-diff.html">git-diff(1)</a> or |
| 2072 | <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m’ option to any |
| 2073 | of these commands to force generation of diffs with individual parents |
| 2074 | of a merge.</p></div> |
| 2075 | <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2076 | <div class="listingblock"> |
| 2077 | <div class="content"> |
| 2078 | <pre><tt>diff --combined describe.c |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2079 | index fabadb8,cc95eb0..4866510 |
| 2080 | --- a/describe.c |
| 2081 | +++ b/describe.c |
| 2082 | @@@ -98,20 -98,12 +98,20 @@@ |
| 2083 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2084 | } |
| 2085 | |
| 2086 | - static void describe(char *arg) |
| 2087 | -static void describe(struct commit *cmit, int last_one) |
| 2088 | ++static void describe(char *arg, int last_one) |
| 2089 | { |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2090 | + unsigned char sha1[20]; |
| 2091 | + struct commit *cmit; |
| 2092 | struct commit_list *list; |
| 2093 | static int initialized = 0; |
| 2094 | struct commit_name *n; |
| 2095 | |
| 2096 | + if (get_sha1(arg, sha1) < 0) |
| 2097 | + usage(describe_usage); |
| 2098 | + cmit = lookup_commit_reference(sha1); |
| 2099 | + if (!cmit) |
| 2100 | + usage(describe_usage); |
| 2101 | + |
| 2102 | if (!initialized) { |
| 2103 | initialized = 1; |
| 2104 | for_each_ref(get_name);</tt></pre> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2105 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2106 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2107 | <li> |
| 2108 | <p> |
| 2109 | It is preceded with a "git diff" header, that looks like |
| 2110 | this (when <em>-c</em> option is used): |
| 2111 | </p> |
| 2112 | <div class="literalblock"> |
| 2113 | <div class="content"> |
| 2114 | <pre><tt>diff --combined file</tt></pre> |
| 2115 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2116 | <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2117 | <div class="literalblock"> |
| 2118 | <div class="content"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2119 | <pre><tt>diff --cc file</tt></pre> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2120 | </div></div> |
| 2121 | </li> |
| 2122 | <li> |
| 2123 | <p> |
| 2124 | It is followed by one or more extended header lines |
| 2125 | (this example shows a merge with two parents): |
| 2126 | </p> |
| 2127 | <div class="literalblock"> |
| 2128 | <div class="content"> |
| 2129 | <pre><tt>index <hash>,<hash>..<hash> |
| 2130 | mode <mode>,<mode>..<mode> |
| 2131 | new file mode <mode> |
| 2132 | deleted file mode <mode>,<mode></tt></pre> |
| 2133 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2134 | <div class="paragraph"><p>The <tt>mode <mode>,<mode>..<mode></tt> line appears only if at least one of |
Junio C Hamano | ee1e428 | 2007-02-04 08:32:04 | [diff] [blame] | 2135 | the <mode> is different from the rest. Extended headers with |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2136 | information about detected contents movement (renames and |
| 2137 | copying detection) are designed to work with diff of two |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2138 | <tree-ish> and are not used by combined diff format.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2139 | </li> |
| 2140 | <li> |
| 2141 | <p> |
| 2142 | It is followed by two-line from-file/to-file header |
| 2143 | </p> |
| 2144 | <div class="literalblock"> |
| 2145 | <div class="content"> |
| 2146 | <pre><tt>--- a/file |
| 2147 | +++ b/file</tt></pre> |
| 2148 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2149 | <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2150 | format, <tt>/dev/null</tt> is used to signal created or deleted |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2151 | files.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2152 | </li> |
| 2153 | <li> |
| 2154 | <p> |
| 2155 | Chunk header format is modified to prevent people from |
| 2156 | accidentally feeding it to <tt>patch -p1</tt>. Combined diff format |
| 2157 | was created for review of merge commit changes, and was not |
| 2158 | meant for apply. The change is similar to the change in the |
| 2159 | extended <em>index</em> header: |
| 2160 | </p> |
| 2161 | <div class="literalblock"> |
| 2162 | <div class="content"> |
| 2163 | <pre><tt>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</tt></pre> |
| 2164 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2165 | <div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2166 | header for combined diff format.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2167 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2168 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2169 | <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two |
| 2170 | files A and B with a single column that has <tt>-</tt> (minus — appears in A but removed in B), <tt>+</tt> (plus — missing in A but |
| 2171 | added to B), or <tt>" "</tt> (space — unchanged) prefix, this format |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2172 | compares two or more files file1, file2,… with one file X, and |
| 2173 | shows how X differs from each of fileN. One column for each of |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2174 | 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] | 2175 | different from it.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2176 | <div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2177 | 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] | 2178 | in the column N means that the line appears in the result, |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2179 | 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] | 2180 | added, from the point of view of that parent).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2181 | <div class="paragraph"><p>In the above example output, the function signature was changed |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2182 | from both files (hence two <tt>-</tt> removals from both file1 and |
Junio C Hamano | 5e4d8de | 2008-09-19 06:27:02 | [diff] [blame] | 2183 | 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] | 2184 | in either file1 nor file2). Also eight other lines are the same |
| 2185 | from file1 but do not appear in file2 (hence prefixed with <tt>+</tt>).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2186 | <div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2187 | merge commit with the merge result (i.e. file1..fileN are the |
| 2188 | parents). When shown by <tt>git diff-files -c</tt>, it compares the |
| 2189 | two unresolved merge parents with the working tree file |
| 2190 | (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] | 2191 | "their version").</p></div> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2192 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2193 | <h2 id="_other_diff_formats">other diff formats</h2> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2194 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2195 | <div class="paragraph"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2196 | copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the |
| 2197 | output. These options can be combined with other options, such as |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2198 | <tt>-p</tt>, and are meant for human consumption.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2199 | <div class="paragraph"><p>When showing a change that involves a rename or a copy, <tt>--stat</tt> output |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2200 | formats the pathnames compactly by combining common prefix and suffix of |
| 2201 | the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2202 | <tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2203 | <div class="listingblock"> |
| 2204 | <div class="content"> |
| 2205 | <pre><tt>arch/{i386 => x86}/Makefile | 4 +--</tt></pre> |
| 2206 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2207 | <div class="paragraph"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2208 | for easier machine consumption. An entry in <tt>--numstat</tt> output looks |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2209 | like this:</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2210 | <div class="listingblock"> |
| 2211 | <div class="content"> |
| 2212 | <pre><tt>1 2 README |
| 2213 | 3 1 arch/{i386 => x86}/Makefile</tt></pre> |
| 2214 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2215 | <div class="paragraph"><p>That is, from left to right:</p></div> |
| 2216 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2217 | <li> |
| 2218 | <p> |
| 2219 | the number of added lines; |
| 2220 | </p> |
| 2221 | </li> |
| 2222 | <li> |
| 2223 | <p> |
| 2224 | a tab; |
| 2225 | </p> |
| 2226 | </li> |
| 2227 | <li> |
| 2228 | <p> |
| 2229 | the number of deleted lines; |
| 2230 | </p> |
| 2231 | </li> |
| 2232 | <li> |
| 2233 | <p> |
| 2234 | a tab; |
| 2235 | </p> |
| 2236 | </li> |
| 2237 | <li> |
| 2238 | <p> |
| 2239 | pathname (possibly with rename/copy information); |
| 2240 | </p> |
| 2241 | </li> |
| 2242 | <li> |
| 2243 | <p> |
| 2244 | a newline. |
| 2245 | </p> |
| 2246 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2247 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2248 | <div class="paragraph"><p>When <tt>-z</tt> output option is in effect, the output is formatted this way:</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2249 | <div class="listingblock"> |
| 2250 | <div class="content"> |
| 2251 | <pre><tt>1 2 README NUL |
| 2252 | 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre> |
| 2253 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2254 | <div class="paragraph"><p>That is:</p></div> |
| 2255 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2256 | <li> |
| 2257 | <p> |
| 2258 | the number of added lines; |
| 2259 | </p> |
| 2260 | </li> |
| 2261 | <li> |
| 2262 | <p> |
| 2263 | a tab; |
| 2264 | </p> |
| 2265 | </li> |
| 2266 | <li> |
| 2267 | <p> |
| 2268 | the number of deleted lines; |
| 2269 | </p> |
| 2270 | </li> |
| 2271 | <li> |
| 2272 | <p> |
| 2273 | a tab; |
| 2274 | </p> |
| 2275 | </li> |
| 2276 | <li> |
| 2277 | <p> |
| 2278 | a NUL (only exists if renamed/copied); |
| 2279 | </p> |
| 2280 | </li> |
| 2281 | <li> |
| 2282 | <p> |
| 2283 | pathname in preimage; |
| 2284 | </p> |
| 2285 | </li> |
| 2286 | <li> |
| 2287 | <p> |
| 2288 | a NUL (only exists if renamed/copied); |
| 2289 | </p> |
| 2290 | </li> |
| 2291 | <li> |
| 2292 | <p> |
| 2293 | pathname in postimage (only exists if renamed/copied); |
| 2294 | </p> |
| 2295 | </li> |
| 2296 | <li> |
| 2297 | <p> |
| 2298 | a NUL. |
| 2299 | </p> |
| 2300 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2301 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2302 | <div class="paragraph"><p>The extra <tt>NUL</tt> before the preimage path in renamed case is to allow |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2303 | scripts that read the output to tell if the current record being read is |
| 2304 | a single-path record or a rename/copy record without reading ahead. |
| 2305 | After reading added and deleted lines, reading up to <tt>NUL</tt> would yield |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2306 | the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2307 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2308 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2309 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2310 | <div class="paragraph"><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] | 2311 | </div> |
| 2312 | <div id="footer"> |
| 2313 | <div id="footer-text"> |
Junio C Hamano | 5f3d839 | 2011-03-15 23:33:35 | [diff] [blame] | 2314 | Last updated 2011-03-15 23:30:13 UTC |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2315 | </div> |
| 2316 | </div> |
| 2317 | </body> |
| 2318 | </html> |