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