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" /> |
| 6 | <meta name="generator" content="AsciiDoc 8.6.8" /> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 7 | <title>git-diff(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 | 0868a30 | 2008-07-22 09:20:44 | [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 | 0868a30 | 2008-07-22 09:20:44 | [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 | 0868a30 | 2008-07-22 09:20:44 | [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 | 9629d4f | 2012-12-19 00:28:27 | [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 | } |
| 97 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 98 | |
| 99 | #author { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 100 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 101 | font-weight: bold; |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 102 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 103 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 104 | #email { |
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 | #revnumber, #revdate, #revremark { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 107 | } |
| 108 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 109 | #footer { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 110 | font-size: small; |
| 111 | border-top: 2px solid silver; |
| 112 | padding-top: 0.5em; |
| 113 | margin-top: 4.0em; |
| 114 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 115 | #footer-text { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 116 | float: left; |
| 117 | padding-bottom: 0.5em; |
| 118 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 119 | #footer-badges { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 120 | float: right; |
| 121 | padding-bottom: 0.5em; |
| 122 | } |
| 123 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 124 | #preamble { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 125 | margin-top: 1.5em; |
| 126 | margin-bottom: 1.5em; |
| 127 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 128 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 129 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 130 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 131 | margin-top: 1.0em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 132 | margin-bottom: 1.5em; |
| 133 | } |
| 134 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 135 | margin-top: 2.0em; |
| 136 | margin-bottom: 2.0em; |
| 137 | margin-right: 10%; |
| 138 | color: #606060; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | div.content { /* Block element content. */ |
| 142 | padding: 0; |
| 143 | } |
| 144 | |
| 145 | /* Block element titles. */ |
| 146 | div.title, caption.title { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 147 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 148 | font-weight: bold; |
| 149 | text-align: left; |
| 150 | margin-top: 1.0em; |
| 151 | margin-bottom: 0.5em; |
| 152 | } |
| 153 | div.title + * { |
| 154 | margin-top: 0; |
| 155 | } |
| 156 | |
| 157 | td div.title:first-child { |
| 158 | margin-top: 0.0em; |
| 159 | } |
| 160 | div.content div.title:first-child { |
| 161 | margin-top: 0.0em; |
| 162 | } |
| 163 | div.content + div.title { |
| 164 | margin-top: 0.0em; |
| 165 | } |
| 166 | |
| 167 | div.sidebarblock > div.content { |
| 168 | background: #ffffee; |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 169 | border: 1px solid #dddddd; |
| 170 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 171 | padding: 0.5em; |
| 172 | } |
| 173 | |
| 174 | div.listingblock > div.content { |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 175 | border: 1px solid #dddddd; |
| 176 | border-left: 5px solid #f0f0f0; |
| 177 | background: #f8f8f8; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 178 | padding: 0.5em; |
| 179 | } |
| 180 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 181 | div.quoteblock, div.verseblock { |
| 182 | padding-left: 1.0em; |
| 183 | margin-left: 1.0em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 184 | margin-right: 10%; |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 185 | border-left: 5px solid #f0f0f0; |
| 186 | color: #888; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 187 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 188 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 189 | div.quoteblock > div.attribution { |
| 190 | padding-top: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 191 | text-align: right; |
| 192 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 193 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 194 | div.verseblock > pre.content { |
| 195 | font-family: inherit; |
| 196 | font-size: inherit; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 197 | } |
| 198 | div.verseblock > div.attribution { |
| 199 | padding-top: 0.75em; |
| 200 | text-align: left; |
| 201 | } |
| 202 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 203 | div.verseblock + div.attribution { |
| 204 | text-align: left; |
| 205 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 206 | |
| 207 | div.admonitionblock .icon { |
| 208 | vertical-align: top; |
| 209 | font-size: 1.1em; |
| 210 | font-weight: bold; |
| 211 | text-decoration: underline; |
| 212 | color: #527bbd; |
| 213 | padding-right: 0.5em; |
| 214 | } |
| 215 | div.admonitionblock td.content { |
| 216 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 217 | border-left: 3px solid #dddddd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 221 | border-left: 3px solid #dddddd; |
| 222 | padding-left: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 223 | } |
| 224 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 225 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 226 | span.image img { border-style: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 227 | a.image:visited { color: white; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 228 | |
| 229 | dl { |
| 230 | margin-top: 0.8em; |
| 231 | margin-bottom: 0.8em; |
| 232 | } |
| 233 | dt { |
| 234 | margin-top: 0.5em; |
| 235 | margin-bottom: 0; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 236 | font-style: normal; |
| 237 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 238 | } |
| 239 | dd > *:first-child { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 240 | margin-top: 0.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | ul, ol { |
| 244 | list-style-position: outside; |
| 245 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 246 | ol.arabic { |
| 247 | list-style-type: decimal; |
| 248 | } |
| 249 | ol.loweralpha { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 250 | list-style-type: lower-alpha; |
| 251 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 252 | ol.upperalpha { |
| 253 | list-style-type: upper-alpha; |
| 254 | } |
| 255 | ol.lowerroman { |
| 256 | list-style-type: lower-roman; |
| 257 | } |
| 258 | ol.upperroman { |
| 259 | list-style-type: upper-roman; |
| 260 | } |
| 261 | |
| 262 | div.compact ul, div.compact ol, |
| 263 | div.compact p, div.compact p, |
| 264 | div.compact div, div.compact div { |
| 265 | margin-top: 0.1em; |
| 266 | margin-bottom: 0.1em; |
| 267 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 268 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 269 | tfoot { |
| 270 | font-weight: bold; |
| 271 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 272 | td > div.verse { |
| 273 | white-space: pre; |
| 274 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 275 | |
| 276 | div.hdlist { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 277 | margin-top: 0.8em; |
| 278 | margin-bottom: 0.8em; |
| 279 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 280 | div.hdlist tr { |
| 281 | padding-bottom: 15px; |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 282 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 283 | dt.hdlist1.strong, td.hdlist1.strong { |
| 284 | font-weight: bold; |
| 285 | } |
| 286 | td.hdlist1 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 287 | vertical-align: top; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 288 | font-style: normal; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 289 | padding-right: 0.8em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 290 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 291 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 292 | td.hdlist2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 293 | vertical-align: top; |
| 294 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 295 | div.hdlist.compact tr { |
| 296 | margin: 0; |
| 297 | padding-bottom: 0; |
| 298 | } |
| 299 | |
| 300 | .comment { |
| 301 | background: yellow; |
| 302 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 303 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 304 | .footnote, .footnoteref { |
| 305 | font-size: 0.8em; |
| 306 | } |
| 307 | |
| 308 | span.footnote, span.footnoteref { |
| 309 | vertical-align: super; |
| 310 | } |
| 311 | |
| 312 | #footnotes { |
| 313 | margin: 20px 0 20px 0; |
| 314 | padding: 7px 0 0 0; |
| 315 | } |
| 316 | |
| 317 | #footnotes div.footnote { |
| 318 | margin: 0 0 5px 0; |
| 319 | } |
| 320 | |
| 321 | #footnotes hr { |
| 322 | border: none; |
| 323 | border-top: 1px solid silver; |
| 324 | height: 1px; |
| 325 | text-align: left; |
| 326 | margin-left: 0; |
| 327 | width: 20%; |
| 328 | min-width: 100px; |
| 329 | } |
| 330 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 331 | div.colist td { |
| 332 | padding-right: 0.5em; |
| 333 | padding-bottom: 0.3em; |
| 334 | vertical-align: top; |
| 335 | } |
| 336 | div.colist td img { |
| 337 | margin-top: 0.3em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 338 | } |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 339 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 340 | @media print { |
| 341 | #footer-badges { display: none; } |
| 342 | } |
| 343 | |
| 344 | #toc { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 345 | margin-bottom: 2.5em; |
| 346 | } |
| 347 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 348 | #toctitle { |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 349 | color: #527bbd; |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 350 | font-size: 1.1em; |
| 351 | font-weight: bold; |
| 352 | margin-top: 1.0em; |
| 353 | margin-bottom: 0.1em; |
| 354 | } |
| 355 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 356 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 357 | margin-top: 0; |
| 358 | margin-bottom: 0; |
| 359 | } |
| 360 | div.toclevel2 { |
| 361 | margin-left: 2em; |
| 362 | font-size: 0.9em; |
| 363 | } |
| 364 | div.toclevel3 { |
| 365 | margin-left: 4em; |
| 366 | font-size: 0.9em; |
| 367 | } |
| 368 | div.toclevel4 { |
| 369 | margin-left: 6em; |
| 370 | font-size: 0.9em; |
| 371 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 372 | |
| 373 | span.aqua { color: aqua; } |
| 374 | span.black { color: black; } |
| 375 | span.blue { color: blue; } |
| 376 | span.fuchsia { color: fuchsia; } |
| 377 | span.gray { color: gray; } |
| 378 | span.green { color: green; } |
| 379 | span.lime { color: lime; } |
| 380 | span.maroon { color: maroon; } |
| 381 | span.navy { color: navy; } |
| 382 | span.olive { color: olive; } |
| 383 | span.purple { color: purple; } |
| 384 | span.red { color: red; } |
| 385 | span.silver { color: silver; } |
| 386 | span.teal { color: teal; } |
| 387 | span.white { color: white; } |
| 388 | span.yellow { color: yellow; } |
| 389 | |
| 390 | span.aqua-background { background: aqua; } |
| 391 | span.black-background { background: black; } |
| 392 | span.blue-background { background: blue; } |
| 393 | span.fuchsia-background { background: fuchsia; } |
| 394 | span.gray-background { background: gray; } |
| 395 | span.green-background { background: green; } |
| 396 | span.lime-background { background: lime; } |
| 397 | span.maroon-background { background: maroon; } |
| 398 | span.navy-background { background: navy; } |
| 399 | span.olive-background { background: olive; } |
| 400 | span.purple-background { background: purple; } |
| 401 | span.red-background { background: red; } |
| 402 | span.silver-background { background: silver; } |
| 403 | span.teal-background { background: teal; } |
| 404 | span.white-background { background: white; } |
| 405 | span.yellow-background { background: yellow; } |
| 406 | |
| 407 | span.big { font-size: 2em; } |
| 408 | span.small { font-size: 0.6em; } |
| 409 | |
| 410 | span.underline { text-decoration: underline; } |
| 411 | span.overline { text-decoration: overline; } |
| 412 | span.line-through { text-decoration: line-through; } |
| 413 | |
| 414 | div.unbreakable { page-break-inside: avoid; } |
| 415 | |
| 416 | |
| 417 | /* |
| 418 | * xhtml11 specific |
| 419 | * |
| 420 | * */ |
| 421 | |
| 422 | div.tableblock { |
| 423 | margin-top: 1.0em; |
| 424 | margin-bottom: 1.5em; |
| 425 | } |
| 426 | div.tableblock > table { |
| 427 | border: 3px solid #527bbd; |
| 428 | } |
| 429 | thead, p.table.header { |
| 430 | font-weight: bold; |
| 431 | color: #527bbd; |
| 432 | } |
| 433 | p.table { |
| 434 | margin-top: 0; |
| 435 | } |
| 436 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 437 | div.tableblock > table[frame="void"] { |
| 438 | border-style: none; |
| 439 | } |
| 440 | div.tableblock > table[frame="hsides"] { |
| 441 | border-left-style: none; |
| 442 | border-right-style: none; |
| 443 | } |
| 444 | div.tableblock > table[frame="vsides"] { |
| 445 | border-top-style: none; |
| 446 | border-bottom-style: none; |
| 447 | } |
| 448 | |
| 449 | |
| 450 | /* |
| 451 | * html5 specific |
| 452 | * |
| 453 | * */ |
| 454 | |
| 455 | table.tableblock { |
| 456 | margin-top: 1.0em; |
| 457 | margin-bottom: 1.5em; |
| 458 | } |
| 459 | thead, p.tableblock.header { |
| 460 | font-weight: bold; |
| 461 | color: #527bbd; |
| 462 | } |
| 463 | p.tableblock { |
| 464 | margin-top: 0; |
| 465 | } |
| 466 | table.tableblock { |
| 467 | border-width: 3px; |
| 468 | border-spacing: 0px; |
| 469 | border-style: solid; |
| 470 | border-color: #527bbd; |
| 471 | border-collapse: collapse; |
| 472 | } |
| 473 | th.tableblock, td.tableblock { |
| 474 | border-width: 1px; |
| 475 | padding: 4px; |
| 476 | border-style: solid; |
| 477 | border-color: #527bbd; |
| 478 | } |
| 479 | |
| 480 | table.tableblock.frame-topbot { |
| 481 | border-left-style: hidden; |
| 482 | border-right-style: hidden; |
| 483 | } |
| 484 | table.tableblock.frame-sides { |
| 485 | border-top-style: hidden; |
| 486 | border-bottom-style: hidden; |
| 487 | } |
| 488 | table.tableblock.frame-none { |
| 489 | border-style: hidden; |
| 490 | } |
| 491 | |
| 492 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 493 | text-align: left; |
| 494 | } |
| 495 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 496 | text-align: center; |
| 497 | } |
| 498 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 499 | text-align: right; |
| 500 | } |
| 501 | |
| 502 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 503 | vertical-align: top; |
| 504 | } |
| 505 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 506 | vertical-align: middle; |
| 507 | } |
| 508 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 509 | vertical-align: bottom; |
| 510 | } |
| 511 | |
| 512 | |
| 513 | /* |
| 514 | * manpage specific |
| 515 | * |
| 516 | * */ |
| 517 | |
| 518 | body.manpage h1 { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 519 | padding-top: 0.5em; |
| 520 | padding-bottom: 0.5em; |
| 521 | border-top: 2px solid silver; |
| 522 | border-bottom: 2px solid silver; |
| 523 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 524 | body.manpage h2 { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 525 | border-style: none; |
| 526 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 527 | body.manpage div.sectionbody { |
| 528 | margin-left: 3em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 529 | } |
| 530 | |
| 531 | @media print { |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 532 | body.manpage div#toc { display: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 533 | } |
| 534 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 535 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 536 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 537 | <script type="text/javascript"> |
| 538 | /*<![CDATA[*/ |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 539 | var asciidoc = { // Namespace. |
| 540 | |
| 541 | ///////////////////////////////////////////////////////////////////// |
| 542 | // Table Of Contents generator |
| 543 | ///////////////////////////////////////////////////////////////////// |
| 544 | |
| 545 | /* Author: Mihai Bazon, September 2002 |
| 546 | * http://students.infoiasi.ro/~mishoo |
| 547 | * |
| 548 | * Table Of Content generator |
| 549 | * Version: 0.4 |
| 550 | * |
| 551 | * Feel free to use this script under the terms of the GNU General Public |
| 552 | * License, as long as you do not remove or alter this notice. |
| 553 | */ |
| 554 | |
| 555 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 556 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 557 | |
| 558 | // toclevels = 1..4. |
| 559 | toc: function (toclevels) { |
| 560 | |
| 561 | function getText(el) { |
| 562 | var text = ""; |
| 563 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 564 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 565 | text += i.data; |
| 566 | else if (i.firstChild != null) |
| 567 | text += getText(i); |
| 568 | } |
| 569 | return text; |
| 570 | } |
| 571 | |
| 572 | function TocEntry(el, text, toclevel) { |
| 573 | this.element = el; |
| 574 | this.text = text; |
| 575 | this.toclevel = toclevel; |
| 576 | } |
| 577 | |
| 578 | function tocEntries(el, toclevels) { |
| 579 | var result = new Array; |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 580 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 581 | // Function that scans the DOM tree for header elements (the DOM2 |
| 582 | // nodeIterator API would be a better technique but not supported by all |
| 583 | // browsers). |
| 584 | var iterate = function (el) { |
| 585 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 586 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 587 | var mo = re.exec(i.tagName); |
| 588 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 589 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 590 | } |
| 591 | iterate(i); |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | iterate(el); |
| 596 | return result; |
| 597 | } |
| 598 | |
| 599 | var toc = document.getElementById("toc"); |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 600 | if (!toc) { |
| 601 | return; |
| 602 | } |
| 603 | |
| 604 | // Delete existing TOC entries in case we're reloading the TOC. |
| 605 | var tocEntriesToRemove = []; |
| 606 | var i; |
| 607 | for (i = 0; i < toc.childNodes.length; i++) { |
| 608 | var entry = toc.childNodes[i]; |
| 609 | if (entry.nodeName.toLowerCase() == 'div' |
| 610 | && entry.getAttribute("class") |
| 611 | && entry.getAttribute("class").match(/^toclevel/)) |
| 612 | tocEntriesToRemove.push(entry); |
| 613 | } |
| 614 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 615 | toc.removeChild(tocEntriesToRemove[i]); |
| 616 | } |
| 617 | |
| 618 | // Rebuild TOC entries. |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 619 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 620 | for (var i = 0; i < entries.length; ++i) { |
| 621 | var entry = entries[i]; |
| 622 | if (entry.element.id == "") |
| 623 | entry.element.id = "_toc_" + i; |
| 624 | var a = document.createElement("a"); |
| 625 | a.href = "#" + entry.element.id; |
| 626 | a.appendChild(document.createTextNode(entry.text)); |
| 627 | var div = document.createElement("div"); |
| 628 | div.appendChild(a); |
| 629 | div.className = "toclevel" + entry.toclevel; |
| 630 | toc.appendChild(div); |
| 631 | } |
| 632 | if (entries.length == 0) |
| 633 | toc.parentNode.removeChild(toc); |
| 634 | }, |
| 635 | |
| 636 | |
| 637 | ///////////////////////////////////////////////////////////////////// |
| 638 | // Footnotes generator |
| 639 | ///////////////////////////////////////////////////////////////////// |
| 640 | |
| 641 | /* Based on footnote generation code from: |
| 642 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 643 | */ |
| 644 | |
| 645 | footnotes: function () { |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 646 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 647 | var i; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 648 | var noteholder = document.getElementById("footnotes"); |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 649 | if (!noteholder) { |
| 650 | return; |
| 651 | } |
| 652 | var entriesToRemove = []; |
| 653 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 654 | var entry = noteholder.childNodes[i]; |
| 655 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
| 656 | entriesToRemove.push(entry); |
| 657 | } |
| 658 | for (i = 0; i < entriesToRemove.length; i++) { |
| 659 | noteholder.removeChild(entriesToRemove[i]); |
| 660 | } |
| 661 | |
| 662 | // Rebuild footnote entries. |
| 663 | var cont = document.getElementById("content"); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 664 | var spans = cont.getElementsByTagName("span"); |
| 665 | var refs = {}; |
| 666 | var n = 0; |
| 667 | for (i=0; i<spans.length; i++) { |
| 668 | if (spans[i].className == "footnote") { |
| 669 | n++; |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 670 | var note = spans[i].getAttribute("data-note"); |
| 671 | if (!note) { |
| 672 | // Use [\s\S] in place of . so multi-line matches work. |
| 673 | // Because JavaScript has no s (dotall) regex flag. |
| 674 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 675 | spans[i].innerHTML = |
| 676 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 677 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 678 | spans[i].setAttribute("data-note", note); |
| 679 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 680 | noteholder.innerHTML += |
| 681 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 682 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 683 | n + "</a>. " + note + "</div>"; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 684 | var id =spans[i].getAttribute("id"); |
| 685 | if (id != null) refs["#"+id] = n; |
| 686 | } |
| 687 | } |
| 688 | if (n == 0) |
| 689 | noteholder.parentNode.removeChild(noteholder); |
| 690 | else { |
| 691 | // Process footnoterefs. |
| 692 | for (i=0; i<spans.length; i++) { |
| 693 | if (spans[i].className == "footnoteref") { |
| 694 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 695 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 696 | n = refs[href]; |
| 697 | spans[i].innerHTML = |
| 698 | "[<a href='#_footnote_" + n + |
| 699 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 700 | } |
| 701 | } |
| 702 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 703 | }, |
| 704 | |
| 705 | install: function(toclevels) { |
| 706 | var timerId; |
| 707 | |
| 708 | function reinstall() { |
| 709 | asciidoc.footnotes(); |
| 710 | if (toclevels) { |
| 711 | asciidoc.toc(toclevels); |
| 712 | } |
| 713 | } |
| 714 | |
| 715 | function reinstallAndRemoveTimer() { |
| 716 | clearInterval(timerId); |
| 717 | reinstall(); |
| 718 | } |
| 719 | |
| 720 | timerId = setInterval(reinstall, 500); |
| 721 | if (document.addEventListener) |
| 722 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 723 | else |
| 724 | window.onload = reinstallAndRemoveTimer; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 725 | } |
| 726 | |
| 727 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 728 | asciidoc.install(); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 729 | /*]]>*/ |
| 730 | </script> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 731 | </head> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 732 | <body class="manpage"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 733 | <div id="header"> |
| 734 | <h1> |
| 735 | git-diff(1) Manual Page |
| 736 | </h1> |
| 737 | <h2>NAME</h2> |
| 738 | <div class="sectionbody"> |
| 739 | <p>git-diff - |
Junio C Hamano | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 740 | Show changes between commits, commit and working tree, etc |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 741 | </p> |
| 742 | </div> |
| 743 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 744 | <div id="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 745 | <div class="sect1"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 746 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 747 | <div class="sectionbody"> |
Junio C Hamano | 2e6ded8 | 2010-12-05 06:20:48 | [diff] [blame] | 748 | <div class="verseblock"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 749 | <pre class="content"><em>git diff</em> [options] [<commit>] [--] [<path>…] |
Junio C Hamano | 2e6ded8 | 2010-12-05 06:20:48 | [diff] [blame] | 750 | <em>git diff</em> [options] --cached [<commit>] [--] [<path>…] |
| 751 | <em>git diff</em> [options] <commit> <commit> [--] [<path>…] |
Junio C Hamano | db81b99 | 2012-12-21 23:49:12 | [diff] [blame] | 752 | <em>git diff</em> [options] <blob> <blob> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 753 | <em>git diff</em> [options] [--no-index] [--] <path> <path></pre> |
| 754 | <div class="attribution"> |
Junio C Hamano | 2e6ded8 | 2010-12-05 06:20:48 | [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 | 0868a30 | 2008-07-22 09:20:44 | [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 | 2e6ded8 | 2010-12-05 06:20:48 | [diff] [blame] | 761 | <div class="paragraph"><p>Show changes between the working tree and the index or a tree, changes |
| 762 | between the index and a tree, changes between two trees, or changes |
| 763 | between two files on disk.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 764 | <div class="dlist"><dl> |
| 765 | <dt class="hdlist1"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 766 | <em>git diff</em> [--options] [--] [<path>…] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 767 | </dt> |
| 768 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 769 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 770 | This form is to view the changes you made relative to |
| 771 | the index (staging area for the next commit). In other |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 772 | words, the differences are what you <em>could</em> tell git to |
| 773 | further add to the index but you still haven’t. You can |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 774 | stage these changes by using <a href="git-add.html">git-add(1)</a>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 775 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 776 | <div class="paragraph"><p>If exactly two paths are given and at least one points outside |
Junio C Hamano | c27b733 | 2010-10-14 04:37:28 | [diff] [blame] | 777 | the current repository, <em>git diff</em> will compare the two files / |
| 778 | directories. This behavior can be forced by --no-index.</p></div> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 779 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 780 | <dt class="hdlist1"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 781 | <em>git diff</em> [--options] --cached [<commit>] [--] [<path>…] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 782 | </dt> |
| 783 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 784 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 785 | This form is to view the changes you staged for the next |
Junio C Hamano | 4bf6dca | 2006-12-21 02:25:57 | [diff] [blame] | 786 | commit relative to the named <commit>. Typically you |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 787 | would want comparison with the latest commit, so if you |
| 788 | do not give <commit>, it defaults to HEAD. |
Junio C Hamano | e611683 | 2011-02-08 00:49:45 | [diff] [blame] | 789 | If HEAD does not exist (e.g. unborned branches) and |
| 790 | <commit> is not given, it shows all staged changes. |
Junio C Hamano | 8b4977b | 2008-11-12 04:57:48 | [diff] [blame] | 791 | --staged is a synonym of --cached. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 792 | </p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 793 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 794 | <dt class="hdlist1"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 795 | <em>git diff</em> [--options] <commit> [--] [<path>…] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 796 | </dt> |
| 797 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 798 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 799 | This form is to view the changes you have in your |
| 800 | working tree relative to the named <commit>. You can |
| 801 | use HEAD to compare it with the latest commit, or a |
| 802 | branch name to compare with the tip of a different |
| 803 | branch. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 804 | </p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 805 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 806 | <dt class="hdlist1"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 807 | <em>git diff</em> [--options] <commit> <commit> [--] [<path>…] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 808 | </dt> |
| 809 | <dd> |
| 810 | <p> |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 811 | This is to view the changes between two arbitrary |
| 812 | <commit>. |
| 813 | </p> |
| 814 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 815 | <dt class="hdlist1"> |
Junio C Hamano | db81b99 | 2012-12-21 23:49:12 | [diff] [blame] | 816 | <em>git diff</em> [options] <blob> <blob> |
| 817 | </dt> |
| 818 | <dd> |
| 819 | <p> |
| 820 | This form is to view the differences between the raw |
| 821 | contents of two blob objects. |
| 822 | </p> |
| 823 | </dd> |
| 824 | <dt class="hdlist1"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 825 | <em>git diff</em> [--options] <commit>..<commit> [--] [<path>…] |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 826 | </dt> |
| 827 | <dd> |
| 828 | <p> |
| 829 | This is synonymous to the previous form. If <commit> on |
| 830 | one side is omitted, it will have the same effect as |
| 831 | using HEAD instead. |
| 832 | </p> |
| 833 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 834 | <dt class="hdlist1"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 835 | <em>git diff</em> [--options] <commit>...<commit> [--] [<path>…] |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 836 | </dt> |
| 837 | <dd> |
| 838 | <p> |
| 839 | This form is to view the changes on the branch containing |
| 840 | and up to the second <commit>, starting at a common ancestor |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 841 | of both <commit>. "git diff A...B" is equivalent to |
| 842 | "git diff $(git-merge-base A B) B". You can omit any one |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 843 | of <commit>, which has the same effect as using HEAD instead. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 844 | </p> |
| 845 | </dd> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 846 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 847 | <div class="paragraph"><p>Just in case if you are doing something exotic, it should be |
Junio C Hamano | 7d9e9bd | 2007-08-29 07:31:47 | [diff] [blame] | 848 | noted that all of the <commit> in the above description, except |
Junio C Hamano | c27b733 | 2010-10-14 04:37:28 | [diff] [blame] | 849 | in the last two forms that use ".." notations, can be any |
Junio C Hamano | db81b99 | 2012-12-21 23:49:12 | [diff] [blame] | 850 | <tree>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 851 | <div class="paragraph"><p>For a more complete list of ways to spell <commit>, see |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 852 | "SPECIFYING REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>. |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 853 | However, "diff" is about comparing two <em>endpoints</em>, not ranges, |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 854 | and the range notations ("<commit>..<commit>" and |
Junio C Hamano | 7d9e9bd | 2007-08-29 07:31:47 | [diff] [blame] | 855 | "<commit>...<commit>") do not mean a range as defined in the |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 856 | "SPECIFYING RANGES" section in <a href="gitrevisions.html">gitrevisions(7)</a>.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 857 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 858 | </div> |
| 859 | <div class="sect1"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 860 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 861 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 862 | <div class="dlist"><dl> |
| 863 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 864 | -p |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 865 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 866 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 867 | -u |
| 868 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 869 | <dt class="hdlist1"> |
Junio C Hamano | e97d577 | 2010-05-19 08:13:58 | [diff] [blame] | 870 | --patch |
| 871 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 872 | <dd> |
| 873 | <p> |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 874 | Generate patch (see section on generating patches). |
| 875 | This is the default. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 876 | </p> |
| 877 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 878 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 879 | -U<n> |
| 880 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 881 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 882 | --unified=<n> |
| 883 | </dt> |
| 884 | <dd> |
| 885 | <p> |
| 886 | Generate diffs with <n> lines of context instead of |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 887 | the usual three. |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 888 | Implies <code>-p</code>. |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 889 | </p> |
| 890 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 891 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 892 | --raw |
| 893 | </dt> |
| 894 | <dd> |
| 895 | <p> |
| 896 | Generate the raw format. |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 897 | |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 898 | </p> |
| 899 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 900 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 901 | --patch-with-raw |
| 902 | </dt> |
| 903 | <dd> |
| 904 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 905 | Synonym for <code>-p --raw</code>. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 906 | </p> |
| 907 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 908 | <dt class="hdlist1"> |
Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame] | 909 | --minimal |
| 910 | </dt> |
| 911 | <dd> |
| 912 | <p> |
| 913 | Spend extra time to make sure the smallest possible |
| 914 | diff is produced. |
| 915 | </p> |
| 916 | </dd> |
| 917 | <dt class="hdlist1"> |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 918 | --patience |
| 919 | </dt> |
| 920 | <dd> |
| 921 | <p> |
| 922 | Generate a diff using the "patience diff" algorithm. |
| 923 | </p> |
| 924 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 925 | <dt class="hdlist1"> |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 926 | --histogram |
| 927 | </dt> |
| 928 | <dd> |
| 929 | <p> |
| 930 | Generate a diff using the "histogram diff" algorithm. |
| 931 | </p> |
| 932 | </dd> |
| 933 | <dt class="hdlist1"> |
Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 934 | --stat[=<width>[,<name-width>[,<count>]]] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 935 | </dt> |
| 936 | <dd> |
| 937 | <p> |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 938 | Generate a diffstat. By default, as much space as necessary |
| 939 | will be used for the filename part, and the rest for the graph |
| 940 | part. Maximum width defaults to terminal width, or 80 columns |
Junio C Hamano | 7f2b3cb | 2012-06-22 22:42:39 | [diff] [blame] | 941 | if not connected to a terminal, and can be overridden by |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 942 | <code><width></code>. The width of the filename part can be limited by |
| 943 | giving another width <code><name-width></code> after a comma. The width |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 944 | of the graph part can be limited by using |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 945 | <code>--stat-graph-width=<width></code> (affects all commands generating |
| 946 | a stat graph) or by setting <code>diff.statGraphWidth=<width></code> |
| 947 | (does not affect <code>git format-patch</code>). |
| 948 | By giving a third parameter <code><count></code>, you can limit the |
| 949 | 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] | 950 | there are more. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 951 | </p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 952 | <div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=<width></code>, |
| 953 | <code>--stat-name-width=<name-width></code> and <code>--stat-count=<count></code>.</p></div> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 954 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 955 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 956 | --numstat |
| 957 | </dt> |
| 958 | <dd> |
| 959 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 960 | Similar to <code>--stat</code>, but shows number of added and |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 961 | deleted lines in decimal notation and pathname without |
Junio C Hamano | d793de5 | 2006-12-26 09:11:43 | [diff] [blame] | 962 | abbreviation, to make it more machine friendly. For |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 963 | binary files, outputs two <code>-</code> instead of saying |
| 964 | <code>0 0</code>. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 965 | </p> |
| 966 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 967 | <dt class="hdlist1"> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 968 | --shortstat |
| 969 | </dt> |
| 970 | <dd> |
| 971 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 972 | 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] | 973 | number of modified files, as well as number of added and deleted |
| 974 | lines. |
| 975 | </p> |
| 976 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 977 | <dt class="hdlist1"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 978 | --dirstat[=<param1,param2,…>] |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 979 | </dt> |
| 980 | <dd> |
| 981 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 982 | Output the distribution of relative amount of changes for each |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 983 | sub-directory. The behavior of <code>--dirstat</code> can be customized by |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 984 | passing it a comma separated list of parameters. |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 985 | The defaults are controlled by the <code>diff.dirstat</code> configuration |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 986 | variable (see <a href="git-config.html">git-config(1)</a>). |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 987 | The following parameters are available: |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 988 | </p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 989 | <div class="openblock"> |
| 990 | <div class="content"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 991 | <div class="dlist"><dl> |
| 992 | <dt class="hdlist1"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 993 | <code>changes</code> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 994 | </dt> |
| 995 | <dd> |
| 996 | <p> |
| 997 | Compute the dirstat numbers by counting the lines that have been |
| 998 | removed from the source, or added to the destination. This ignores |
| 999 | the amount of pure code movements within a file. In other words, |
| 1000 | rearranging lines in a file is not counted as much as other changes. |
| 1001 | This is the default behavior when no parameter is given. |
| 1002 | </p> |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 1003 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1004 | <dt class="hdlist1"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1005 | <code>lines</code> |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 1006 | </dt> |
| 1007 | <dd> |
| 1008 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1009 | Compute the dirstat numbers by doing the regular line-based diff |
| 1010 | analysis, and summing the removed/added line counts. (For binary |
| 1011 | files, count 64-byte chunks instead, since binary files have no |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1012 | natural concept of lines). This is a more expensive <code>--dirstat</code> |
| 1013 | behavior than the <code>changes</code> behavior, but it does count rearranged |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1014 | lines within a file as much as other changes. The resulting output |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1015 | 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] | 1016 | </p> |
| 1017 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1018 | <dt class="hdlist1"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1019 | <code>files</code> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1020 | </dt> |
| 1021 | <dd> |
| 1022 | <p> |
| 1023 | Compute the dirstat numbers by counting the number of files changed. |
| 1024 | Each changed file counts equally in the dirstat analysis. This is |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1025 | the computationally cheapest <code>--dirstat</code> behavior, since it does |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1026 | not have to look at the file contents at all. |
| 1027 | </p> |
| 1028 | </dd> |
| 1029 | <dt class="hdlist1"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1030 | <code>cumulative</code> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1031 | </dt> |
| 1032 | <dd> |
| 1033 | <p> |
| 1034 | Count changes in a child directory for the parent directory as well. |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1035 | Note that when using <code>cumulative</code>, the sum of the percentages |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1036 | reported may exceed 100%. The default (non-cumulative) behavior can |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1037 | be specified with the <code>noncumulative</code> parameter. |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1038 | </p> |
| 1039 | </dd> |
| 1040 | <dt class="hdlist1"> |
| 1041 | <limit> |
| 1042 | </dt> |
| 1043 | <dd> |
| 1044 | <p> |
| 1045 | An integer parameter specifies a cut-off percent (3% by default). |
| 1046 | Directories contributing less than this percentage of the changes |
| 1047 | are not shown in the output. |
| 1048 | </p> |
| 1049 | </dd> |
| 1050 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1051 | </div></div> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1052 | <div class="paragraph"><p>Example: The following will count changed files, while ignoring |
| 1053 | directories with less than 10% of the total amount of changed files, |
| 1054 | and accumulating child directory counts in the parent directories: |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1055 | <code>--dirstat=files,10,cumulative</code>.</p></div> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1056 | </dd> |
| 1057 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1058 | --summary |
| 1059 | </dt> |
| 1060 | <dd> |
| 1061 | <p> |
| 1062 | Output a condensed summary of extended header information |
| 1063 | such as creations, renames and mode changes. |
| 1064 | </p> |
| 1065 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1066 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1067 | --patch-with-stat |
| 1068 | </dt> |
| 1069 | <dd> |
| 1070 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1071 | Synonym for <code>-p --stat</code>. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1072 | </p> |
| 1073 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1074 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1075 | -z |
| 1076 | </dt> |
| 1077 | <dd> |
| 1078 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1079 | 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] | 1080 | given, do not munge pathnames and use NULs as output field terminators. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1081 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1082 | <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes, |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1083 | 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] | 1084 | respectively, and the pathname will be enclosed in double quotes if |
| 1085 | any of those replacements occurred.</p></div> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1086 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1087 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1088 | --name-only |
| 1089 | </dt> |
| 1090 | <dd> |
| 1091 | <p> |
| 1092 | Show only names of changed files. |
| 1093 | </p> |
| 1094 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1095 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1096 | --name-status |
| 1097 | </dt> |
| 1098 | <dd> |
| 1099 | <p> |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 1100 | Show only names and status of changed files. See the description |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1101 | of the <code>--diff-filter</code> option on what the status letters mean. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1102 | </p> |
| 1103 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1104 | <dt class="hdlist1"> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1105 | --submodule[=<format>] |
| 1106 | </dt> |
| 1107 | <dd> |
| 1108 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1109 | Specify how differences in submodules are shown. When <code>--submodule</code> |
| 1110 | or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists |
| 1111 | the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. |
| 1112 | Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>, |
Junio C Hamano | e768cc1 | 2012-03-16 05:43:05 | [diff] [blame] | 1113 | 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] | 1114 | at the beginning and end of the range. Can be tweaked via the |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1115 | <code>diff.submodule</code> configuration variable. |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1116 | </p> |
| 1117 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1118 | <dt class="hdlist1"> |
Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [diff] [blame] | 1119 | --color[=<when>] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1120 | </dt> |
| 1121 | <dd> |
| 1122 | <p> |
| 1123 | Show colored diff. |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1124 | The value must be <code>always</code> (the default for <code><when></code>), <code>never</code>, or <code>auto</code>. |
| 1125 | The default value is <code>never</code>. |
| 1126 | It can be changed by the <code>color.ui</code> and <code>color.diff</code> |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 1127 | configuration settings. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1128 | </p> |
| 1129 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1130 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1131 | --no-color |
| 1132 | </dt> |
| 1133 | <dd> |
| 1134 | <p> |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 1135 | Turn off colored diff. |
| 1136 | This can be used to override configuration settings. |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1137 | It is the same as <code>--color=never</code>. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1138 | </p> |
| 1139 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1140 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1141 | --word-diff[=<mode>] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1142 | </dt> |
| 1143 | <dd> |
| 1144 | <p> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1145 | Show a word diff, using the <mode> to delimit changed words. |
| 1146 | By default, words are delimited by whitespace; see |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1147 | <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] | 1148 | must be one of: |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1149 | </p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1150 | <div class="openblock"> |
| 1151 | <div class="content"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1152 | <div class="dlist"><dl> |
| 1153 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1154 | color |
| 1155 | </dt> |
| 1156 | <dd> |
| 1157 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1158 | Highlight changed words using only colors. Implies <code>--color</code>. |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1159 | </p> |
| 1160 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1161 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1162 | plain |
| 1163 | </dt> |
| 1164 | <dd> |
| 1165 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1166 | Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1167 | attempts to escape the delimiters if they appear in the input, |
| 1168 | so the output may be ambiguous. |
| 1169 | </p> |
| 1170 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1171 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1172 | porcelain |
| 1173 | </dt> |
| 1174 | <dd> |
| 1175 | <p> |
| 1176 | Use a special line-based format intended for script |
| 1177 | consumption. Added/removed/unchanged runs are printed in the |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1178 | usual unified diff format, starting with a <code>+</code>/<code>-</code>/` ` |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1179 | character at the beginning of the line and extending to the |
| 1180 | end of the line. Newlines in the input are represented by a |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1181 | tilde <code>~</code> on a line of its own. |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1182 | </p> |
| 1183 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1184 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1185 | none |
| 1186 | </dt> |
| 1187 | <dd> |
| 1188 | <p> |
| 1189 | Disable word diff again. |
| 1190 | </p> |
| 1191 | </dd> |
| 1192 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1193 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1194 | <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] | 1195 | highlight the changed parts in all modes if enabled.</p></div> |
| 1196 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1197 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1198 | --word-diff-regex=<regex> |
| 1199 | </dt> |
| 1200 | <dd> |
| 1201 | <p> |
| 1202 | Use <regex> to decide what a word is, instead of considering |
| 1203 | runs of non-whitespace to be a word. Also implies |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1204 | <code>--word-diff</code> unless it was already enabled. |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1205 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1206 | <div class="paragraph"><p>Every non-overlapping match of the |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 1207 | <regex> is considered a word. Anything between these matches is |
| 1208 | considered whitespace and ignored(!) for the purposes of finding |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1209 | differences. You may want to append <code>|[^[:space:]]</code> to your regular |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 1210 | expression to make sure that it matches all non-whitespace characters. |
| 1211 | A match that contains a newline is silently truncated(!) at the |
| 1212 | newline.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1213 | <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1214 | <a href="gitattributes.html">gitattributes(1)</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] | 1215 | overrides any diff driver or configuration setting. Diff drivers |
| 1216 | override configuration settings.</p></div> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1217 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1218 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1219 | --color-words[=<regex>] |
| 1220 | </dt> |
| 1221 | <dd> |
| 1222 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1223 | Equivalent to <code>--word-diff=color</code> plus (if a regex was |
| 1224 | specified) <code>--word-diff-regex=<regex></code>. |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1225 | </p> |
| 1226 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1227 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1228 | --no-renames |
| 1229 | </dt> |
| 1230 | <dd> |
| 1231 | <p> |
| 1232 | Turn off rename detection, even when the configuration |
| 1233 | file gives the default to do so. |
| 1234 | </p> |
| 1235 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1236 | <dt class="hdlist1"> |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 1237 | --check |
| 1238 | </dt> |
| 1239 | <dd> |
| 1240 | <p> |
Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 1241 | Warn if changes introduce whitespace errors. What are |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1242 | considered whitespace errors is controlled by <code>core.whitespace</code> |
Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 1243 | configuration. By default, trailing whitespaces (including |
| 1244 | lines that solely consist of whitespaces) and a space character |
| 1245 | that is immediately followed by a tab character inside the |
| 1246 | initial indent of the line are considered whitespace errors. |
| 1247 | Exits with non-zero status if problems are found. Not compatible |
| 1248 | with --exit-code. |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 1249 | </p> |
| 1250 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1251 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1252 | --full-index |
| 1253 | </dt> |
| 1254 | <dd> |
| 1255 | <p> |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 1256 | Instead of the first handful of characters, show the full |
| 1257 | pre- and post-image blob object names on the "index" |
| 1258 | line when generating patch format output. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1259 | </p> |
| 1260 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1261 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1262 | --binary |
| 1263 | </dt> |
| 1264 | <dd> |
| 1265 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1266 | In addition to <code>--full-index</code>, output a binary diff that |
| 1267 | can be applied with <code>git-apply</code>. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1268 | </p> |
| 1269 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1270 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1271 | --abbrev[=<n>] |
| 1272 | </dt> |
| 1273 | <dd> |
| 1274 | <p> |
| 1275 | Instead of showing the full 40-byte hexadecimal object |
| 1276 | name in diff-raw format output and diff-tree header |
Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 1277 | lines, show only a partial prefix. This is |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1278 | independent of the <code>--full-index</code> option above, which controls |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1279 | the diff-patch output format. Non default number of |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1280 | digits can be specified with <code>--abbrev=<n></code>. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1281 | </p> |
| 1282 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1283 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1284 | -B[<n>][/<m>] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1285 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1286 | <dt class="hdlist1"> |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1287 | --break-rewrites[=[<n>][/<m>]] |
| 1288 | </dt> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1289 | <dd> |
| 1290 | <p> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1291 | Break complete rewrite changes into pairs of delete and |
| 1292 | create. This serves two purposes: |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1293 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1294 | <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] | 1295 | not as a series of deletion and insertion mixed together with a very |
| 1296 | few lines that happen to match textually as the context, but as a |
| 1297 | single deletion of everything old followed by a single insertion of |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1298 | everything new, and the number <code>m</code> controls this aspect of the -B |
| 1299 | option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1300 | original should remain in the result for git to consider it a total |
| 1301 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 1302 | deletion and insertion mixed together with context lines).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1303 | <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] | 1304 | source of a rename (usually -M only considers a file that disappeared |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1305 | as the source of a rename), and the number <code>n</code> controls this aspect of |
| 1306 | 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] | 1307 | 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] | 1308 | eligible for being picked up as a possible source of a rename to |
| 1309 | another file.</p></div> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1310 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1311 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1312 | -M[<n>] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1313 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1314 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1315 | --find-renames[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1316 | </dt> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1317 | <dd> |
| 1318 | <p> |
| 1319 | Detect renames. |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1320 | 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] | 1321 | index (i.e. amount of addition/deletions compared to the |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1322 | 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] | 1323 | delete/add pair to be a rename if more than 90% of the file |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1324 | hasn’t changed. Without a <code>%</code> sign, the number is to be read as |
| 1325 | a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes |
| 1326 | 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is |
| 1327 | the same as <code>-M5%</code>. To limit detection to exact renames, use |
| 1328 | <code>-M100%</code>. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1329 | </p> |
| 1330 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1331 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1332 | -C[<n>] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1333 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1334 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1335 | --find-copies[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1336 | </dt> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1337 | <dd> |
| 1338 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1339 | Detect copies as well as renames. See also <code>--find-copies-harder</code>. |
| 1340 | If <code>n</code> is specified, it has the same meaning as for <code>-M<n></code>. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1341 | </p> |
| 1342 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1343 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1344 | --find-copies-harder |
| 1345 | </dt> |
| 1346 | <dd> |
| 1347 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1348 | For performance reasons, by default, <code>-C</code> option finds copies only |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1349 | if the original file of the copy was modified in the same |
| 1350 | changeset. This flag makes the command |
| 1351 | inspect unmodified files as candidates for the source of |
| 1352 | copy. This is a very expensive operation for large |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 1353 | projects, so use it with caution. Giving more than one |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1354 | <code>-C</code> option has the same effect. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1355 | </p> |
| 1356 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1357 | <dt class="hdlist1"> |
Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1358 | -D |
| 1359 | </dt> |
| 1360 | <dt class="hdlist1"> |
| 1361 | --irreversible-delete |
| 1362 | </dt> |
| 1363 | <dd> |
| 1364 | <p> |
| 1365 | Omit the preimage for deletes, i.e. print only the header but not |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1366 | the diff between the preimage and <code>/dev/null</code>. The resulting patch |
| 1367 | is not meant to be applied with <code>patch</code> nor <code>git apply</code>; this is |
Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1368 | solely for people who want to just concentrate on reviewing the |
| 1369 | text after the change. In addition, the output obviously lack |
| 1370 | enough information to apply such a patch in reverse, even manually, |
| 1371 | hence the name of the option. |
| 1372 | </p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1373 | <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] | 1374 | of a delete/create pair.</p></div> |
| 1375 | </dd> |
| 1376 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1377 | -l<num> |
| 1378 | </dt> |
| 1379 | <dd> |
| 1380 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1381 | The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1382 | is the number of potential rename/copy targets. This |
| 1383 | option prevents rename/copy detection from running if |
| 1384 | the number of rename/copy targets exceeds the specified |
| 1385 | number. |
| 1386 | </p> |
| 1387 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1388 | <dt class="hdlist1"> |
Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1389 | --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] |
| 1390 | </dt> |
| 1391 | <dd> |
| 1392 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1393 | Select only files that are Added (<code>A</code>), Copied (<code>C</code>), |
| 1394 | Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their |
| 1395 | type (i.e. regular file, symlink, submodule, …) changed (<code>T</code>), |
| 1396 | are Unmerged (<code>U</code>), are |
| 1397 | 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] | 1398 | Any combination of the filter characters (including none) can be used. |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1399 | When <code>*</code> (All-or-none) is added to the combination, all |
Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1400 | paths are selected if there is any file that matches |
| 1401 | other criteria in the comparison; if there is no file |
| 1402 | that matches other criteria, nothing is selected. |
| 1403 | </p> |
| 1404 | </dd> |
| 1405 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1406 | -S<string> |
| 1407 | </dt> |
| 1408 | <dd> |
| 1409 | <p> |
Junio C Hamano | 5217a27 | 2009-03-21 00:39:33 | [diff] [blame] | 1410 | Look for differences that introduce or remove an instance of |
| 1411 | <string>. Note that this is different than the string simply |
| 1412 | appearing in diff output; see the <em>pickaxe</em> entry in |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1413 | <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1414 | </p> |
| 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> |
| 1421 | Look for differences whose added or removed line matches |
| 1422 | the given <regex>. |
| 1423 | </p> |
| 1424 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1425 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1426 | --pickaxe-all |
| 1427 | </dt> |
| 1428 | <dd> |
| 1429 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1430 | When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1431 | changeset, not just the files that contain the change |
| 1432 | in <string>. |
| 1433 | </p> |
| 1434 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1435 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1436 | --pickaxe-regex |
| 1437 | </dt> |
| 1438 | <dd> |
| 1439 | <p> |
| 1440 | Make the <string> not a plain string but an extended POSIX |
| 1441 | regex to match. |
| 1442 | </p> |
| 1443 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1444 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1445 | -O<orderfile> |
| 1446 | </dt> |
| 1447 | <dd> |
| 1448 | <p> |
| 1449 | Output the patch in the order specified in the |
| 1450 | <orderfile>, which has one shell glob pattern per line. |
| 1451 | </p> |
| 1452 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1453 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1454 | -R |
| 1455 | </dt> |
| 1456 | <dd> |
| 1457 | <p> |
| 1458 | Swap two inputs; that is, show differences from index or |
| 1459 | on-disk file to tree contents. |
| 1460 | </p> |
| 1461 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1462 | <dt class="hdlist1"> |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1463 | --relative[=<path>] |
| 1464 | </dt> |
| 1465 | <dd> |
| 1466 | <p> |
| 1467 | When run from a subdirectory of the project, it can be |
| 1468 | told to exclude changes outside the directory and show |
| 1469 | pathnames relative to it with this option. When you are |
| 1470 | not in a subdirectory (e.g. in a bare repository), you |
| 1471 | can name which subdirectory to make the output relative |
| 1472 | to by giving a <path> as an argument. |
| 1473 | </p> |
| 1474 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1475 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1476 | -a |
| 1477 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1478 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1479 | --text |
| 1480 | </dt> |
| 1481 | <dd> |
| 1482 | <p> |
| 1483 | Treat all files as text. |
| 1484 | </p> |
| 1485 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1486 | <dt class="hdlist1"> |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 1487 | --ignore-space-at-eol |
| 1488 | </dt> |
| 1489 | <dd> |
| 1490 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1491 | Ignore changes in whitespace at EOL. |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 1492 | </p> |
| 1493 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1494 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1495 | -b |
| 1496 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1497 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1498 | --ignore-space-change |
| 1499 | </dt> |
| 1500 | <dd> |
| 1501 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1502 | Ignore changes in amount of whitespace. This ignores whitespace |
| 1503 | at line end, and considers all other sequences of one or |
| 1504 | more whitespace characters to be equivalent. |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1505 | </p> |
| 1506 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1507 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1508 | -w |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1509 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1510 | <dt class="hdlist1"> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1511 | --ignore-all-space |
| 1512 | </dt> |
| 1513 | <dd> |
| 1514 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1515 | Ignore whitespace when comparing lines. This ignores |
| 1516 | differences even if one line has whitespace where the other |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1517 | line has none. |
| 1518 | </p> |
| 1519 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1520 | <dt class="hdlist1"> |
Junio C Hamano | 1d40ee8 | 2009-01-07 10:14:16 | [diff] [blame] | 1521 | --inter-hunk-context=<lines> |
| 1522 | </dt> |
| 1523 | <dd> |
| 1524 | <p> |
| 1525 | Show the context between diff hunks, up to the specified number |
| 1526 | of lines, thereby fusing hunks that are close to each other. |
| 1527 | </p> |
| 1528 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1529 | <dt class="hdlist1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1530 | -W |
| 1531 | </dt> |
| 1532 | <dt class="hdlist1"> |
| 1533 | --function-context |
| 1534 | </dt> |
| 1535 | <dd> |
| 1536 | <p> |
| 1537 | Show whole surrounding functions of changes. |
| 1538 | </p> |
| 1539 | </dd> |
| 1540 | <dt class="hdlist1"> |
Junio C Hamano | 48fd2f6 | 2007-03-19 02:02:30 | [diff] [blame] | 1541 | --exit-code |
| 1542 | </dt> |
| 1543 | <dd> |
| 1544 | <p> |
| 1545 | Make the program exit with codes similar to diff(1). |
| 1546 | That is, it exits with 1 if there were differences and |
| 1547 | 0 means no differences. |
| 1548 | </p> |
| 1549 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1550 | <dt class="hdlist1"> |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1551 | --quiet |
| 1552 | </dt> |
| 1553 | <dd> |
| 1554 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1555 | Disable all output of the program. Implies <code>--exit-code</code>. |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1556 | </p> |
| 1557 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1558 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1559 | --ext-diff |
| 1560 | </dt> |
| 1561 | <dd> |
| 1562 | <p> |
| 1563 | Allow an external diff helper to be executed. If you set an |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1564 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 1565 | 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] | 1566 | </p> |
| 1567 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1568 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1569 | --no-ext-diff |
| 1570 | </dt> |
| 1571 | <dd> |
| 1572 | <p> |
| 1573 | Disallow external diff drivers. |
| 1574 | </p> |
| 1575 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1576 | <dt class="hdlist1"> |
Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 1577 | --textconv |
| 1578 | </dt> |
| 1579 | <dt class="hdlist1"> |
| 1580 | --no-textconv |
| 1581 | </dt> |
| 1582 | <dd> |
| 1583 | <p> |
| 1584 | Allow (or disallow) external text conversion filters to be run |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1585 | 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] | 1586 | details. Because textconv filters are typically a one-way |
| 1587 | conversion, the resulting diff is suitable for human |
| 1588 | consumption, but cannot be applied. For this reason, textconv |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1589 | filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and |
| 1590 | <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] | 1591 | diff plumbing commands. |
| 1592 | </p> |
| 1593 | </dd> |
| 1594 | <dt class="hdlist1"> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1595 | --ignore-submodules[=<when>] |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 1596 | </dt> |
| 1597 | <dd> |
| 1598 | <p> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1599 | Ignore changes to submodules in the diff generation. <when> can be |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1600 | either "none", "untracked", "dirty" or "all", which is the default |
| 1601 | Using "none" will consider the submodule modified when it either contains |
| 1602 | untracked or modified files or its HEAD differs from the commit recorded |
| 1603 | 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] | 1604 | <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] | 1605 | "untracked" is used submodules are not considered dirty when they only |
| 1606 | contain untracked content (but they are still scanned for modified |
| 1607 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 1608 | only changes to the commits stored in the superproject are shown (this was |
| 1609 | 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] | 1610 | </p> |
| 1611 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1612 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1613 | --src-prefix=<prefix> |
| 1614 | </dt> |
| 1615 | <dd> |
| 1616 | <p> |
| 1617 | Show the given source prefix instead of "a/". |
| 1618 | </p> |
| 1619 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1620 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1621 | --dst-prefix=<prefix> |
| 1622 | </dt> |
| 1623 | <dd> |
| 1624 | <p> |
| 1625 | Show the given destination prefix instead of "b/". |
| 1626 | </p> |
| 1627 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1628 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1629 | --no-prefix |
| 1630 | </dt> |
| 1631 | <dd> |
| 1632 | <p> |
| 1633 | Do not show any source or destination prefix. |
| 1634 | </p> |
| 1635 | </dd> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1636 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1637 | <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] | 1638 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1639 | <div class="dlist"><dl> |
| 1640 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1641 | <path>… |
| 1642 | </dt> |
| 1643 | <dd> |
| 1644 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 1645 | The <paths> parameters, when given, are used to limit |
| 1646 | the diff to the named paths (you can give directory |
| 1647 | names and get diff for all files under them). |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1648 | </p> |
| 1649 | </dd> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1650 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1651 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1652 | </div> |
| 1653 | <div class="sect1"> |
Junio C Hamano | 543f8d6 | 2009-07-29 08:35:21 | [diff] [blame] | 1654 | <h2 id="_raw_output_format">Raw output format</h2> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1655 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1656 | <div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree", |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1657 | "git-diff-files" and "git diff --raw" are very similar.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1658 | <div class="paragraph"><p>These commands all compare two sets of things; what is |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1659 | compared differs:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1660 | <div class="dlist"><dl> |
| 1661 | <dt class="hdlist1"> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1662 | git-diff-index <tree-ish> |
| 1663 | </dt> |
| 1664 | <dd> |
| 1665 | <p> |
| 1666 | compares the <tree-ish> and the files on the filesystem. |
| 1667 | </p> |
| 1668 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1669 | <dt class="hdlist1"> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1670 | git-diff-index --cached <tree-ish> |
| 1671 | </dt> |
| 1672 | <dd> |
| 1673 | <p> |
| 1674 | compares the <tree-ish> and the index. |
| 1675 | </p> |
| 1676 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1677 | <dt class="hdlist1"> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1678 | git-diff-tree [-r] <tree-ish-1> <tree-ish-2> [<pattern>…] |
| 1679 | </dt> |
| 1680 | <dd> |
| 1681 | <p> |
| 1682 | compares the trees named by the two arguments. |
| 1683 | </p> |
| 1684 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1685 | <dt class="hdlist1"> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1686 | git-diff-files [<pattern>…] |
| 1687 | </dt> |
| 1688 | <dd> |
| 1689 | <p> |
| 1690 | compares the index and the files on the filesystem. |
| 1691 | </p> |
| 1692 | </dd> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1693 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1694 | <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] | 1695 | what is being compared. After that, all the commands print one output |
| 1696 | line per changed file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1697 | <div class="paragraph"><p>An output line is formatted this way:</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1698 | <div class="listingblock"> |
| 1699 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1700 | <pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0 |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1701 | copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2 |
| 1702 | rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3 |
| 1703 | create :000000 100644 0000000... 1234567... A file4 |
| 1704 | delete :100644 000000 1234567... 0000000... D file5 |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1705 | unmerged :000000 000000 0000000... 0000000... U file6</code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1706 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1707 | <div class="paragraph"><p>That is, from the left to the right:</p></div> |
| 1708 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1709 | <li> |
| 1710 | <p> |
| 1711 | a colon. |
| 1712 | </p> |
| 1713 | </li> |
| 1714 | <li> |
| 1715 | <p> |
| 1716 | mode for "src"; 000000 if creation or unmerged. |
| 1717 | </p> |
| 1718 | </li> |
| 1719 | <li> |
| 1720 | <p> |
| 1721 | a space. |
| 1722 | </p> |
| 1723 | </li> |
| 1724 | <li> |
| 1725 | <p> |
| 1726 | mode for "dst"; 000000 if deletion or unmerged. |
| 1727 | </p> |
| 1728 | </li> |
| 1729 | <li> |
| 1730 | <p> |
| 1731 | a space. |
| 1732 | </p> |
| 1733 | </li> |
| 1734 | <li> |
| 1735 | <p> |
| 1736 | sha1 for "src"; 0{40} if creation or unmerged. |
| 1737 | </p> |
| 1738 | </li> |
| 1739 | <li> |
| 1740 | <p> |
| 1741 | a space. |
| 1742 | </p> |
| 1743 | </li> |
| 1744 | <li> |
| 1745 | <p> |
| 1746 | sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree". |
| 1747 | </p> |
| 1748 | </li> |
| 1749 | <li> |
| 1750 | <p> |
| 1751 | a space. |
| 1752 | </p> |
| 1753 | </li> |
| 1754 | <li> |
| 1755 | <p> |
| 1756 | status, followed by optional "score" number. |
| 1757 | </p> |
| 1758 | </li> |
| 1759 | <li> |
| 1760 | <p> |
| 1761 | a tab or a NUL when <em>-z</em> option is used. |
| 1762 | </p> |
| 1763 | </li> |
| 1764 | <li> |
| 1765 | <p> |
| 1766 | path for "src" |
| 1767 | </p> |
| 1768 | </li> |
| 1769 | <li> |
| 1770 | <p> |
| 1771 | a tab or a NUL when <em>-z</em> option is used; only exists for C or R. |
| 1772 | </p> |
| 1773 | </li> |
| 1774 | <li> |
| 1775 | <p> |
| 1776 | path for "dst"; only exists for C or R. |
| 1777 | </p> |
| 1778 | </li> |
| 1779 | <li> |
| 1780 | <p> |
| 1781 | an LF or a NUL when <em>-z</em> option is used, to terminate the record. |
| 1782 | </p> |
| 1783 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1784 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1785 | <div class="paragraph"><p>Possible status letters are:</p></div> |
| 1786 | <div class="ulist"><ul> |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1787 | <li> |
| 1788 | <p> |
| 1789 | A: addition of a file |
| 1790 | </p> |
| 1791 | </li> |
| 1792 | <li> |
| 1793 | <p> |
| 1794 | C: copy of a file into a new one |
| 1795 | </p> |
| 1796 | </li> |
| 1797 | <li> |
| 1798 | <p> |
| 1799 | D: deletion of a file |
| 1800 | </p> |
| 1801 | </li> |
| 1802 | <li> |
| 1803 | <p> |
| 1804 | M: modification of the contents or mode of a file |
| 1805 | </p> |
| 1806 | </li> |
| 1807 | <li> |
| 1808 | <p> |
| 1809 | R: renaming of a file |
| 1810 | </p> |
| 1811 | </li> |
| 1812 | <li> |
| 1813 | <p> |
| 1814 | T: change in the type of the file |
| 1815 | </p> |
| 1816 | </li> |
| 1817 | <li> |
| 1818 | <p> |
| 1819 | U: file is unmerged (you must complete the merge before it can |
| 1820 | be committed) |
| 1821 | </p> |
| 1822 | </li> |
| 1823 | <li> |
| 1824 | <p> |
| 1825 | X: "unknown" change type (most probably a bug, please report it) |
| 1826 | </p> |
| 1827 | </li> |
| 1828 | </ul></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1829 | <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] | 1830 | percentage of similarity between the source and target of the move or |
| 1831 | copy), and are the only ones to be so.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1832 | <div class="paragraph"><p><sha1> is shown as all 0’s if a file is new on the filesystem |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1833 | and it is out of sync with the index.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1834 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1835 | <div class="listingblock"> |
| 1836 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1837 | <pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1838 | </div></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1839 | <div class="paragraph"><p>When <code>-z</code> option is not used, TAB, LF, and backslash characters |
| 1840 | in pathnames are represented as <code>\t</code>, <code>\n</code>, and <code>\\</code>, |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1841 | respectively.</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1842 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1843 | </div> |
| 1844 | <div class="sect1"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1845 | <h2 id="_diff_format_for_merges">diff format for merges</h2> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1846 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1847 | <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] | 1848 | can take <em>-c</em> or <em>--cc</em> option |
| 1849 | to generate diff output also for merge commits. The output differs |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1850 | from the format described above in the following way:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1851 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1852 | <li> |
| 1853 | <p> |
| 1854 | there is a colon for each parent |
| 1855 | </p> |
| 1856 | </li> |
| 1857 | <li> |
| 1858 | <p> |
| 1859 | there are more "src" modes and "src" sha1 |
| 1860 | </p> |
| 1861 | </li> |
| 1862 | <li> |
| 1863 | <p> |
| 1864 | status is concatenated status characters for each parent |
| 1865 | </p> |
| 1866 | </li> |
| 1867 | <li> |
| 1868 | <p> |
| 1869 | no optional "score" number |
| 1870 | </p> |
| 1871 | </li> |
| 1872 | <li> |
| 1873 | <p> |
| 1874 | single path, only for "dst" |
| 1875 | </p> |
| 1876 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1877 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1878 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1879 | <div class="listingblock"> |
| 1880 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1881 | <pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1882 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1883 | <div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1884 | all parents.</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1885 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1886 | </div> |
| 1887 | <div class="sect1"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1888 | <h2 id="_generating_patches_with_p">Generating patches with -p</h2> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1889 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1890 | <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] | 1891 | with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or |
| 1892 | "git log" with the "-p" option, they |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1893 | do not produce the output described above; instead they produce a |
| 1894 | patch file. You can customize the creation of such patches via the |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1895 | GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1896 | <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] | 1897 | diff format:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1898 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1899 | <li> |
| 1900 | <p> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1901 | It is preceded with a "git diff" header that looks like this: |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1902 | </p> |
| 1903 | <div class="literalblock"> |
| 1904 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1905 | <pre><code>diff --git a/file1 b/file2</code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1906 | </div></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1907 | <div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1908 | involved. Especially, even for a creation or a deletion, |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1909 | <code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div> |
| 1910 | <div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1911 | name of the source file of the rename/copy and the name of |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1912 | the file that rename/copy produces, respectively.</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1913 | </li> |
| 1914 | <li> |
| 1915 | <p> |
| 1916 | It is followed by one or more extended header lines: |
| 1917 | </p> |
| 1918 | <div class="literalblock"> |
| 1919 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1920 | <pre><code>old mode <mode> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1921 | new mode <mode> |
| 1922 | deleted file mode <mode> |
| 1923 | new file mode <mode> |
| 1924 | copy from <path> |
| 1925 | copy to <path> |
| 1926 | rename from <path> |
| 1927 | rename to <path> |
| 1928 | similarity index <number> |
| 1929 | dissimilarity index <number> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1930 | index <hash>..<hash> <mode></code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1931 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1932 | <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] | 1933 | and file permission bits.</p></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1934 | <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] | 1935 | <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] | 1936 | the dissimilarity index is the percentage of changed lines. It |
| 1937 | is a rounded down integer, followed by a percent sign. The |
| 1938 | similarity index value of 100% is thus reserved for two equal |
| 1939 | files, while 100% dissimilarity means that no line from the old |
| 1940 | file made it into the new one.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1941 | <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] | 1942 | The <mode> is included if the file mode does not change; otherwise, |
| 1943 | separate lines indicate the old and the new mode.</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1944 | </li> |
| 1945 | <li> |
| 1946 | <p> |
| 1947 | TAB, LF, double quote and backslash characters in pathnames |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1948 | are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively. |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1949 | If there is need for such substitution then the whole |
| 1950 | pathname is put in double quotes. |
| 1951 | </p> |
| 1952 | </li> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1953 | <li> |
| 1954 | <p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1955 | All the <code>file1</code> files in the output refer to files before the |
| 1956 | 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] | 1957 | It is incorrect to apply each change to each file sequentially. For |
| 1958 | example, this patch will swap a and b: |
| 1959 | </p> |
| 1960 | <div class="literalblock"> |
| 1961 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1962 | <pre><code>diff --git a/a b/b |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1963 | rename from a |
| 1964 | rename to b |
| 1965 | diff --git a/b b/a |
| 1966 | rename from b |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1967 | rename to a</code></pre> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1968 | </div></div> |
| 1969 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1970 | </ol></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1971 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1972 | </div> |
| 1973 | <div class="sect1"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1974 | <h2 id="_combined_diff_format">combined diff format</h2> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1975 | <div class="sectionbody"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1976 | <div class="paragraph"><p>Any diff-generating command can take the ‘-c` or <code>--cc</code> option to |
Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 1977 | 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] | 1978 | format when showing merges with <a href="git-diff.html">git-diff(1)</a> or |
| 1979 | <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m’ option to any |
Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 1980 | of these commands to force generation of diffs with individual parents |
| 1981 | of a merge.</p></div> |
| 1982 | <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1983 | <div class="listingblock"> |
| 1984 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1985 | <pre><code>diff --combined describe.c |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1986 | index fabadb8,cc95eb0..4866510 |
| 1987 | --- a/describe.c |
| 1988 | +++ b/describe.c |
| 1989 | @@@ -98,20 -98,12 +98,20 @@@ |
| 1990 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
| 1991 | } |
| 1992 | |
| 1993 | - static void describe(char *arg) |
| 1994 | -static void describe(struct commit *cmit, int last_one) |
| 1995 | ++static void describe(char *arg, int last_one) |
| 1996 | { |
| 1997 | + unsigned char sha1[20]; |
| 1998 | + struct commit *cmit; |
| 1999 | struct commit_list *list; |
| 2000 | static int initialized = 0; |
| 2001 | struct commit_name *n; |
| 2002 | |
| 2003 | + if (get_sha1(arg, sha1) < 0) |
| 2004 | + usage(describe_usage); |
| 2005 | + cmit = lookup_commit_reference(sha1); |
| 2006 | + if (!cmit) |
| 2007 | + usage(describe_usage); |
| 2008 | + |
| 2009 | if (!initialized) { |
| 2010 | initialized = 1; |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2011 | for_each_ref(get_name);</code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2012 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2013 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2014 | <li> |
| 2015 | <p> |
| 2016 | It is preceded with a "git diff" header, that looks like |
| 2017 | this (when <em>-c</em> option is used): |
| 2018 | </p> |
| 2019 | <div class="literalblock"> |
| 2020 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2021 | <pre><code>diff --combined file</code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2022 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2023 | <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2024 | <div class="literalblock"> |
| 2025 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2026 | <pre><code>diff --cc file</code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2027 | </div></div> |
| 2028 | </li> |
| 2029 | <li> |
| 2030 | <p> |
| 2031 | It is followed by one or more extended header lines |
| 2032 | (this example shows a merge with two parents): |
| 2033 | </p> |
| 2034 | <div class="literalblock"> |
| 2035 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2036 | <pre><code>index <hash>,<hash>..<hash> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2037 | mode <mode>,<mode>..<mode> |
| 2038 | new file mode <mode> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2039 | deleted file mode <mode>,<mode></code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2040 | </div></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2041 | <div class="paragraph"><p>The <code>mode <mode>,<mode>..<mode></code> line appears only if at least one of |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2042 | the <mode> is different from the rest. Extended headers with |
| 2043 | information about detected contents movement (renames and |
| 2044 | copying detection) are designed to work with diff of two |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2045 | <tree-ish> and are not used by combined diff format.</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2046 | </li> |
| 2047 | <li> |
| 2048 | <p> |
| 2049 | It is followed by two-line from-file/to-file header |
| 2050 | </p> |
| 2051 | <div class="literalblock"> |
| 2052 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2053 | <pre><code>--- a/file |
| 2054 | +++ b/file</code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2055 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2056 | <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2057 | format, <code>/dev/null</code> is used to signal created or deleted |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2058 | files.</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2059 | </li> |
| 2060 | <li> |
| 2061 | <p> |
| 2062 | Chunk header format is modified to prevent people from |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2063 | accidentally feeding it to <code>patch -p1</code>. Combined diff format |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2064 | was created for review of merge commit changes, and was not |
| 2065 | meant for apply. The change is similar to the change in the |
| 2066 | extended <em>index</em> header: |
| 2067 | </p> |
| 2068 | <div class="literalblock"> |
| 2069 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2070 | <pre><code>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</code></pre> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2071 | </div></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2072 | <div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2073 | header for combined diff format.</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2074 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2075 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2076 | <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2077 | 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 |
| 2078 | added to B), or <code>" "</code> (space — unchanged) prefix, this format |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2079 | compares two or more files file1, file2,… with one file X, and |
| 2080 | 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] | 2081 | fileN is prepended to the output line to note how X’s line is |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2082 | different from it.</p></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2083 | <div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in |
| 2084 | 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] | 2085 | in the column N means that the line appears in the result, |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2086 | and fileN does not have that line (in other words, the line was |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2087 | added, from the point of view of that parent).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2088 | <div class="paragraph"><p>In the above example output, the function signature was changed |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2089 | from both files (hence two <code>-</code> removals from both file1 and |
| 2090 | file2, plus <code>++</code> to mean one line that was added does not appear |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 2091 | in either file1 nor file2). Also eight other lines are the same |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2092 | from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div> |
| 2093 | <div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2094 | merge commit with the merge result (i.e. file1..fileN are the |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2095 | parents). When shown by <code>git diff-files -c</code>, it compares the |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2096 | two unresolved merge parents with the working tree file |
| 2097 | (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2098 | "their version").</p></div> |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2099 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2100 | </div> |
| 2101 | <div class="sect1"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2102 | <h2 id="_other_diff_formats">other diff formats</h2> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2103 | <div class="sectionbody"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2104 | <div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and |
| 2105 | 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] | 2106 | output. These options can be combined with other options, such as |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2107 | <code>-p</code>, and are meant for human consumption.</p></div> |
| 2108 | <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] | 2109 | formats the pathnames compactly by combining common prefix and suffix of |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2110 | the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to |
| 2111 | <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] | 2112 | <div class="listingblock"> |
| 2113 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2114 | <pre><code>arch/{i386 => x86}/Makefile | 4 +--</code></pre> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2115 | </div></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2116 | <div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed |
| 2117 | for easier machine consumption. An entry in <code>--numstat</code> output looks |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2118 | like this:</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2119 | <div class="listingblock"> |
| 2120 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2121 | <pre><code>1 2 README |
| 2122 | 3 1 arch/{i386 => x86}/Makefile</code></pre> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2123 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2124 | <div class="paragraph"><p>That is, from left to right:</p></div> |
| 2125 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2126 | <li> |
| 2127 | <p> |
| 2128 | the number of added lines; |
| 2129 | </p> |
| 2130 | </li> |
| 2131 | <li> |
| 2132 | <p> |
| 2133 | a tab; |
| 2134 | </p> |
| 2135 | </li> |
| 2136 | <li> |
| 2137 | <p> |
| 2138 | the number of deleted lines; |
| 2139 | </p> |
| 2140 | </li> |
| 2141 | <li> |
| 2142 | <p> |
| 2143 | a tab; |
| 2144 | </p> |
| 2145 | </li> |
| 2146 | <li> |
| 2147 | <p> |
| 2148 | pathname (possibly with rename/copy information); |
| 2149 | </p> |
| 2150 | </li> |
| 2151 | <li> |
| 2152 | <p> |
| 2153 | a newline. |
| 2154 | </p> |
| 2155 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2156 | </ol></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2157 | <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] | 2158 | <div class="listingblock"> |
| 2159 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2160 | <pre><code>1 2 README NUL |
| 2161 | 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] | 2162 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2163 | <div class="paragraph"><p>That is:</p></div> |
| 2164 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2165 | <li> |
| 2166 | <p> |
| 2167 | the number of added lines; |
| 2168 | </p> |
| 2169 | </li> |
| 2170 | <li> |
| 2171 | <p> |
| 2172 | a tab; |
| 2173 | </p> |
| 2174 | </li> |
| 2175 | <li> |
| 2176 | <p> |
| 2177 | the number of deleted lines; |
| 2178 | </p> |
| 2179 | </li> |
| 2180 | <li> |
| 2181 | <p> |
| 2182 | a tab; |
| 2183 | </p> |
| 2184 | </li> |
| 2185 | <li> |
| 2186 | <p> |
| 2187 | a NUL (only exists if renamed/copied); |
| 2188 | </p> |
| 2189 | </li> |
| 2190 | <li> |
| 2191 | <p> |
| 2192 | pathname in preimage; |
| 2193 | </p> |
| 2194 | </li> |
| 2195 | <li> |
| 2196 | <p> |
| 2197 | a NUL (only exists if renamed/copied); |
| 2198 | </p> |
| 2199 | </li> |
| 2200 | <li> |
| 2201 | <p> |
| 2202 | pathname in postimage (only exists if renamed/copied); |
| 2203 | </p> |
| 2204 | </li> |
| 2205 | <li> |
| 2206 | <p> |
| 2207 | a NUL. |
| 2208 | </p> |
| 2209 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2210 | </ol></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2211 | <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] | 2212 | scripts that read the output to tell if the current record being read is |
| 2213 | a single-path record or a rename/copy record without reading ahead. |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2214 | After reading added and deleted lines, reading up to <code>NUL</code> would yield |
| 2215 | 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] | 2216 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2217 | </div> |
| 2218 | <div class="sect1"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2219 | <h2 id="_examples">EXAMPLES</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2220 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2221 | <div class="dlist"><dl> |
| 2222 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2223 | Various ways to check your working tree |
| 2224 | </dt> |
| 2225 | <dd> |
| 2226 | <div class="listingblock"> |
| 2227 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2228 | <pre><code>$ git diff <b><1></b> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2229 | $ git diff --cached <b><2></b> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2230 | $ git diff HEAD <b><3></b></code></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2231 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2232 | <div class="colist arabic"><ol> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2233 | <li> |
| 2234 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2235 | Changes in the working tree not yet staged for the next commit. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2236 | </p> |
| 2237 | </li> |
| 2238 | <li> |
| 2239 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2240 | Changes between the index and your last commit; what you |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2241 | would be committing if you run "git commit" without "-a" option. |
| 2242 | </p> |
| 2243 | </li> |
| 2244 | <li> |
| 2245 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2246 | Changes in the working tree since your last commit; what you |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2247 | would be committing if you run "git commit -a" |
| 2248 | </p> |
| 2249 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2250 | </ol></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2251 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2252 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2253 | Comparing with arbitrary commits |
| 2254 | </dt> |
| 2255 | <dd> |
| 2256 | <div class="listingblock"> |
| 2257 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2258 | <pre><code>$ git diff test <b><1></b> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2259 | $ git diff HEAD -- ./test <b><2></b> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2260 | $ git diff HEAD^ HEAD <b><3></b></code></pre> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2261 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2262 | <div class="colist arabic"><ol> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2263 | <li> |
| 2264 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2265 | Instead of using the tip of the current branch, compare with the |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2266 | tip of "test" branch. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2267 | </p> |
| 2268 | </li> |
| 2269 | <li> |
| 2270 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2271 | Instead of comparing with the tip of "test" branch, compare with |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 2272 | the tip of the current branch, but limit the comparison to the |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2273 | file "test". |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2274 | </p> |
| 2275 | </li> |
| 2276 | <li> |
| 2277 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2278 | Compare the version before the last commit and the last commit. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2279 | </p> |
| 2280 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2281 | </ol></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2282 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2283 | <dt class="hdlist1"> |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 2284 | Comparing branches |
| 2285 | </dt> |
| 2286 | <dd> |
| 2287 | <div class="listingblock"> |
| 2288 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2289 | <pre><code>$ git diff topic master <b><1></b> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2290 | $ git diff topic..master <b><2></b> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2291 | $ git diff topic...master <b><3></b></code></pre> |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 2292 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2293 | <div class="colist arabic"><ol> |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 2294 | <li> |
| 2295 | <p> |
| 2296 | Changes between the tips of the topic and the master branches. |
| 2297 | </p> |
| 2298 | </li> |
| 2299 | <li> |
| 2300 | <p> |
| 2301 | Same as above. |
| 2302 | </p> |
| 2303 | </li> |
| 2304 | <li> |
| 2305 | <p> |
Junio C Hamano | 764a667 | 2007-10-23 01:23:31 | [diff] [blame] | 2306 | Changes that occurred on the master branch since when the topic |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 2307 | branch was started off it. |
| 2308 | </p> |
| 2309 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2310 | </ol></div> |
Junio C Hamano | c435b1c | 2007-08-28 06:25:35 | [diff] [blame] | 2311 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2312 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2313 | Limiting the diff output |
| 2314 | </dt> |
| 2315 | <dd> |
| 2316 | <div class="listingblock"> |
| 2317 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2318 | <pre><code>$ git diff --diff-filter=MRC <b><1></b> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2319 | $ git diff --name-status <b><2></b> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2320 | $ git diff arch/i386 include/asm-i386 <b><3></b></code></pre> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2321 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2322 | <div class="colist arabic"><ol> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2323 | <li> |
| 2324 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2325 | Show only modification, rename and copy, but not addition |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2326 | nor deletion. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2327 | </p> |
| 2328 | </li> |
| 2329 | <li> |
| 2330 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2331 | Show only names and the nature of change, but not actual |
Junio C Hamano | bdeff82 | 2007-07-30 09:07:17 | [diff] [blame] | 2332 | diff output. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2333 | </p> |
| 2334 | </li> |
| 2335 | <li> |
| 2336 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2337 | Limit diff output to named subtrees. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2338 | </p> |
| 2339 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2340 | </ol></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2341 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2342 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2343 | Munging the diff output |
| 2344 | </dt> |
| 2345 | <dd> |
| 2346 | <div class="listingblock"> |
| 2347 | <div class="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2348 | <pre><code>$ git diff --find-copies-harder -B -C <b><1></b> |
| 2349 | $ git diff -R <b><2></b></code></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2350 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2351 | <div class="colist arabic"><ol> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2352 | <li> |
| 2353 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2354 | Spend extra cycles to find renames, copies and complete |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2355 | rewrites (very expensive). |
| 2356 | </p> |
| 2357 | </li> |
| 2358 | <li> |
| 2359 | <p> |
Junio C Hamano | 092f5f0 | 2007-08-02 07:23:38 | [diff] [blame] | 2360 | Output diff in reverse. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 2361 | </p> |
| 2362 | </li> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2363 | </ol></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2364 | </dd> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2365 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2366 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2367 | </div> |
| 2368 | <div class="sect1"> |
Junio C Hamano | a9701f0 | 2010-01-21 00:42:16 | [diff] [blame] | 2369 | <h2 id="_see_also">SEE ALSO</h2> |
| 2370 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2371 | <div class="paragraph"><p>diff(1), |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2372 | <a href="git-difftool.html">git-difftool(1)</a>, |
| 2373 | <a href="git-log.html">git-log(1)</a>, |
| 2374 | <a href="gitdiffcore.html">gitdiffcore(7)</a>, |
| 2375 | <a href="git-format-patch.html">git-format-patch(1)</a>, |
| 2376 | <a href="git-apply.html">git-apply(1)</a></p></div> |
Junio C Hamano | a9701f0 | 2010-01-21 00:42:16 | [diff] [blame] | 2377 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2378 | </div> |
| 2379 | <div class="sect1"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2380 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2381 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2382 | <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] | 2383 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 2384 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2385 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 2386 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2387 | <div id="footer"> |
| 2388 | <div id="footer-text"> |
Junio C Hamano | db81b99 | 2012-12-21 23:49:12 | [diff] [blame] | 2389 | Last updated 2012-12-21 15:43:33 PST |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2390 | </div> |
| 2391 | </div> |
| 2392 | </body> |
| 2393 | </html> |