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