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