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