| Junio C Hamano | 96153bf | 2018-04-25 08:25:34 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 3 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 5 | <head> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 6 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
| Junio C Hamano | 98c882d | 2020-08-13 22:06:57 | [diff] [blame] | 7 | <meta name="generator" content="AsciiDoc 9.0.0rc2" /> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 8 | <title>git-log(1)</title> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 9 | <style type="text/css"> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 10 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 11 | |
| 12 | /* Default font. */ |
| 13 | body { |
| 14 | font-family: Georgia,serif; |
| 15 | } |
| 16 | |
| 17 | /* Title font. */ |
| 18 | h1, h2, h3, h4, h5, h6, |
| 19 | div.title, caption.title, |
| 20 | thead, p.table.header, |
| 21 | #toctitle, |
| 22 | #author, #revnumber, #revdate, #revremark, |
| 23 | #footer { |
| 24 | font-family: Arial,Helvetica,sans-serif; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | body { |
| 28 | margin: 1em 5% 1em 5%; |
| 29 | } |
| 30 | |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 31 | a { |
| 32 | color: blue; |
| 33 | text-decoration: underline; |
| 34 | } |
| 35 | a:visited { |
| 36 | color: fuchsia; |
| 37 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 38 | |
| 39 | em { |
| 40 | font-style: italic; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 41 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | strong { |
| 45 | font-weight: bold; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 46 | color: #083194; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 47 | } |
| 48 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 49 | h1, h2, h3, h4, h5, h6 { |
| 50 | color: #527bbd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 51 | margin-top: 1.2em; |
| 52 | margin-bottom: 0.5em; |
| 53 | line-height: 1.3; |
| 54 | } |
| 55 | |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 56 | h1, h2, h3 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 57 | border-bottom: 2px solid silver; |
| 58 | } |
| 59 | h2 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 60 | padding-top: 0.5em; |
| 61 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 62 | h3 { |
| 63 | float: left; |
| 64 | } |
| 65 | h3 + * { |
| 66 | clear: left; |
| 67 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 68 | h5 { |
| 69 | font-size: 1.0em; |
| 70 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 71 | |
| 72 | div.sectionbody { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 73 | margin-left: 0; |
| 74 | } |
| 75 | |
| 76 | hr { |
| 77 | border: 1px solid silver; |
| 78 | } |
| 79 | |
| 80 | p { |
| 81 | margin-top: 0.5em; |
| 82 | margin-bottom: 0.5em; |
| 83 | } |
| 84 | |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 85 | ul, ol, li > p { |
| 86 | margin-top: 0; |
| 87 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 88 | ul > li { color: #aaa; } |
| 89 | ul > li > * { color: black; } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 90 | |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 91 | .monospaced, code, pre { |
| 92 | font-family: "Courier New", Courier, monospace; |
| 93 | font-size: inherit; |
| 94 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 95 | padding: 0; |
| 96 | margin: 0; |
| 97 | } |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 98 | pre { |
| 99 | white-space: pre-wrap; |
| 100 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 101 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 102 | #author { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 103 | color: #527bbd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 104 | font-weight: bold; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 105 | font-size: 1.1em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 106 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 107 | #email { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 108 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 109 | #revnumber, #revdate, #revremark { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 110 | } |
| 111 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 112 | #footer { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 113 | font-size: small; |
| 114 | border-top: 2px solid silver; |
| 115 | padding-top: 0.5em; |
| 116 | margin-top: 4.0em; |
| 117 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 118 | #footer-text { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 119 | float: left; |
| 120 | padding-bottom: 0.5em; |
| 121 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 122 | #footer-badges { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 123 | float: right; |
| 124 | padding-bottom: 0.5em; |
| 125 | } |
| 126 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 127 | #preamble { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 128 | margin-top: 1.5em; |
| 129 | margin-bottom: 1.5em; |
| 130 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 131 | div.imageblock, div.exampleblock, div.verseblock, |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 132 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 133 | div.admonitionblock { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 134 | margin-top: 1.0em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 135 | margin-bottom: 1.5em; |
| 136 | } |
| 137 | div.admonitionblock { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 138 | margin-top: 2.0em; |
| 139 | margin-bottom: 2.0em; |
| 140 | margin-right: 10%; |
| 141 | color: #606060; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | div.content { /* Block element content. */ |
| 145 | padding: 0; |
| 146 | } |
| 147 | |
| 148 | /* Block element titles. */ |
| 149 | div.title, caption.title { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 150 | color: #527bbd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 151 | font-weight: bold; |
| 152 | text-align: left; |
| 153 | margin-top: 1.0em; |
| 154 | margin-bottom: 0.5em; |
| 155 | } |
| 156 | div.title + * { |
| 157 | margin-top: 0; |
| 158 | } |
| 159 | |
| 160 | td div.title:first-child { |
| 161 | margin-top: 0.0em; |
| 162 | } |
| 163 | div.content div.title:first-child { |
| 164 | margin-top: 0.0em; |
| 165 | } |
| 166 | div.content + div.title { |
| 167 | margin-top: 0.0em; |
| 168 | } |
| 169 | |
| 170 | div.sidebarblock > div.content { |
| 171 | background: #ffffee; |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 172 | border: 1px solid #dddddd; |
| 173 | border-left: 4px solid #f0f0f0; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 174 | padding: 0.5em; |
| 175 | } |
| 176 | |
| 177 | div.listingblock > div.content { |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 178 | border: 1px solid #dddddd; |
| 179 | border-left: 5px solid #f0f0f0; |
| 180 | background: #f8f8f8; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 181 | padding: 0.5em; |
| 182 | } |
| 183 | |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 184 | div.quoteblock, div.verseblock { |
| 185 | padding-left: 1.0em; |
| 186 | margin-left: 1.0em; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 187 | margin-right: 10%; |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 188 | border-left: 5px solid #f0f0f0; |
| 189 | color: #888; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 190 | } |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 191 | |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 192 | div.quoteblock > div.attribution { |
| 193 | padding-top: 0.5em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 194 | text-align: right; |
| 195 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 196 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 197 | div.verseblock > pre.content { |
| 198 | font-family: inherit; |
| 199 | font-size: inherit; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 200 | } |
| 201 | div.verseblock > div.attribution { |
| 202 | padding-top: 0.75em; |
| 203 | text-align: left; |
| 204 | } |
| 205 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 206 | div.verseblock + div.attribution { |
| 207 | text-align: left; |
| 208 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 209 | |
| 210 | div.admonitionblock .icon { |
| 211 | vertical-align: top; |
| 212 | font-size: 1.1em; |
| 213 | font-weight: bold; |
| 214 | text-decoration: underline; |
| 215 | color: #527bbd; |
| 216 | padding-right: 0.5em; |
| 217 | } |
| 218 | div.admonitionblock td.content { |
| 219 | padding-left: 0.5em; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 220 | border-left: 3px solid #dddddd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | div.exampleblock > div.content { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 224 | border-left: 3px solid #dddddd; |
| 225 | padding-left: 0.5em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 226 | } |
| 227 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 228 | div.imageblock div.content { padding-left: 0; } |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 229 | span.image img { border-style: none; vertical-align: text-bottom; } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 230 | a.image:visited { color: white; } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 231 | |
| 232 | dl { |
| 233 | margin-top: 0.8em; |
| 234 | margin-bottom: 0.8em; |
| 235 | } |
| 236 | dt { |
| 237 | margin-top: 0.5em; |
| 238 | margin-bottom: 0; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 239 | font-style: normal; |
| 240 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 241 | } |
| 242 | dd > *:first-child { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 243 | margin-top: 0.1em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | ul, ol { |
| 247 | list-style-position: outside; |
| 248 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 249 | ol.arabic { |
| 250 | list-style-type: decimal; |
| 251 | } |
| 252 | ol.loweralpha { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 253 | list-style-type: lower-alpha; |
| 254 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 255 | ol.upperalpha { |
| 256 | list-style-type: upper-alpha; |
| 257 | } |
| 258 | ol.lowerroman { |
| 259 | list-style-type: lower-roman; |
| 260 | } |
| 261 | ol.upperroman { |
| 262 | list-style-type: upper-roman; |
| 263 | } |
| 264 | |
| 265 | div.compact ul, div.compact ol, |
| 266 | div.compact p, div.compact p, |
| 267 | div.compact div, div.compact div { |
| 268 | margin-top: 0.1em; |
| 269 | margin-bottom: 0.1em; |
| 270 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 271 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 272 | tfoot { |
| 273 | font-weight: bold; |
| 274 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 275 | td > div.verse { |
| 276 | white-space: pre; |
| 277 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 278 | |
| 279 | div.hdlist { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 280 | margin-top: 0.8em; |
| 281 | margin-bottom: 0.8em; |
| 282 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 283 | div.hdlist tr { |
| 284 | padding-bottom: 15px; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 285 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 286 | dt.hdlist1.strong, td.hdlist1.strong { |
| 287 | font-weight: bold; |
| 288 | } |
| 289 | td.hdlist1 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 290 | vertical-align: top; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 291 | font-style: normal; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 292 | padding-right: 0.8em; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 293 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 294 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 295 | td.hdlist2 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 296 | vertical-align: top; |
| 297 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 298 | div.hdlist.compact tr { |
| 299 | margin: 0; |
| 300 | padding-bottom: 0; |
| 301 | } |
| 302 | |
| 303 | .comment { |
| 304 | background: yellow; |
| 305 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 306 | |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 307 | .footnote, .footnoteref { |
| 308 | font-size: 0.8em; |
| 309 | } |
| 310 | |
| 311 | span.footnote, span.footnoteref { |
| 312 | vertical-align: super; |
| 313 | } |
| 314 | |
| 315 | #footnotes { |
| 316 | margin: 20px 0 20px 0; |
| 317 | padding: 7px 0 0 0; |
| 318 | } |
| 319 | |
| 320 | #footnotes div.footnote { |
| 321 | margin: 0 0 5px 0; |
| 322 | } |
| 323 | |
| 324 | #footnotes hr { |
| 325 | border: none; |
| 326 | border-top: 1px solid silver; |
| 327 | height: 1px; |
| 328 | text-align: left; |
| 329 | margin-left: 0; |
| 330 | width: 20%; |
| 331 | min-width: 100px; |
| 332 | } |
| 333 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 334 | div.colist td { |
| 335 | padding-right: 0.5em; |
| 336 | padding-bottom: 0.3em; |
| 337 | vertical-align: top; |
| 338 | } |
| 339 | div.colist td img { |
| 340 | margin-top: 0.3em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 341 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 342 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 343 | @media print { |
| 344 | #footer-badges { display: none; } |
| 345 | } |
| 346 | |
| 347 | #toc { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 348 | margin-bottom: 2.5em; |
| 349 | } |
| 350 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 351 | #toctitle { |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 352 | color: #527bbd; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 353 | font-size: 1.1em; |
| 354 | font-weight: bold; |
| 355 | margin-top: 1.0em; |
| 356 | margin-bottom: 0.1em; |
| 357 | } |
| 358 | |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 359 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 360 | margin-top: 0; |
| 361 | margin-bottom: 0; |
| 362 | } |
| 363 | div.toclevel2 { |
| 364 | margin-left: 2em; |
| 365 | font-size: 0.9em; |
| 366 | } |
| 367 | div.toclevel3 { |
| 368 | margin-left: 4em; |
| 369 | font-size: 0.9em; |
| 370 | } |
| 371 | div.toclevel4 { |
| 372 | margin-left: 6em; |
| 373 | font-size: 0.9em; |
| 374 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 375 | |
| 376 | span.aqua { color: aqua; } |
| 377 | span.black { color: black; } |
| 378 | span.blue { color: blue; } |
| 379 | span.fuchsia { color: fuchsia; } |
| 380 | span.gray { color: gray; } |
| 381 | span.green { color: green; } |
| 382 | span.lime { color: lime; } |
| 383 | span.maroon { color: maroon; } |
| 384 | span.navy { color: navy; } |
| 385 | span.olive { color: olive; } |
| 386 | span.purple { color: purple; } |
| 387 | span.red { color: red; } |
| 388 | span.silver { color: silver; } |
| 389 | span.teal { color: teal; } |
| 390 | span.white { color: white; } |
| 391 | span.yellow { color: yellow; } |
| 392 | |
| 393 | span.aqua-background { background: aqua; } |
| 394 | span.black-background { background: black; } |
| 395 | span.blue-background { background: blue; } |
| 396 | span.fuchsia-background { background: fuchsia; } |
| 397 | span.gray-background { background: gray; } |
| 398 | span.green-background { background: green; } |
| 399 | span.lime-background { background: lime; } |
| 400 | span.maroon-background { background: maroon; } |
| 401 | span.navy-background { background: navy; } |
| 402 | span.olive-background { background: olive; } |
| 403 | span.purple-background { background: purple; } |
| 404 | span.red-background { background: red; } |
| 405 | span.silver-background { background: silver; } |
| 406 | span.teal-background { background: teal; } |
| 407 | span.white-background { background: white; } |
| 408 | span.yellow-background { background: yellow; } |
| 409 | |
| 410 | span.big { font-size: 2em; } |
| 411 | span.small { font-size: 0.6em; } |
| 412 | |
| 413 | span.underline { text-decoration: underline; } |
| 414 | span.overline { text-decoration: overline; } |
| 415 | span.line-through { text-decoration: line-through; } |
| 416 | |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 417 | div.unbreakable { page-break-inside: avoid; } |
| 418 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 419 | |
| 420 | /* |
| 421 | * xhtml11 specific |
| 422 | * |
| 423 | * */ |
| 424 | |
| 425 | div.tableblock { |
| 426 | margin-top: 1.0em; |
| 427 | margin-bottom: 1.5em; |
| 428 | } |
| 429 | div.tableblock > table { |
| 430 | border: 3px solid #527bbd; |
| 431 | } |
| 432 | thead, p.table.header { |
| 433 | font-weight: bold; |
| 434 | color: #527bbd; |
| 435 | } |
| 436 | p.table { |
| 437 | margin-top: 0; |
| 438 | } |
| Junio C Hamano | 725b0da | 2020-01-22 22:02:40 | [diff] [blame] | 439 | /* Because the table frame attribute is overridden by CSS in most browsers. */ |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 440 | div.tableblock > table[frame="void"] { |
| 441 | border-style: none; |
| 442 | } |
| 443 | div.tableblock > table[frame="hsides"] { |
| 444 | border-left-style: none; |
| 445 | border-right-style: none; |
| 446 | } |
| 447 | div.tableblock > table[frame="vsides"] { |
| 448 | border-top-style: none; |
| 449 | border-bottom-style: none; |
| 450 | } |
| 451 | |
| 452 | |
| 453 | /* |
| 454 | * html5 specific |
| 455 | * |
| 456 | * */ |
| 457 | |
| 458 | table.tableblock { |
| 459 | margin-top: 1.0em; |
| 460 | margin-bottom: 1.5em; |
| 461 | } |
| 462 | thead, p.tableblock.header { |
| 463 | font-weight: bold; |
| 464 | color: #527bbd; |
| 465 | } |
| 466 | p.tableblock { |
| 467 | margin-top: 0; |
| 468 | } |
| 469 | table.tableblock { |
| 470 | border-width: 3px; |
| 471 | border-spacing: 0px; |
| 472 | border-style: solid; |
| 473 | border-color: #527bbd; |
| 474 | border-collapse: collapse; |
| 475 | } |
| 476 | th.tableblock, td.tableblock { |
| 477 | border-width: 1px; |
| 478 | padding: 4px; |
| 479 | border-style: solid; |
| 480 | border-color: #527bbd; |
| 481 | } |
| 482 | |
| 483 | table.tableblock.frame-topbot { |
| 484 | border-left-style: hidden; |
| 485 | border-right-style: hidden; |
| 486 | } |
| 487 | table.tableblock.frame-sides { |
| 488 | border-top-style: hidden; |
| 489 | border-bottom-style: hidden; |
| 490 | } |
| 491 | table.tableblock.frame-none { |
| 492 | border-style: hidden; |
| 493 | } |
| 494 | |
| 495 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 496 | text-align: left; |
| 497 | } |
| 498 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 499 | text-align: center; |
| 500 | } |
| 501 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 502 | text-align: right; |
| 503 | } |
| 504 | |
| 505 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 506 | vertical-align: top; |
| 507 | } |
| 508 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 509 | vertical-align: middle; |
| 510 | } |
| 511 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 512 | vertical-align: bottom; |
| 513 | } |
| 514 | |
| 515 | |
| 516 | /* |
| 517 | * manpage specific |
| 518 | * |
| 519 | * */ |
| 520 | |
| 521 | body.manpage h1 { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 522 | padding-top: 0.5em; |
| 523 | padding-bottom: 0.5em; |
| 524 | border-top: 2px solid silver; |
| 525 | border-bottom: 2px solid silver; |
| 526 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 527 | body.manpage h2 { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 528 | border-style: none; |
| 529 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 530 | body.manpage div.sectionbody { |
| 531 | margin-left: 3em; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 532 | } |
| 533 | |
| 534 | @media print { |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 535 | body.manpage div#toc { display: none; } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 536 | } |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 537 | |
| 538 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 539 | </style> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 540 | <script type="text/javascript"> |
| 541 | /*<![CDATA[*/ |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 542 | var asciidoc = { // Namespace. |
| 543 | |
| 544 | ///////////////////////////////////////////////////////////////////// |
| 545 | // Table Of Contents generator |
| 546 | ///////////////////////////////////////////////////////////////////// |
| 547 | |
| 548 | /* Author: Mihai Bazon, September 2002 |
| 549 | * http://students.infoiasi.ro/~mishoo |
| 550 | * |
| 551 | * Table Of Content generator |
| 552 | * Version: 0.4 |
| 553 | * |
| 554 | * Feel free to use this script under the terms of the GNU General Public |
| 555 | * License, as long as you do not remove or alter this notice. |
| 556 | */ |
| 557 | |
| 558 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 559 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 560 | |
| 561 | // toclevels = 1..4. |
| 562 | toc: function (toclevels) { |
| 563 | |
| 564 | function getText(el) { |
| 565 | var text = ""; |
| 566 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 567 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 568 | text += i.data; |
| 569 | else if (i.firstChild != null) |
| 570 | text += getText(i); |
| 571 | } |
| 572 | return text; |
| 573 | } |
| 574 | |
| 575 | function TocEntry(el, text, toclevel) { |
| 576 | this.element = el; |
| 577 | this.text = text; |
| 578 | this.toclevel = toclevel; |
| 579 | } |
| 580 | |
| 581 | function tocEntries(el, toclevels) { |
| 582 | var result = new Array; |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 583 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 584 | // Function that scans the DOM tree for header elements (the DOM2 |
| 585 | // nodeIterator API would be a better technique but not supported by all |
| 586 | // browsers). |
| 587 | var iterate = function (el) { |
| 588 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 589 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 590 | var mo = re.exec(i.tagName); |
| 591 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 592 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 593 | } |
| 594 | iterate(i); |
| 595 | } |
| 596 | } |
| 597 | } |
| 598 | iterate(el); |
| 599 | return result; |
| 600 | } |
| 601 | |
| 602 | var toc = document.getElementById("toc"); |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 603 | if (!toc) { |
| 604 | return; |
| 605 | } |
| 606 | |
| 607 | // Delete existing TOC entries in case we're reloading the TOC. |
| 608 | var tocEntriesToRemove = []; |
| 609 | var i; |
| 610 | for (i = 0; i < toc.childNodes.length; i++) { |
| 611 | var entry = toc.childNodes[i]; |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 612 | if (entry.nodeName.toLowerCase() == 'div' |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 613 | && entry.getAttribute("class") |
| 614 | && entry.getAttribute("class").match(/^toclevel/)) |
| 615 | tocEntriesToRemove.push(entry); |
| 616 | } |
| 617 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 618 | toc.removeChild(tocEntriesToRemove[i]); |
| 619 | } |
| 620 | |
| 621 | // Rebuild TOC entries. |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 622 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 623 | for (var i = 0; i < entries.length; ++i) { |
| 624 | var entry = entries[i]; |
| 625 | if (entry.element.id == "") |
| 626 | entry.element.id = "_toc_" + i; |
| 627 | var a = document.createElement("a"); |
| 628 | a.href = "#" + entry.element.id; |
| 629 | a.appendChild(document.createTextNode(entry.text)); |
| 630 | var div = document.createElement("div"); |
| 631 | div.appendChild(a); |
| 632 | div.className = "toclevel" + entry.toclevel; |
| 633 | toc.appendChild(div); |
| 634 | } |
| 635 | if (entries.length == 0) |
| 636 | toc.parentNode.removeChild(toc); |
| 637 | }, |
| 638 | |
| 639 | |
| 640 | ///////////////////////////////////////////////////////////////////// |
| 641 | // Footnotes generator |
| 642 | ///////////////////////////////////////////////////////////////////// |
| 643 | |
| 644 | /* Based on footnote generation code from: |
| 645 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 646 | */ |
| 647 | |
| 648 | footnotes: function () { |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 649 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 650 | var i; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 651 | var noteholder = document.getElementById("footnotes"); |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 652 | if (!noteholder) { |
| 653 | return; |
| 654 | } |
| 655 | var entriesToRemove = []; |
| 656 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 657 | var entry = noteholder.childNodes[i]; |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 658 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 659 | entriesToRemove.push(entry); |
| 660 | } |
| 661 | for (i = 0; i < entriesToRemove.length; i++) { |
| 662 | noteholder.removeChild(entriesToRemove[i]); |
| 663 | } |
| 664 | |
| 665 | // Rebuild footnote entries. |
| 666 | var cont = document.getElementById("content"); |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 667 | var spans = cont.getElementsByTagName("span"); |
| 668 | var refs = {}; |
| 669 | var n = 0; |
| 670 | for (i=0; i<spans.length; i++) { |
| 671 | if (spans[i].className == "footnote") { |
| 672 | n++; |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 673 | var note = spans[i].getAttribute("data-note"); |
| 674 | if (!note) { |
| 675 | // Use [\s\S] in place of . so multi-line matches work. |
| 676 | // Because JavaScript has no s (dotall) regex flag. |
| 677 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 678 | spans[i].innerHTML = |
| 679 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 680 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 681 | spans[i].setAttribute("data-note", note); |
| 682 | } |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 683 | noteholder.innerHTML += |
| 684 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 685 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 686 | n + "</a>. " + note + "</div>"; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 687 | var id =spans[i].getAttribute("id"); |
| 688 | if (id != null) refs["#"+id] = n; |
| 689 | } |
| 690 | } |
| 691 | if (n == 0) |
| 692 | noteholder.parentNode.removeChild(noteholder); |
| 693 | else { |
| 694 | // Process footnoterefs. |
| 695 | for (i=0; i<spans.length; i++) { |
| 696 | if (spans[i].className == "footnoteref") { |
| 697 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 698 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 699 | n = refs[href]; |
| 700 | spans[i].innerHTML = |
| 701 | "[<a href='#_footnote_" + n + |
| 702 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 703 | } |
| 704 | } |
| 705 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 706 | }, |
| 707 | |
| 708 | install: function(toclevels) { |
| 709 | var timerId; |
| 710 | |
| 711 | function reinstall() { |
| 712 | asciidoc.footnotes(); |
| 713 | if (toclevels) { |
| 714 | asciidoc.toc(toclevels); |
| 715 | } |
| 716 | } |
| 717 | |
| 718 | function reinstallAndRemoveTimer() { |
| 719 | clearInterval(timerId); |
| 720 | reinstall(); |
| 721 | } |
| 722 | |
| 723 | timerId = setInterval(reinstall, 500); |
| 724 | if (document.addEventListener) |
| 725 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 726 | else |
| 727 | window.onload = reinstallAndRemoveTimer; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 728 | } |
| 729 | |
| 730 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 731 | asciidoc.install(); |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 732 | /*]]>*/ |
| 733 | </script> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 734 | </head> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 735 | <body class="manpage"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 736 | <div id="header"> |
| 737 | <h1> |
| 738 | git-log(1) Manual Page |
| 739 | </h1> |
| 740 | <h2>NAME</h2> |
| 741 | <div class="sectionbody"> |
| 742 | <p>git-log - |
| 743 | Show commit logs |
| 744 | </p> |
| 745 | </div> |
| 746 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 747 | <div id="content"> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 748 | <div class="sect1"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 749 | <h2 id="_synopsis">SYNOPSIS</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 750 | <div class="sectionbody"> |
| Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 751 | <div class="verseblock"> |
| Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 752 | <pre class="content"><em>git log</em> [<options>] [<revision range>] [[--] <path>…]</pre> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 753 | <div class="attribution"> |
| Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 754 | </div></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 755 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 756 | </div> |
| 757 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 758 | <h2 id="_description">DESCRIPTION</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 759 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 760 | <div class="paragraph"><p>Shows the commit logs.</p></div> |
| Junio C Hamano | 28c33de | 2020-07-30 21:22:26 | [diff] [blame] | 761 | <div class="paragraph"><p>List commits that are reachable by following the <code>parent</code> links from the |
| 762 | given commit(s), but exclude commits that are reachable from the one(s) |
| 763 | given with a <em>^</em> in front of them. The output is given in reverse |
| 764 | chronological order by default.</p></div> |
| 765 | <div class="paragraph"><p>You can think of this as a set operation. Commits reachable from any of |
| 766 | the commits given on the command line form a set, and then commits reachable |
| 767 | from any of the ones given with <em>^</em> in front are subtracted from that |
| 768 | set. The remaining commits are what comes out in the command’s output. |
| 769 | Various other options and paths parameters can be used to further limit the |
| 770 | result.</p></div> |
| 771 | <div class="paragraph"><p>Thus, the following command:</p></div> |
| 772 | <div class="listingblock"> |
| 773 | <div class="content"> |
| 774 | <pre><code>$ git log foo bar ^baz</code></pre> |
| 775 | </div></div> |
| 776 | <div class="paragraph"><p>means "list all the commits which are reachable from <em>foo</em> or <em>bar</em>, but |
| 777 | not from <em>baz</em>".</p></div> |
| 778 | <div class="paragraph"><p>A special notation "<em><commit1></em>..<em><commit2></em>" can be used as a |
| 779 | short-hand for "^<em><commit1></em> <em><commit2></em>". For example, either of |
| 780 | the following may be used interchangeably:</p></div> |
| 781 | <div class="listingblock"> |
| 782 | <div class="content"> |
| 783 | <pre><code>$ git log origin..HEAD |
| 784 | $ git log HEAD ^origin</code></pre> |
| 785 | </div></div> |
| 786 | <div class="paragraph"><p>Another special notation is "<em><commit1></em>…<em><commit2></em>" which is useful |
| 787 | for merges. The resulting set of commits is the symmetric difference |
| 788 | between the two operands. The following two commands are equivalent:</p></div> |
| 789 | <div class="listingblock"> |
| 790 | <div class="content"> |
| 791 | <pre><code>$ git log A B --not $(git merge-base --all A B) |
| 792 | $ git log A...B</code></pre> |
| 793 | </div></div> |
| 794 | <div class="paragraph"><p>The command takes options applicable to the <a href="git-rev-list.html">git-rev-list(1)</a> |
| Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 795 | command to control what is shown and how, and options applicable to |
| Junio C Hamano | 28c33de | 2020-07-30 21:22:26 | [diff] [blame] | 796 | the <a href="git-diff.html">git-diff(1)</a> command to control how the changes |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 797 | each commit introduces are shown.</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 798 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 799 | </div> |
| 800 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 801 | <h2 id="_options">OPTIONS</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 802 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 803 | <div class="dlist"><dl> |
| 804 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 805 | --follow |
| 806 | </dt> |
| 807 | <dd> |
| 808 | <p> |
| 809 | Continue listing the history of a file beyond renames |
| 810 | (works only for a single file). |
| 811 | </p> |
| 812 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 813 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 814 | --no-decorate |
| 815 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 816 | <dt class="hdlist1"> |
| Junio C Hamano | 37cf408 | 2016-05-30 01:22:14 | [diff] [blame] | 817 | --decorate[=short|full|auto|no] |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 818 | </dt> |
| 819 | <dd> |
| 820 | <p> |
| 821 | Print out the ref names of any commits that are shown. If <em>short</em> is |
| 822 | specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and |
| 823 | <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the |
| Junio C Hamano | 37cf408 | 2016-05-30 01:22:14 | [diff] [blame] | 824 | full ref name (including prefix) will be printed. If <em>auto</em> is |
| 825 | specified, then if the output is going to a terminal, the ref names |
| 826 | are shown as if <em>short</em> were given, otherwise no ref names are |
| 827 | shown. The default option is <em>short</em>. |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 828 | </p> |
| 829 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 830 | <dt class="hdlist1"> |
| Junio C Hamano | 371470a | 2017-12-13 22:26:40 | [diff] [blame] | 831 | --decorate-refs=<pattern> |
| 832 | </dt> |
| 833 | <dt class="hdlist1"> |
| 834 | --decorate-refs-exclude=<pattern> |
| 835 | </dt> |
| 836 | <dd> |
| 837 | <p> |
| 838 | If no <code>--decorate-refs</code> is given, pretend as if all refs were |
| 839 | included. For each candidate, do not use it for decoration if it |
| 840 | matches any patterns given to <code>--decorate-refs-exclude</code> or if it |
| Junio C Hamano | 0dd5094 | 2020-04-29 21:21:05 | [diff] [blame] | 841 | doesn’t match any of the patterns given to <code>--decorate-refs</code>. The |
| 842 | <code>log.excludeDecoration</code> config option allows excluding refs from |
| 843 | the decorations, but an explicit <code>--decorate-refs</code> pattern will |
| 844 | override a match in <code>log.excludeDecoration</code>. |
| Junio C Hamano | 371470a | 2017-12-13 22:26:40 | [diff] [blame] | 845 | </p> |
| 846 | </dd> |
| 847 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 848 | --source |
| 849 | </dt> |
| 850 | <dd> |
| 851 | <p> |
| 852 | Print out the ref name given on the command line by which each |
| 853 | commit was reached. |
| 854 | </p> |
| 855 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 856 | <dt class="hdlist1"> |
| Junio C Hamano | 0dd5094 | 2020-04-29 21:21:05 | [diff] [blame] | 857 | --[no-]mailmap |
| 858 | </dt> |
| 859 | <dt class="hdlist1"> |
| Junio C Hamano | 3659495 | 2019-07-25 22:26:52 | [diff] [blame] | 860 | --[no-]use-mailmap |
| Junio C Hamano | ce836cc | 2013-01-21 02:01:53 | [diff] [blame] | 861 | </dt> |
| 862 | <dd> |
| 863 | <p> |
| 864 | Use mailmap file to map author and committer names and email |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 865 | addresses to canonical real names and email addresses. See |
| Junio C Hamano | ce836cc | 2013-01-21 02:01:53 | [diff] [blame] | 866 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
| 867 | </p> |
| 868 | </dd> |
| 869 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 870 | --full-diff |
| 871 | </dt> |
| 872 | <dd> |
| 873 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 874 | Without this flag, <code>git log -p <path>...</code> shows commits that |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 875 | touch the specified paths, and diffs about the same specified |
| 876 | paths. With this, the full diff is shown for commits that touch |
| 877 | the specified paths; this means that "<path>…" limits only |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 878 | commits, and doesn’t limit diff for those commits. |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 879 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 880 | <div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 881 | produced by <code>--stat</code>, etc.</p></div> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 882 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 883 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 884 | --log-size |
| 885 | </dt> |
| 886 | <dd> |
| 887 | <p> |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 888 | Include a line “log size <number>” in the output for each commit, |
| 889 | where <number> is the length of that commit’s message in bytes. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 890 | Intended to speed up tools that read log messages from <code>git log</code> |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 891 | output by allowing them to allocate space in advance. |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 892 | </p> |
| 893 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 894 | <dt class="hdlist1"> |
| Junio C Hamano | 8eac268 | 2013-09-09 22:35:20 | [diff] [blame] | 895 | -L <start>,<end>:<file> |
| 896 | </dt> |
| 897 | <dt class="hdlist1"> |
| Junio C Hamano | dd5004a | 2015-05-06 19:33:32 | [diff] [blame] | 898 | -L :<funcname>:<file> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 899 | </dt> |
| 900 | <dd> |
| 901 | <p> |
| 902 | Trace the evolution of the line range given by "<start>,<end>" |
| Junio C Hamano | dd5004a | 2015-05-06 19:33:32 | [diff] [blame] | 903 | (or the function name regex <funcname>) within the <file>. You may |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 904 | not give any pathspec limiters. This is currently limited to |
| 905 | a walk starting from a single revision, i.e., you may only |
| Junio C Hamano | 6879384 | 2020-01-06 23:07:09 | [diff] [blame] | 906 | give zero or one positive revision arguments, and |
| 907 | <start> and <end> (or <funcname>) must exist in the starting revision. |
| 908 | You can specify this option more than once. Implies <code>--patch</code>. |
| 909 | Patch output can be suppressed using <code>--no-patch</code>, but other diff formats |
| 910 | (namely <code>--raw</code>, <code>--numstat</code>, <code>--shortstat</code>, <code>--dirstat</code>, <code>--summary</code>, |
| 911 | <code>--name-only</code>, <code>--name-status</code>, <code>--check</code>) are not currently implemented. |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 912 | </p> |
| 913 | <div class="paragraph"><p><start> and <end> can take one of these forms:</p></div> |
| 914 | <div class="ulist"><ul> |
| 915 | <li> |
| 916 | <p> |
| 917 | number |
| 918 | </p> |
| 919 | <div class="paragraph"><p>If <start> or <end> is a number, it specifies an |
| 920 | absolute line number (lines count from 1).</p></div> |
| 921 | </li> |
| 922 | <li> |
| 923 | <p> |
| 924 | /regex/ |
| 925 | </p> |
| 926 | <div class="paragraph"><p>This form will use the first line matching the given |
| Junio C Hamano | 8eac268 | 2013-09-09 22:35:20 | [diff] [blame] | 927 | POSIX regex. If <start> is a regex, it will search from the end of |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 928 | the previous <code>-L</code> range, if any, otherwise from the start of file. |
| Junio C Hamano | 8eac268 | 2013-09-09 22:35:20 | [diff] [blame] | 929 | If <start> is “^/regex/”, it will search from the start of file. |
| 930 | If <end> is a regex, it will search |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 931 | starting at the line given by <start>.</p></div> |
| 932 | </li> |
| 933 | <li> |
| 934 | <p> |
| 935 | +offset or -offset |
| 936 | </p> |
| 937 | <div class="paragraph"><p>This is only valid for <end> and will specify a number |
| 938 | of lines before or after the line given by <start>.</p></div> |
| 939 | </li> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 940 | </ul></div> |
| Junio C Hamano | dd5004a | 2015-05-06 19:33:32 | [diff] [blame] | 941 | <div class="paragraph"><p>If “:<funcname>” is given in place of <start> and <end>, it is a |
| 942 | regular expression that denotes the range from the first funcname line |
| 943 | that matches <funcname>, up to the next funcname line. “:<funcname>” |
| 944 | searches from the end of the previous <code>-L</code> range, if any, otherwise |
| 945 | from the start of file. “^:<funcname>” searches from the start of |
| 946 | file.</p></div> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 947 | </dd> |
| 948 | <dt class="hdlist1"> |
| Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 949 | <revision range> |
| 950 | </dt> |
| 951 | <dd> |
| 952 | <p> |
| 953 | Show only commits in the specified revision range. When no |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 954 | <revision range> is specified, it defaults to <code>HEAD</code> (i.e. the |
| 955 | whole history leading to the current commit). <code>origin..HEAD</code> |
| Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 956 | specifies all the commits reachable from the current commit |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 957 | (i.e. <code>HEAD</code>), but not from <code>origin</code>. For a complete list of |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 958 | ways to spell <revision range>, see the <em>Specifying Ranges</em> |
| Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 959 | section of <a href="gitrevisions.html">gitrevisions(7)</a>. |
| 960 | </p> |
| 961 | </dd> |
| 962 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 963 | [--] <path>… |
| 964 | </dt> |
| 965 | <dd> |
| 966 | <p> |
| Junio C Hamano | 5723afa | 2011-08-31 00:49:23 | [diff] [blame] | 967 | Show only commits that are enough to explain how the files |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 968 | that match the specified paths came to be. See <em>History |
| 969 | Simplification</em> below for details and other simplification |
| Junio C Hamano | 5723afa | 2011-08-31 00:49:23 | [diff] [blame] | 970 | modes. |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 971 | </p> |
| Junio C Hamano | ccb8252 | 2018-05-08 07:52:09 | [diff] [blame] | 972 | <div class="paragraph"><p>Paths may need to be prefixed with <code>--</code> to separate them from |
| Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 973 | options or the revision range, when confusion arises.</p></div> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 974 | </dd> |
| 975 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 976 | <div class="sect2"> |
| 977 | <h3 id="_commit_limiting">Commit Limiting</h3> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 978 | <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 979 | special notations explained in the description, additional commit |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 980 | limiting may be applied.</p></div> |
| 981 | <div class="paragraph"><p>Using more options generally further limits the output (e.g. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 982 | <code>--since=<date1></code> limits to commits newer than <code><date1></code>, and using it |
| 983 | with <code>--grep=<pattern></code> further limits to commits whose log message |
| 984 | has a line that matches <code><pattern></code>), unless otherwise noted.</p></div> |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 985 | <div class="paragraph"><p>Note that these are applied before commit |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 986 | ordering and formatting options, such as <code>--reverse</code>.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 987 | <div class="dlist"><dl> |
| 988 | <dt class="hdlist1"> |
| Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 989 | -<number> |
| 990 | </dt> |
| 991 | <dt class="hdlist1"> |
| 992 | -n <number> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 993 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 994 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 995 | --max-count=<number> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 996 | </dt> |
| 997 | <dd> |
| 998 | <p> |
| Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 999 | Limit the number of commits to output. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1000 | </p> |
| 1001 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1002 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1003 | --skip=<number> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1004 | </dt> |
| 1005 | <dd> |
| 1006 | <p> |
| 1007 | Skip <em>number</em> commits before starting to show the commit output. |
| 1008 | </p> |
| 1009 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1010 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1011 | --since=<date> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1012 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1013 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1014 | --after=<date> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1015 | </dt> |
| 1016 | <dd> |
| 1017 | <p> |
| 1018 | Show commits more recent than a specific date. |
| 1019 | </p> |
| 1020 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1021 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1022 | --until=<date> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1023 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1024 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1025 | --before=<date> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1026 | </dt> |
| 1027 | <dd> |
| 1028 | <p> |
| 1029 | Show commits older than a specific date. |
| 1030 | </p> |
| 1031 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1032 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1033 | --author=<pattern> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1034 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1035 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1036 | --committer=<pattern> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1037 | </dt> |
| 1038 | <dd> |
| 1039 | <p> |
| 1040 | Limit the commits output to ones with author/committer |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1041 | header lines that match the specified pattern (regular |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1042 | expression). With more than one <code>--author=<pattern></code>, |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1043 | commits whose author matches any of the given patterns are |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1044 | chosen (similarly for multiple <code>--committer=<pattern></code>). |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1045 | </p> |
| 1046 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1047 | <dt class="hdlist1"> |
| Junio C Hamano | 9954ed7 | 2012-10-03 04:54:00 | [diff] [blame] | 1048 | --grep-reflog=<pattern> |
| 1049 | </dt> |
| 1050 | <dd> |
| 1051 | <p> |
| 1052 | Limit the commits output to ones with reflog entries that |
| 1053 | match the specified pattern (regular expression). With |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1054 | more than one <code>--grep-reflog</code>, commits whose reflog message |
| Junio C Hamano | 9954ed7 | 2012-10-03 04:54:00 | [diff] [blame] | 1055 | matches any of the given patterns are chosen. It is an |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1056 | error to use this option unless <code>--walk-reflogs</code> is in use. |
| Junio C Hamano | 9954ed7 | 2012-10-03 04:54:00 | [diff] [blame] | 1057 | </p> |
| 1058 | </dd> |
| 1059 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1060 | --grep=<pattern> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1061 | </dt> |
| 1062 | <dd> |
| 1063 | <p> |
| 1064 | Limit the commits output to ones with log message that |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1065 | matches the specified pattern (regular expression). With |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1066 | more than one <code>--grep=<pattern></code>, commits whose message |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1067 | matches any of the given patterns are chosen (but see |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1068 | <code>--all-match</code>). |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1069 | </p> |
| Junio C Hamano | b3f862c | 2019-12-05 22:22:00 | [diff] [blame] | 1070 | <div class="paragraph"><p>When <code>--notes</code> is in effect, the message from the notes is |
| Junio C Hamano | 8152abf | 2015-04-28 22:48:02 | [diff] [blame] | 1071 | matched as if it were part of the log message.</p></div> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1072 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1073 | <dt class="hdlist1"> |
| Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1074 | --all-match |
| 1075 | </dt> |
| 1076 | <dd> |
| 1077 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1078 | Limit the commits output to ones that match all given <code>--grep</code>, |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1079 | instead of ones that match at least one. |
| Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1080 | </p> |
| 1081 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1082 | <dt class="hdlist1"> |
| Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 1083 | --invert-grep |
| 1084 | </dt> |
| 1085 | <dd> |
| 1086 | <p> |
| 1087 | Limit the commits output to ones with log message that do not |
| 1088 | match the pattern specified with <code>--grep=<pattern></code>. |
| 1089 | </p> |
| 1090 | </dd> |
| 1091 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1092 | -i |
| 1093 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1094 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1095 | --regexp-ignore-case |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1096 | </dt> |
| 1097 | <dd> |
| 1098 | <p> |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1099 | Match the regular expression limiting patterns without regard to letter |
| 1100 | case. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1101 | </p> |
| 1102 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1103 | <dt class="hdlist1"> |
| Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1104 | --basic-regexp |
| 1105 | </dt> |
| 1106 | <dd> |
| 1107 | <p> |
| 1108 | Consider the limiting patterns to be basic regular expressions; |
| 1109 | this is the default. |
| 1110 | </p> |
| 1111 | </dd> |
| 1112 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1113 | -E |
| 1114 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1115 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1116 | --extended-regexp |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1117 | </dt> |
| 1118 | <dd> |
| 1119 | <p> |
| 1120 | Consider the limiting patterns to be extended regular expressions |
| 1121 | instead of the default basic regular expressions. |
| 1122 | </p> |
| 1123 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1124 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1125 | -F |
| 1126 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1127 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1128 | --fixed-strings |
| Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1129 | </dt> |
| 1130 | <dd> |
| 1131 | <p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1132 | Consider the limiting patterns to be fixed strings (don’t interpret |
| Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1133 | pattern as a regular expression). |
| 1134 | </p> |
| 1135 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1136 | <dt class="hdlist1"> |
| Junio C Hamano | a275c1f | 2017-06-19 20:10:12 | [diff] [blame] | 1137 | -P |
| 1138 | </dt> |
| 1139 | <dt class="hdlist1"> |
| Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1140 | --perl-regexp |
| 1141 | </dt> |
| 1142 | <dd> |
| 1143 | <p> |
| Junio C Hamano | 222ed82 | 2017-06-02 06:24:06 | [diff] [blame] | 1144 | Consider the limiting patterns to be Perl-compatible regular |
| 1145 | expressions. |
| Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1146 | </p> |
| Junio C Hamano | 222ed82 | 2017-06-02 06:24:06 | [diff] [blame] | 1147 | <div class="paragraph"><p>Support for these types of regular expressions is an optional |
| 1148 | compile-time dependency. If Git wasn’t compiled with support for them |
| 1149 | providing this option will cause it to die.</p></div> |
| Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1150 | </dd> |
| 1151 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1152 | --remove-empty |
| 1153 | </dt> |
| 1154 | <dd> |
| 1155 | <p> |
| 1156 | Stop when a given path disappears from the tree. |
| 1157 | </p> |
| 1158 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1159 | <dt class="hdlist1"> |
| Junio C Hamano | 934e178 | 2009-07-16 06:59:15 | [diff] [blame] | 1160 | --merges |
| 1161 | </dt> |
| 1162 | <dd> |
| 1163 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1164 | Print only merge commits. This is exactly the same as <code>--min-parents=2</code>. |
| Junio C Hamano | 934e178 | 2009-07-16 06:59:15 | [diff] [blame] | 1165 | </p> |
| 1166 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1167 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1168 | --no-merges |
| 1169 | </dt> |
| 1170 | <dd> |
| 1171 | <p> |
| Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1172 | Do not print commits with more than one parent. This is |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1173 | exactly the same as <code>--max-parents=1</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1174 | </p> |
| 1175 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1176 | <dt class="hdlist1"> |
| Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1177 | --min-parents=<number> |
| 1178 | </dt> |
| 1179 | <dt class="hdlist1"> |
| 1180 | --max-parents=<number> |
| 1181 | </dt> |
| 1182 | <dt class="hdlist1"> |
| 1183 | --no-min-parents |
| 1184 | </dt> |
| 1185 | <dt class="hdlist1"> |
| 1186 | --no-max-parents |
| 1187 | </dt> |
| 1188 | <dd> |
| 1189 | <p> |
| Junio C Hamano | c5bb3b3 | 2013-08-05 22:43:36 | [diff] [blame] | 1190 | Show only commits which have at least (or at most) that many parent |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1191 | commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>, |
| 1192 | <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code> |
| 1193 | gives all root commits and <code>--min-parents=3</code> all octopus merges. |
| Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1194 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1195 | <div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit) |
| 1196 | again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more |
| 1197 | parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div> |
| Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1198 | </dd> |
| 1199 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1200 | --first-parent |
| 1201 | </dt> |
| 1202 | <dd> |
| 1203 | <p> |
| 1204 | Follow only the first parent commit upon seeing a merge |
| 1205 | commit. This option can give a better overview when |
| 1206 | viewing the evolution of a particular topic branch, |
| 1207 | because merges into a topic branch tend to be only about |
| 1208 | adjusting to updated upstream from time to time, and |
| 1209 | this option allows you to ignore the individual commits |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 1210 | brought in to your history by such a merge. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1211 | </p> |
| 1212 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1213 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1214 | --not |
| 1215 | </dt> |
| 1216 | <dd> |
| 1217 | <p> |
| 1218 | Reverses the meaning of the <em>^</em> prefix (or lack thereof) |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1219 | for all following revision specifiers, up to the next <code>--not</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1220 | </p> |
| 1221 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1222 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1223 | --all |
| 1224 | </dt> |
| 1225 | <dd> |
| 1226 | <p> |
| Junio C Hamano | e89102f | 2017-02-15 23:18:15 | [diff] [blame] | 1227 | Pretend as if all the refs in <code>refs/</code>, along with <code>HEAD</code>, are |
| 1228 | listed on the command line as <em><commit></em>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1229 | </p> |
| 1230 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1231 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1232 | --branches[=<pattern>] |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1233 | </dt> |
| 1234 | <dd> |
| 1235 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1236 | Pretend as if all the refs in <code>refs/heads</code> are listed |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1237 | on the command line as <em><commit></em>. If <em><pattern></em> is given, limit |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1238 | branches to ones matching given shell glob. If pattern lacks <em>?</em>, |
| Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1239 | <em>*</em>, or <em>[</em>, <em>/*</em> at the end is implied. |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1240 | </p> |
| 1241 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1242 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1243 | --tags[=<pattern>] |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1244 | </dt> |
| 1245 | <dd> |
| 1246 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1247 | Pretend as if all the refs in <code>refs/tags</code> are listed |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1248 | on the command line as <em><commit></em>. If <em><pattern></em> is given, limit |
| Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1249 | tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>*</em>, |
| 1250 | or <em>[</em>, <em>/*</em> at the end is implied. |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1251 | </p> |
| 1252 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1253 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1254 | --remotes[=<pattern>] |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1255 | </dt> |
| 1256 | <dd> |
| 1257 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1258 | Pretend as if all the refs in <code>refs/remotes</code> are listed |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1259 | on the command line as <em><commit></em>. If <em><pattern></em> is given, limit |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1260 | remote-tracking branches to ones matching given shell glob. |
| Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1261 | If pattern lacks <em>?</em>, <em>*</em>, or <em>[</em>, <em>/*</em> at the end is implied. |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1262 | </p> |
| 1263 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1264 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1265 | --glob=<glob-pattern> |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1266 | </dt> |
| 1267 | <dd> |
| 1268 | <p> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1269 | Pretend as if all the refs matching shell glob <em><glob-pattern></em> |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1270 | are listed on the command line as <em><commit></em>. Leading <em>refs/</em>, |
| Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1271 | is automatically prepended if missing. If pattern lacks <em>?</em>, <em>*</em>, |
| 1272 | or <em>[</em>, <em>/*</em> at the end is implied. |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1273 | </p> |
| 1274 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1275 | <dt class="hdlist1"> |
| Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1276 | --exclude=<glob-pattern> |
| 1277 | </dt> |
| 1278 | <dd> |
| 1279 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1280 | Do not include refs matching <em><glob-pattern></em> that the next <code>--all</code>, |
| 1281 | <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise |
| Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1282 | consider. Repetitions of this option accumulate exclusion patterns |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1283 | up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or |
| 1284 | <code>--glob</code> option (other options or arguments do not clear |
| Junio C Hamano | fb5ffde | 2014-11-04 22:38:56 | [diff] [blame] | 1285 | accumulated patterns). |
| Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1286 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1287 | <div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or |
| 1288 | <code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>, |
| 1289 | respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code> |
| 1290 | or <code>--all</code>. If a trailing <em>/*</em> is intended, it must be given |
| Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1291 | explicitly.</p></div> |
| 1292 | </dd> |
| 1293 | <dt class="hdlist1"> |
| Junio C Hamano | 2a4bcbc | 2014-10-29 20:07:39 | [diff] [blame] | 1294 | --reflog |
| 1295 | </dt> |
| 1296 | <dd> |
| 1297 | <p> |
| 1298 | Pretend as if all objects mentioned by reflogs are listed on the |
| 1299 | command line as <code><commit></code>. |
| 1300 | </p> |
| 1301 | </dd> |
| 1302 | <dt class="hdlist1"> |
| Junio C Hamano | a42e033 | 2019-07-19 19:49:37 | [diff] [blame] | 1303 | --alternate-refs |
| 1304 | </dt> |
| 1305 | <dd> |
| 1306 | <p> |
| 1307 | Pretend as if all objects mentioned as ref tips of alternate |
| 1308 | repositories were listed on the command line. An alternate |
| 1309 | repository is any repository whose object directory is specified |
| 1310 | in <code>objects/info/alternates</code>. The set of included objects may |
| 1311 | be modified by <code>core.alternateRefsCommand</code>, etc. See |
| 1312 | <a href="git-config.html">git-config(1)</a>. |
| 1313 | </p> |
| 1314 | </dd> |
| 1315 | <dt class="hdlist1"> |
| Junio C Hamano | 8d57fa9 | 2017-09-19 05:01:08 | [diff] [blame] | 1316 | --single-worktree |
| 1317 | </dt> |
| 1318 | <dd> |
| 1319 | <p> |
| 1320 | By default, all working trees will be examined by the |
| 1321 | following options when there are more than one (see |
| 1322 | <a href="git-worktree.html">git-worktree(1)</a>): <code>--all</code>, <code>--reflog</code> and |
| 1323 | <code>--indexed-objects</code>. |
| 1324 | This option forces them to examine the current working tree |
| 1325 | only. |
| 1326 | </p> |
| 1327 | </dd> |
| 1328 | <dt class="hdlist1"> |
| Junio C Hamano | 084228c | 2011-05-30 08:13:52 | [diff] [blame] | 1329 | --ignore-missing |
| 1330 | </dt> |
| 1331 | <dd> |
| 1332 | <p> |
| 1333 | Upon seeing an invalid object name in the input, pretend as if |
| 1334 | the bad input was not given. |
| 1335 | </p> |
| 1336 | </dd> |
| 1337 | <dt class="hdlist1"> |
| Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1338 | --bisect |
| 1339 | </dt> |
| 1340 | <dd> |
| 1341 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1342 | Pretend as if the bad bisection ref <code>refs/bisect/bad</code> |
| 1343 | was listed and as if it was followed by <code>--not</code> and the good |
| 1344 | bisection refs <code>refs/bisect/good-*</code> on the command |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 1345 | line. |
| Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1346 | </p> |
| 1347 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1348 | <dt class="hdlist1"> |
| Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1349 | --stdin |
| 1350 | </dt> |
| 1351 | <dd> |
| 1352 | <p> |
| 1353 | In addition to the <em><commit></em> listed on the command |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 1354 | line, read them from the standard input. If a <code>--</code> separator is |
| Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1355 | seen, stop reading commits and start reading paths to limit the |
| 1356 | result. |
| 1357 | </p> |
| 1358 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1359 | <dt class="hdlist1"> |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1360 | --cherry-mark |
| 1361 | </dt> |
| 1362 | <dd> |
| 1363 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1364 | Like <code>--cherry-pick</code> (see below) but mark equivalent commits |
| 1365 | with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>. |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1366 | </p> |
| 1367 | </dd> |
| 1368 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1369 | --cherry-pick |
| 1370 | </dt> |
| 1371 | <dd> |
| 1372 | <p> |
| 1373 | Omit any commit that introduces the same change as |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1374 | another commit on the “other side” when the set of |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1375 | commits are limited with symmetric difference. |
| 1376 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1377 | <div class="paragraph"><p>For example, if you have two branches, <code>A</code> and <code>B</code>, a usual way |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1378 | to list all commits on only one side of them is with |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1379 | <code>--left-right</code> (see the example below in the description of |
| 1380 | the <code>--left-right</code> option). However, it shows the commits that were |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1381 | cherry-picked from the other branch (for example, “3rd on b” may be |
| 1382 | cherry-picked from branch A). With this option, such pairs of commits are |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1383 | excluded from the output.</p></div> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1384 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1385 | <dt class="hdlist1"> |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1386 | --left-only |
| 1387 | </dt> |
| 1388 | <dt class="hdlist1"> |
| 1389 | --right-only |
| 1390 | </dt> |
| 1391 | <dd> |
| 1392 | <p> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 1393 | List only commits on the respective side of a symmetric difference, |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1394 | i.e. only those which would be marked <code><</code> resp. <code>></code> by |
| 1395 | <code>--left-right</code>. |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1396 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1397 | <div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those |
| 1398 | commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in |
| 1399 | <code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>. |
| 1400 | More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1401 | list.</p></div> |
| 1402 | </dd> |
| 1403 | <dt class="hdlist1"> |
| 1404 | --cherry |
| 1405 | </dt> |
| 1406 | <dd> |
| 1407 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1408 | A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1409 | limit the output to the commits on our side and mark those that |
| 1410 | have been applied to the other side of a forked history with |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1411 | <code>git log --cherry upstream...mybranch</code>, similar to |
| 1412 | <code>git cherry upstream mybranch</code>. |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1413 | </p> |
| 1414 | </dd> |
| 1415 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1416 | -g |
| 1417 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1418 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1419 | --walk-reflogs |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1420 | </dt> |
| 1421 | <dd> |
| 1422 | <p> |
| 1423 | Instead of walking the commit ancestry chain, walk |
| 1424 | reflog entries from the most recent one to older ones. |
| 1425 | When this option is used you cannot specify commits to |
| 1426 | exclude (that is, <em>^commit</em>, <em>commit1..commit2</em>, |
| Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 1427 | and <em>commit1...commit2</em> notations cannot be used). |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1428 | </p> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 1429 | <div class="paragraph"><p>With <code>--pretty</code> format other than <code>oneline</code> and <code>reference</code> (for obvious reasons), |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1430 | this causes the output to have two extra lines of information |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 1431 | taken from the reflog. The reflog designator in the output may be shown |
| 1432 | as <code>ref@{Nth}</code> (where <code>Nth</code> is the reverse-chronological index in the |
| 1433 | reflog) or as <code>ref@{timestamp}</code> (with the timestamp for that entry), |
| 1434 | depending on a few rules:</p></div> |
| 1435 | <div class="openblock"> |
| 1436 | <div class="content"> |
| 1437 | <div class="olist arabic"><ol class="arabic"> |
| 1438 | <li> |
| 1439 | <p> |
| 1440 | If the starting point is specified as <code>ref@{Nth}</code>, show the index |
| Junio C Hamano | 2567b32 | 2019-02-05 23:33:56 | [diff] [blame] | 1441 | format. |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 1442 | </p> |
| 1443 | </li> |
| 1444 | <li> |
| 1445 | <p> |
| 1446 | If the starting point was specified as <code>ref@{now}</code>, show the |
| Junio C Hamano | 2567b32 | 2019-02-05 23:33:56 | [diff] [blame] | 1447 | timestamp format. |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 1448 | </p> |
| 1449 | </li> |
| 1450 | <li> |
| 1451 | <p> |
| 1452 | If neither was used, but <code>--date</code> was given on the command line, show |
| Junio C Hamano | 2567b32 | 2019-02-05 23:33:56 | [diff] [blame] | 1453 | the timestamp in the format requested by <code>--date</code>. |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 1454 | </p> |
| 1455 | </li> |
| 1456 | <li> |
| 1457 | <p> |
| 1458 | Otherwise, show the index format. |
| 1459 | </p> |
| 1460 | </li> |
| 1461 | </ol></div> |
| 1462 | </div></div> |
| 1463 | <div class="paragraph"><p>Under <code>--pretty=oneline</code>, the commit message is |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1464 | prefixed with this information on the same line. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1465 | This option cannot be combined with <code>--reverse</code>. |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1466 | See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 1467 | <div class="paragraph"><p>Under <code>--pretty=reference</code>, this information will not be shown at all.</p></div> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1468 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1469 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1470 | --merge |
| 1471 | </dt> |
| 1472 | <dd> |
| 1473 | <p> |
| 1474 | After a failed merge, show refs that touch files having a |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1475 | conflict and don’t exist on all heads to merge. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1476 | </p> |
| 1477 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1478 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1479 | --boundary |
| 1480 | </dt> |
| 1481 | <dd> |
| 1482 | <p> |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1483 | Output excluded boundary commits. Boundary commits are |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1484 | prefixed with <code>-</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1485 | </p> |
| 1486 | </dd> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1487 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1488 | </div> |
| 1489 | <div class="sect2"> |
| 1490 | <h3 id="_history_simplification">History Simplification</h3> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1491 | <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1492 | commits modifying a particular <path>. But there are two parts of |
| 1493 | <em>History Simplification</em>, one part is selecting the commits and the other |
| 1494 | is how to do it, as there are various strategies to simplify the history.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1495 | <div class="paragraph"><p>The following options select the commits to be shown:</p></div> |
| 1496 | <div class="dlist"><dl> |
| 1497 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1498 | <paths> |
| 1499 | </dt> |
| 1500 | <dd> |
| 1501 | <p> |
| 1502 | Commits modifying the given <paths> are selected. |
| 1503 | </p> |
| 1504 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1505 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1506 | --simplify-by-decoration |
| 1507 | </dt> |
| 1508 | <dd> |
| 1509 | <p> |
| 1510 | Commits that are referred by some branch or tag are selected. |
| 1511 | </p> |
| 1512 | </dd> |
| 1513 | </dl></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1514 | <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div> |
| 1515 | <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div> |
| 1516 | <div class="dlist"><dl> |
| 1517 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1518 | Default mode |
| 1519 | </dt> |
| 1520 | <dd> |
| 1521 | <p> |
| 1522 | Simplifies the history to the simplest history explaining the |
| 1523 | final state of the tree. Simplest because it prunes some side |
| 1524 | branches if the end result is the same (i.e. merging branches |
| 1525 | with the same content) |
| 1526 | </p> |
| 1527 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1528 | <dt class="hdlist1"> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1529 | --show-pulls |
| 1530 | </dt> |
| 1531 | <dd> |
| 1532 | <p> |
| 1533 | Include all commits from the default mode, but also any merge |
| 1534 | commits that are not TREESAME to the first parent but are |
| 1535 | TREESAME to a later parent. This mode is helpful for showing |
| 1536 | the merge commits that "first introduced" a change to a branch. |
| 1537 | </p> |
| 1538 | </dd> |
| 1539 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1540 | --full-history |
| 1541 | </dt> |
| 1542 | <dd> |
| 1543 | <p> |
| Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 1544 | Same as the default mode, but does not prune some history. |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1545 | </p> |
| 1546 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1547 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1548 | --dense |
| 1549 | </dt> |
| 1550 | <dd> |
| 1551 | <p> |
| 1552 | Only the selected commits are shown, plus some to have a |
| 1553 | meaningful history. |
| 1554 | </p> |
| 1555 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1556 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1557 | --sparse |
| 1558 | </dt> |
| 1559 | <dd> |
| 1560 | <p> |
| 1561 | All commits in the simplified history are shown. |
| 1562 | </p> |
| 1563 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1564 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1565 | --simplify-merges |
| 1566 | </dt> |
| 1567 | <dd> |
| 1568 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1569 | Additional option to <code>--full-history</code> to remove some needless |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1570 | merges from the resulting history, as there are no selected |
| 1571 | commits contributing to this merge. |
| 1572 | </p> |
| 1573 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1574 | <dt class="hdlist1"> |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1575 | --ancestry-path |
| 1576 | </dt> |
| 1577 | <dd> |
| 1578 | <p> |
| 1579 | When given a range of commits to display (e.g. <em>commit1..commit2</em> |
| 1580 | or <em>commit2 ^commit1</em>), only display commits that exist |
| 1581 | directly on the ancestry chain between the <em>commit1</em> and |
| 1582 | <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>, |
| 1583 | and ancestors of <em>commit2</em>. |
| 1584 | </p> |
| 1585 | </dd> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1586 | </dl></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1587 | <div class="paragraph"><p>A more detailed explanation follows.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1588 | <div class="paragraph"><p>Suppose you specified <code>foo</code> as the <paths>. We shall call commits |
| 1589 | that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff |
| 1590 | filtered for <code>foo</code>, they look different and equal, respectively.)</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1591 | <div class="paragraph"><p>In the following, we will always refer to the same example history to |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1592 | illustrate the differences between simplification settings. We assume |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1593 | that you are filtering for a file <code>foo</code> in this commit graph:</p></div> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1594 | <div class="listingblock"> |
| 1595 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1596 | <pre><code> .-A---M---N---O---P---Q |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1597 | / / / / / / |
| 1598 | I B C D E Y |
| 1599 | \ / / / / / |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1600 | `-------------' X</code></pre> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1601 | </div></div> |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1602 | <div class="paragraph"><p>The horizontal line of history A---Q is taken to be the first parent of |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1603 | each merge. The commits are:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1604 | <div class="ulist"><ul> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1605 | <li> |
| 1606 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1607 | <code>I</code> is the initial commit, in which <code>foo</code> exists with contents |
| 1608 | “asdf”, and a file <code>quux</code> exists with contents “quux”. Initial |
| 1609 | commits are compared to an empty tree, so <code>I</code> is !TREESAME. |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1610 | </p> |
| 1611 | </li> |
| 1612 | <li> |
| 1613 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1614 | In <code>A</code>, <code>foo</code> contains just “foo”. |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1615 | </p> |
| 1616 | </li> |
| 1617 | <li> |
| 1618 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1619 | <code>B</code> contains the same change as <code>A</code>. Its merge <code>M</code> is trivial and |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1620 | hence TREESAME to all parents. |
| 1621 | </p> |
| 1622 | </li> |
| 1623 | <li> |
| 1624 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1625 | <code>C</code> does not change <code>foo</code>, but its merge <code>N</code> changes it to “foobar”, |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1626 | so it is not TREESAME to any parent. |
| 1627 | </p> |
| 1628 | </li> |
| 1629 | <li> |
| 1630 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1631 | <code>D</code> sets <code>foo</code> to “baz”. Its merge <code>O</code> combines the strings from |
| 1632 | <code>N</code> and <code>D</code> to “foobarbaz”; i.e., it is not TREESAME to any parent. |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1633 | </p> |
| 1634 | </li> |
| 1635 | <li> |
| 1636 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1637 | <code>E</code> changes <code>quux</code> to “xyzzy”, and its merge <code>P</code> combines the |
| 1638 | strings to “quux xyzzy”. <code>P</code> is TREESAME to <code>O</code>, but not to <code>E</code>. |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1639 | </p> |
| 1640 | </li> |
| 1641 | <li> |
| 1642 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1643 | <code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code> |
| 1644 | modified it. <code>Y</code> is TREESAME to <code>X</code>. Its merge <code>Q</code> added <code>side</code> to <code>P</code>, and |
| 1645 | <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>. |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1646 | </p> |
| 1647 | </li> |
| 1648 | </ul></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1649 | <div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding |
| 1650 | commits based on whether <code>--full-history</code> and/or parent rewriting |
| 1651 | (via <code>--parents</code> or <code>--children</code>) are used. The following settings |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1652 | are available.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1653 | <div class="dlist"><dl> |
| 1654 | <dt class="hdlist1"> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1655 | Default mode |
| 1656 | </dt> |
| 1657 | <dd> |
| 1658 | <p> |
| 1659 | Commits are included if they are not TREESAME to any parent |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1660 | (though this can be changed, see <code>--sparse</code> below). If the |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1661 | commit was a merge, and it was TREESAME to one parent, follow |
| 1662 | only that parent. (Even if there are several TREESAME |
| 1663 | parents, follow only one of them.) Otherwise, follow all |
| 1664 | parents. |
| 1665 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1666 | <div class="paragraph"><p>This results in:</p></div> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1667 | <div class="listingblock"> |
| 1668 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1669 | <pre><code> .-A---N---O |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1670 | / / / |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1671 | I---------D</code></pre> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1672 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1673 | <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1674 | available, removed <code>B</code> from consideration entirely. <code>C</code> was |
| 1675 | considered via <code>N</code>, but is TREESAME. Root commits are compared to an |
| 1676 | empty tree, so <code>I</code> is !TREESAME.</p></div> |
| 1677 | <div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1678 | not affect the commits selected in default mode, so we have shown the |
| 1679 | parent lines.</p></div> |
| 1680 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1681 | <dt class="hdlist1"> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1682 | --full-history without parent rewriting |
| 1683 | </dt> |
| 1684 | <dd> |
| 1685 | <p> |
| 1686 | This mode differs from the default in one point: always follow |
| 1687 | all parents of a merge, even if it is TREESAME to one of them. |
| 1688 | Even if more than one side of the merge has commits that are |
| 1689 | included, this does not imply that the merge itself is! In |
| 1690 | the example, we get |
| 1691 | </p> |
| 1692 | <div class="listingblock"> |
| 1693 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1694 | <pre><code> I A B N D O P Q</code></pre> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1695 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1696 | <div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>, |
| 1697 | <code>C</code> and <code>B</code> were all walked, but only <code>B</code> was !TREESAME, so the others |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1698 | do not appear.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1699 | <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1700 | about the parent/child relationships between the commits, so we show |
| 1701 | them disconnected.</p></div> |
| 1702 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1703 | <dt class="hdlist1"> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1704 | --full-history with parent rewriting |
| 1705 | </dt> |
| 1706 | <dd> |
| 1707 | <p> |
| 1708 | Ordinary commits are only included if they are !TREESAME |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1709 | (though this can be changed, see <code>--sparse</code> below). |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1710 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1711 | <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten: |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1712 | Along each parent, prune away commits that are not included |
| 1713 | themselves. This results in</p></div> |
| 1714 | <div class="listingblock"> |
| 1715 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1716 | <pre><code> .-A---M---N---O---P---Q |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1717 | / / / / / |
| 1718 | I B / D / |
| 1719 | \ / / / / |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1720 | `-------------'</code></pre> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1721 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1722 | <div class="paragraph"><p>Compare to <code>--full-history</code> without rewriting above. Note that <code>E</code> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1723 | was pruned away because it is TREESAME, but the parent list of P was |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1724 | rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and |
| 1725 | <code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1726 | </dd> |
| 1727 | </dl></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1728 | <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1729 | affects inclusion:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1730 | <div class="dlist"><dl> |
| 1731 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1732 | --dense |
| 1733 | </dt> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1734 | <dd> |
| 1735 | <p> |
| 1736 | Commits that are walked are included if they are not TREESAME |
| 1737 | to any parent. |
| 1738 | </p> |
| 1739 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1740 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1741 | --sparse |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1742 | </dt> |
| 1743 | <dd> |
| 1744 | <p> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1745 | All commits that are walked are included. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1746 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1747 | <div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1748 | one of the parents is TREESAME, we follow only that one, so the other |
| 1749 | sides of the merge are never walked.</p></div> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1750 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1751 | <dt class="hdlist1"> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1752 | --simplify-merges |
| 1753 | </dt> |
| 1754 | <dd> |
| 1755 | <p> |
| 1756 | First, build a history graph in the same way that |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1757 | <code>--full-history</code> with parent rewriting does (see above). |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1758 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1759 | <div class="paragraph"><p>Then simplify each commit <code>C</code> to its replacement <code>C'</code> in the final |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1760 | history according to the following rules:</p></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1761 | <div class="openblock"> |
| 1762 | <div class="content"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1763 | <div class="ulist"><ul> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1764 | <li> |
| 1765 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1766 | Set <code>C'</code> to <code>C</code>. |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1767 | </p> |
| 1768 | </li> |
| 1769 | <li> |
| 1770 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1771 | Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1772 | the process, drop parents that are ancestors of other parents or that are |
| 1773 | root commits TREESAME to an empty tree, and remove duplicates, but take care |
| 1774 | to never drop all parents that we are TREESAME to. |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1775 | </p> |
| 1776 | </li> |
| 1777 | <li> |
| 1778 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1779 | If after this parent rewriting, <code>C'</code> is a root or merge commit (has |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1780 | zero or >1 parents), a boundary commit, or !TREESAME, it remains. |
| 1781 | Otherwise, it is replaced with its only parent. |
| 1782 | </p> |
| 1783 | </li> |
| 1784 | </ul></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1785 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1786 | <div class="paragraph"><p>The effect of this is best shown by way of comparing to |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1787 | <code>--full-history</code> with parent rewriting. The example turns into:</p></div> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1788 | <div class="listingblock"> |
| 1789 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1790 | <pre><code> .-A---M---N---O |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1791 | / / / |
| 1792 | I B D |
| 1793 | \ / / |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1794 | `---------'</code></pre> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1795 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1796 | <div class="paragraph"><p>Note the major differences in <code>N</code>, <code>P</code>, and <code>Q</code> over <code>--full-history</code>:</p></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1797 | <div class="openblock"> |
| 1798 | <div class="content"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1799 | <div class="ulist"><ul> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1800 | <li> |
| 1801 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1802 | <code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the |
| 1803 | other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME. |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1804 | </p> |
| 1805 | </li> |
| 1806 | <li> |
| 1807 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1808 | <code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1809 | removed completely, because it had one parent and is TREESAME. |
| 1810 | </p> |
| 1811 | </li> |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1812 | <li> |
| 1813 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1814 | <code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it |
| 1815 | was a TREESAME root. <code>Q</code> was then removed completely, because it had one |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1816 | parent and is TREESAME. |
| 1817 | </p> |
| 1818 | </li> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1819 | </ul></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1820 | </div></div> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1821 | </dd> |
| 1822 | </dl></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1823 | <div class="paragraph"><p>There is another simplification mode available:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1824 | <div class="dlist"><dl> |
| 1825 | <dt class="hdlist1"> |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1826 | --ancestry-path |
| 1827 | </dt> |
| 1828 | <dd> |
| 1829 | <p> |
| 1830 | Limit the displayed commits to those directly on the ancestry |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1831 | chain between the “from” and “to” commits in the given commit |
| 1832 | range. I.e. only display commits that are ancestor of the “to” |
| 1833 | commit and descendants of the “from” commit. |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1834 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1835 | <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div> |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1836 | <div class="listingblock"> |
| 1837 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1838 | <pre><code> D---E-------F |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1839 | / \ \ |
| 1840 | B---C---G---H---I---J |
| 1841 | / \ |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1842 | A-------K---------------L--M</code></pre> |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1843 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1844 | <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>, |
| 1845 | but excludes the ones that are ancestors of <code>D</code>. This is useful to see |
| 1846 | what happened to the history leading to <code>M</code> since <code>D</code>, in the sense |
| 1847 | that “what does <code>M</code> have that did not exist in <code>D</code>”. The result in this |
| 1848 | example would be all the commits, except <code>A</code> and <code>B</code> (and <code>D</code> itself, |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1849 | of course).</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1850 | <div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the |
| 1851 | bug introduced by <code>D</code> and need fixing, however, we might want to view |
| 1852 | only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e. |
| 1853 | excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code> |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1854 | option does. Applied to the <em>D..M</em> range, it results in:</p></div> |
| 1855 | <div class="listingblock"> |
| 1856 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1857 | <pre><code> E-------F |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1858 | \ \ |
| 1859 | G---H---I---J |
| 1860 | \ |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1861 | L--M</code></pre> |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1862 | </div></div> |
| 1863 | </dd> |
| 1864 | </dl></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1865 | <div class="paragraph"><p>Before discussing another option, <code>--show-pulls</code>, we need to |
| 1866 | create a new example history.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1867 | <div class="paragraph"><p>A common problem users face when looking at simplified history is that a |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1868 | commit they know changed a file somehow does not appear in the file’s |
| 1869 | simplified history. Let’s demonstrate a new example and show how options |
| 1870 | such as <code>--full-history</code> and <code>--simplify-merges</code> works in that case:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1871 | <div class="listingblock"> |
| 1872 | <div class="content"> |
| 1873 | <pre><code> .-A---M-----C--N---O---P |
| 1874 | / / \ \ \/ / / |
| 1875 | I B \ R-'`-Z' / |
| 1876 | \ / \/ / |
| 1877 | \ / /\ / |
| 1878 | `---X--' `---Y--'</code></pre> |
| 1879 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1880 | <div class="paragraph"><p>For this example, suppose <code>I</code> created <code>file.txt</code> which was modified by |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1881 | <code>A</code>, <code>B</code>, and <code>X</code> in different ways. The single-parent commits <code>C</code>, <code>Z</code>, |
| 1882 | and <code>Y</code> do not change <code>file.txt</code>. The merge commit <code>M</code> was created by |
| 1883 | resolving the merge conflict to include both changes from <code>A</code> and <code>B</code> |
| 1884 | and hence is not TREESAME to either. The merge commit <code>R</code>, however, was |
| 1885 | created by ignoring the contents of <code>file.txt</code> at <code>M</code> and taking only |
| 1886 | the contents of <code>file.txt</code> at <code>X</code>. Hence, <code>R</code> is TREESAME to <code>X</code> but not |
| 1887 | <code>M</code>. Finally, the natural merge resolution to create <code>N</code> is to take the |
| 1888 | contents of <code>file.txt</code> at <code>R</code>, so <code>N</code> is TREESAME to <code>R</code> but not <code>C</code>. |
| 1889 | The merge commits <code>O</code> and <code>P</code> are TREESAME to their first parents, but |
| 1890 | not to their second parents, <code>Z</code> and <code>Y</code> respectively.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1891 | <div class="paragraph"><p>When using the default mode, <code>N</code> and <code>R</code> both have a TREESAME parent, so |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1892 | those edges are walked and the others are ignored. The resulting history |
| 1893 | graph is:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1894 | <div class="listingblock"> |
| 1895 | <div class="content"> |
| 1896 | <pre><code> I---X</code></pre> |
| 1897 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1898 | <div class="paragraph"><p>When using <code>--full-history</code>, Git walks every edge. This will discover |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1899 | the commits <code>A</code> and <code>B</code> and the merge <code>M</code>, but also will reveal the |
| 1900 | merge commits <code>O</code> and <code>P</code>. With parent rewriting, the resulting graph is:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1901 | <div class="listingblock"> |
| 1902 | <div class="content"> |
| 1903 | <pre><code> .-A---M--------N---O---P |
| 1904 | / / \ \ \/ / / |
| 1905 | I B \ R-'`--' / |
| 1906 | \ / \/ / |
| 1907 | \ / /\ / |
| 1908 | `---X--' `------'</code></pre> |
| 1909 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1910 | <div class="paragraph"><p>Here, the merge commits <code>O</code> and <code>P</code> contribute extra noise, as they did |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1911 | not actually contribute a change to <code>file.txt</code>. They only merged a topic |
| 1912 | that was based on an older version of <code>file.txt</code>. This is a common |
| 1913 | issue in repositories using a workflow where many contributors work in |
| 1914 | parallel and merge their topic branches along a single trunk: manu |
| 1915 | unrelated merges appear in the <code>--full-history</code> results.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1916 | <div class="paragraph"><p>When using the <code>--simplify-merges</code> option, the commits <code>O</code> and <code>P</code> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1917 | disappear from the results. This is because the rewritten second parents |
| 1918 | of <code>O</code> and <code>P</code> are reachable from their first parents. Those edges are |
| 1919 | removed and then the commits look like single-parent commits that are |
| 1920 | TREESAME to their parent. This also happens to the commit <code>N</code>, resulting |
| 1921 | in a history view as follows:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1922 | <div class="listingblock"> |
| 1923 | <div class="content"> |
| 1924 | <pre><code> .-A---M--. |
| 1925 | / / \ |
| 1926 | I B R |
| 1927 | \ / / |
| 1928 | \ / / |
| 1929 | `---X--'</code></pre> |
| 1930 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1931 | <div class="paragraph"><p>In this view, we see all of the important single-parent changes from |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1932 | <code>A</code>, <code>B</code>, and <code>X</code>. We also see the carefully-resolved merge <code>M</code> and the |
| 1933 | not-so-carefully-resolved merge <code>R</code>. This is usually enough information |
| 1934 | to determine why the commits <code>A</code> and <code>B</code> "disappeared" from history in |
| 1935 | the default view. However, there are a few issues with this approach.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1936 | <div class="paragraph"><p>The first issue is performance. Unlike any previous option, the |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1937 | <code>--simplify-merges</code> option requires walking the entire commit history |
| 1938 | before returning a single result. This can make the option difficult to |
| 1939 | use for very large repositories.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1940 | <div class="paragraph"><p>The second issue is one of auditing. When many contributors are working |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1941 | on the same repository, it is important which merge commits introduced |
| 1942 | a change into an important branch. The problematic merge <code>R</code> above is |
| 1943 | not likely to be the merge commit that was used to merge into an |
| 1944 | important branch. Instead, the merge <code>N</code> was used to merge <code>R</code> and <code>X</code> |
| 1945 | into the important branch. This commit may have information about why |
| 1946 | the change <code>X</code> came to override the changes from <code>A</code> and <code>B</code> in its |
| 1947 | commit message.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1948 | <div class="dlist"><dl> |
| 1949 | <dt class="hdlist1"> |
| 1950 | --show-pulls |
| 1951 | </dt> |
| 1952 | <dd> |
| 1953 | <p> |
| 1954 | In addition to the commits shown in the default history, show |
| 1955 | each merge commit that is not TREESAME to its first parent but |
| 1956 | is TREESAME to a later parent. |
| 1957 | </p> |
| 1958 | <div class="paragraph"><p>When a merge commit is included by <code>--show-pulls</code>, the merge is |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1959 | treated as if it "pulled" the change from another branch. When using |
| 1960 | <code>--show-pulls</code> on this example (and no other options) the resulting |
| 1961 | graph is:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1962 | <div class="listingblock"> |
| 1963 | <div class="content"> |
| 1964 | <pre><code> I---X---R---N</code></pre> |
| 1965 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1966 | <div class="paragraph"><p>Here, the merge commits <code>R</code> and <code>N</code> are included because they pulled |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1967 | the commits <code>X</code> and <code>R</code> into the base branch, respectively. These |
| 1968 | merges are the reason the commits <code>A</code> and <code>B</code> do not appear in the |
| 1969 | default history.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1970 | <div class="paragraph"><p>When <code>--show-pulls</code> is paired with <code>--simplify-merges</code>, the |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1971 | graph includes all of the necessary information:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1972 | <div class="listingblock"> |
| 1973 | <div class="content"> |
| 1974 | <pre><code> .-A---M--. N |
| 1975 | / / \ / |
| 1976 | I B R |
| 1977 | \ / / |
| 1978 | \ / / |
| 1979 | `---X--'</code></pre> |
| 1980 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1981 | <div class="paragraph"><p>Notice that since <code>M</code> is reachable from <code>R</code>, the edge from <code>N</code> to <code>M</code> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1982 | was simplified away. However, <code>N</code> still appears in the history as an |
| 1983 | important commit because it "pulled" the change <code>R</code> into the main |
| 1984 | branch.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1985 | </dd> |
| 1986 | </dl></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1987 | <div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1988 | big picture of the topology of the history, by omitting commits |
| 1989 | that are not referenced by tags. Commits are marked as !TREESAME |
| 1990 | (in other words, kept after history simplification rules described |
| 1991 | above) if (1) they are referenced by tags, or (2) they change the |
| 1992 | contents of the paths given on the command line. All other |
| 1993 | commits are marked as TREESAME (subject to be simplified away).</p></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1994 | </div> |
| 1995 | <div class="sect2"> |
| 1996 | <h3 id="_commit_ordering">Commit Ordering</h3> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1997 | <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div> |
| 1998 | <div class="dlist"><dl> |
| 1999 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2000 | --date-order |
| 2001 | </dt> |
| 2002 | <dd> |
| 2003 | <p> |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2004 | Show no parents before all of its children are shown, but |
| 2005 | otherwise show commits in the commit timestamp order. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2006 | </p> |
| 2007 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2008 | <dt class="hdlist1"> |
| Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 2009 | --author-date-order |
| 2010 | </dt> |
| 2011 | <dd> |
| 2012 | <p> |
| 2013 | Show no parents before all of its children are shown, but |
| 2014 | otherwise show commits in the author timestamp order. |
| 2015 | </p> |
| 2016 | </dd> |
| 2017 | <dt class="hdlist1"> |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2018 | --topo-order |
| 2019 | </dt> |
| 2020 | <dd> |
| 2021 | <p> |
| 2022 | Show no parents before all of its children are shown, and |
| 2023 | avoid showing commits on multiple lines of history |
| 2024 | intermixed. |
| 2025 | </p> |
| 2026 | <div class="paragraph"><p>For example, in a commit history like this:</p></div> |
| 2027 | <div class="listingblock"> |
| 2028 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2029 | <pre><code> ---1----2----4----7 |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2030 | \ \ |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2031 | 3----5----6----8---</code></pre> |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2032 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2033 | <div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git |
| 2034 | rev-list</code> and friends with <code>--date-order</code> show the commits in the |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2035 | timestamp order: 8 7 6 5 4 3 2 1.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2036 | <div class="paragraph"><p>With <code>--topo-order</code>, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5 |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2037 | 3 1); some older commits are shown before newer ones in order to |
| 2038 | avoid showing the commits from two parallel development track mixed |
| 2039 | together.</p></div> |
| 2040 | </dd> |
| 2041 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2042 | --reverse |
| 2043 | </dt> |
| 2044 | <dd> |
| 2045 | <p> |
| Junio C Hamano | f3ca7b8 | 2016-10-03 22:27:02 | [diff] [blame] | 2046 | Output the commits chosen to be shown (see Commit Limiting |
| 2047 | section above) in reverse order. Cannot be combined with |
| 2048 | <code>--walk-reflogs</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2049 | </p> |
| 2050 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2051 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2052 | </div> |
| 2053 | <div class="sect2"> |
| 2054 | <h3 id="_object_traversal">Object Traversal</h3> |
| Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 2055 | <div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2056 | <div class="dlist"><dl> |
| 2057 | <dt class="hdlist1"> |
| Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 2058 | --no-walk[=(sorted|unsorted)] |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2059 | </dt> |
| 2060 | <dd> |
| 2061 | <p> |
| Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 2062 | Only show the given commits, but do not traverse their ancestors. |
| 2063 | This has no effect if a range is specified. If the argument |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2064 | <code>unsorted</code> is given, the commits are shown in the order they were |
| 2065 | given on the command line. Otherwise (if <code>sorted</code> or no argument |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 2066 | was given), the commits are shown in reverse chronological order |
| Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 2067 | by commit time. |
| Junio C Hamano | ef57d1e | 2015-03-25 21:23:00 | [diff] [blame] | 2068 | Cannot be combined with <code>--graph</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2069 | </p> |
| 2070 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2071 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2072 | --do-walk |
| 2073 | </dt> |
| 2074 | <dd> |
| 2075 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2076 | Overrides a previous <code>--no-walk</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2077 | </p> |
| 2078 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2079 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2080 | </div> |
| 2081 | <div class="sect2"> |
| 2082 | <h3 id="_commit_formatting">Commit Formatting</h3> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2083 | <div class="dlist"><dl> |
| 2084 | <dt class="hdlist1"> |
| 2085 | --pretty[=<format>] |
| 2086 | </dt> |
| 2087 | <dt class="hdlist1"> |
| 2088 | --format=<format> |
| 2089 | </dt> |
| 2090 | <dd> |
| 2091 | <p> |
| 2092 | Pretty-print the contents of the commit logs in a given format, |
| 2093 | where <em><format></em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>, |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2094 | <em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:<string></em> |
| Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 2095 | and <em>tformat:<string></em>. When <em><format></em> is none of the above, |
| 2096 | and has <em>%placeholder</em> in it, it acts as if |
| 2097 | <em>--pretty=tformat:<format></em> were given. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2098 | </p> |
| Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 2099 | <div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each |
| 2100 | format. When <em>=<format></em> part is omitted, it defaults to <em>medium</em>.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2101 | <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] | 2102 | configuration (see <a href="git-config.html">git-config(1)</a>).</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2103 | </dd> |
| 2104 | <dt class="hdlist1"> |
| 2105 | --abbrev-commit |
| 2106 | </dt> |
| 2107 | <dd> |
| 2108 | <p> |
| 2109 | Instead of showing the full 40-byte hexadecimal commit object |
| 2110 | name, show only a partial prefix. Non default number of |
| 2111 | digits can be specified with "--abbrev=<n>" (which also modifies |
| 2112 | diff output, if it is displayed). |
| 2113 | </p> |
| 2114 | <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for |
| 2115 | people using 80-column terminals.</p></div> |
| 2116 | </dd> |
| 2117 | <dt class="hdlist1"> |
| Junio C Hamano | f93530e | 2011-05-25 23:59:59 | [diff] [blame] | 2118 | --no-abbrev-commit |
| 2119 | </dt> |
| 2120 | <dd> |
| 2121 | <p> |
| 2122 | Show the full 40-byte hexadecimal commit object name. This negates |
| Junio C Hamano | 558abd2 | 2020-09-03 20:22:34 | [diff] [blame] | 2123 | <code>--abbrev-commit</code>, either explicit or implied by other options such |
| 2124 | as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable. |
| Junio C Hamano | f93530e | 2011-05-25 23:59:59 | [diff] [blame] | 2125 | </p> |
| 2126 | </dd> |
| 2127 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2128 | --oneline |
| 2129 | </dt> |
| 2130 | <dd> |
| 2131 | <p> |
| 2132 | This is a shorthand for "--pretty=oneline --abbrev-commit" |
| 2133 | used together. |
| 2134 | </p> |
| 2135 | </dd> |
| 2136 | <dt class="hdlist1"> |
| Junio C Hamano | c5bb3b3 | 2013-08-05 22:43:36 | [diff] [blame] | 2137 | --encoding=<encoding> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2138 | </dt> |
| 2139 | <dd> |
| 2140 | <p> |
| 2141 | The commit objects record the encoding used for the log message |
| 2142 | in their encoding header; this option can be used to tell the |
| 2143 | command to re-code the commit log message in the encoding |
| 2144 | preferred by the user. For non plumbing commands this |
| Junio C Hamano | 823eebb | 2015-07-10 22:29:34 | [diff] [blame] | 2145 | defaults to UTF-8. Note that if an object claims to be encoded |
| 2146 | in <code>X</code> and we are outputting in <code>X</code>, we will output the object |
| 2147 | verbatim; this means that invalid sequences in the original |
| 2148 | commit may be copied to the output. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2149 | </p> |
| 2150 | </dd> |
| 2151 | <dt class="hdlist1"> |
| Junio C Hamano | 5996b67 | 2016-04-13 22:01:41 | [diff] [blame] | 2152 | --expand-tabs=<n> |
| 2153 | </dt> |
| 2154 | <dt class="hdlist1"> |
| 2155 | --expand-tabs |
| 2156 | </dt> |
| 2157 | <dt class="hdlist1"> |
| 2158 | --no-expand-tabs |
| 2159 | </dt> |
| 2160 | <dd> |
| 2161 | <p> |
| 2162 | Perform a tab expansion (replace each tab with enough spaces |
| 2163 | to fill to the next display column that is multiple of <em><n></em>) |
| 2164 | in the log message before showing it in the output. |
| 2165 | <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and |
| 2166 | <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>, |
| 2167 | which disables tab expansion. |
| 2168 | </p> |
| 2169 | <div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log |
| 2170 | message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>, |
| 2171 | and <em>fuller</em>).</p></div> |
| 2172 | </dd> |
| 2173 | <dt class="hdlist1"> |
| Junio C Hamano | b3f862c | 2019-12-05 22:22:00 | [diff] [blame] | 2174 | --notes[=<ref>] |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2175 | </dt> |
| 2176 | <dd> |
| 2177 | <p> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2178 | Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2179 | commit, when showing the commit log message. This is the default |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2180 | for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when |
| 2181 | 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] | 2182 | on the command line. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2183 | </p> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2184 | <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the |
| Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 2185 | <code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2186 | environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div> |
| Junio C Hamano | b3f862c | 2019-12-05 22:22:00 | [diff] [blame] | 2187 | <div class="paragraph"><p>With an optional <em><ref></em> argument, use the ref to find the notes |
| 2188 | to display. The ref can specify the full refname when it begins |
| Junio C Hamano | 1f7c4a5 | 2015-10-14 22:15:51 | [diff] [blame] | 2189 | with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise |
| 2190 | <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] | 2191 | <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are |
| 2192 | being displayed. Examples: "--notes=foo" will show only notes from |
| 2193 | "refs/notes/foo"; "--notes=foo --notes" will show both notes from |
| 2194 | "refs/notes/foo" and from the default notes ref(s).</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2195 | </dd> |
| 2196 | <dt class="hdlist1"> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2197 | --no-notes |
| 2198 | </dt> |
| 2199 | <dd> |
| 2200 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2201 | 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] | 2202 | resetting the list of notes refs from which notes are shown. |
| 2203 | Options are parsed in the order given on the command line, so e.g. |
| 2204 | "--notes --notes=foo --no-notes --notes=bar" will only show notes |
| 2205 | from "refs/notes/bar". |
| 2206 | </p> |
| 2207 | </dd> |
| 2208 | <dt class="hdlist1"> |
| Junio C Hamano | b3f862c | 2019-12-05 22:22:00 | [diff] [blame] | 2209 | --show-notes[=<ref>] |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2210 | </dt> |
| 2211 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2212 | --[no-]standard-notes |
| 2213 | </dt> |
| 2214 | <dd> |
| 2215 | <p> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2216 | These options are deprecated. Use the above --notes/--no-notes |
| 2217 | options instead. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2218 | </p> |
| 2219 | </dd> |
| 2220 | <dt class="hdlist1"> |
| Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2221 | --show-signature |
| 2222 | </dt> |
| 2223 | <dd> |
| 2224 | <p> |
| 2225 | Check the validity of a signed commit object by passing the signature |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2226 | to <code>gpg --verify</code> and show the output. |
| Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2227 | </p> |
| 2228 | </dd> |
| 2229 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2230 | --relative-date |
| 2231 | </dt> |
| 2232 | <dd> |
| 2233 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2234 | Synonym for <code>--date=relative</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2235 | </p> |
| 2236 | </dd> |
| 2237 | <dt class="hdlist1"> |
| Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 2238 | --date=<format> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2239 | </dt> |
| 2240 | <dd> |
| 2241 | <p> |
| 2242 | Only takes effect for dates shown in human-readable format, such |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2243 | as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default |
| Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 2244 | value for the log command’s <code>--date</code> option. By default, dates |
| 2245 | are shown in the original time zone (either committer’s or |
| 2246 | author’s). If <code>-local</code> is appended to the format (e.g., |
| 2247 | <code>iso-local</code>), the user’s local time zone is used instead. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2248 | </p> |
| Junio C Hamano | b551377 | 2019-04-22 03:38:39 | [diff] [blame] | 2249 | <div class="openblock"> |
| 2250 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2251 | <div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time, |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 2252 | e.g. “2 hours ago”. The <code>-local</code> option has no effect for |
| 2253 | <code>--date=relative</code>.</p></div> |
| Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 2254 | <div class="paragraph"><p><code>--date=local</code> is an alias for <code>--date=default-local</code>.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2255 | <div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format. |
| 2256 | The differences to the strict ISO 8601 format are:</p></div> |
| 2257 | <div class="ulist"><ul> |
| 2258 | <li> |
| 2259 | <p> |
| 2260 | a space instead of the <code>T</code> date/time delimiter |
| 2261 | </p> |
| 2262 | </li> |
| 2263 | <li> |
| 2264 | <p> |
| 2265 | a space between time and time zone |
| 2266 | </p> |
| 2267 | </li> |
| 2268 | <li> |
| 2269 | <p> |
| 2270 | no colon between hours and minutes of the time zone |
| 2271 | </p> |
| 2272 | </li> |
| 2273 | </ul></div> |
| 2274 | <div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict |
| 2275 | ISO 8601 format.</p></div> |
| 2276 | <div class="paragraph"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822 |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 2277 | format, often found in email messages.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2278 | <div class="paragraph"><p><code>--date=short</code> shows only the date, but not the time, in <code>YYYY-MM-DD</code> format.</p></div> |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 2279 | <div class="paragraph"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01 |
| 2280 | 00:00:00 UTC), followed by a space, and then the timezone as an offset |
| 2281 | from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and |
| 2282 | the second two are minutes). I.e., as if the timestamp were formatted |
| 2283 | with <code>strftime("%s %z")</code>). |
| 2284 | Note that the <code>-local</code> option does not affect the seconds-since-epoch |
| 2285 | value (which is always measured in UTC), but does switch the accompanying |
| 2286 | timezone value.</p></div> |
| Junio C Hamano | 23168ef | 2019-02-07 07:20:47 | [diff] [blame] | 2287 | <div class="paragraph"><p><code>--date=human</code> shows the timezone if the timezone does not match the |
| 2288 | current time-zone, and doesn’t print the whole date if that matches |
| 2289 | (ie skip printing year for dates that are "this year", but also skip |
| 2290 | the whole date itself if it’s in the last few days and we can just say |
| 2291 | what weekday it was). For older dates the hour and minute is also |
| 2292 | omitted.</p></div> |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 2293 | <div class="paragraph"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since |
| 2294 | 1970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code> |
| 2295 | has no effect.</p></div> |
| Junio C Hamano | 55d9191 | 2017-06-22 22:32:46 | [diff] [blame] | 2296 | <div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>, |
| 2297 | except for %z and %Z, which are handled internally. |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 2298 | Use <code>--date=format:%c</code> to show the date in your system locale’s |
| 2299 | preferred format. See the <code>strftime</code> manual for a complete list of |
| Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 2300 | format placeholders. When using <code>-local</code>, the correct syntax is |
| 2301 | <code>--date=format-local:...</code>.</p></div> |
| 2302 | <div class="paragraph"><p><code>--date=default</code> is the default format, and is similar to |
| 2303 | <code>--date=rfc2822</code>, with a few exceptions:</p></div> |
| Junio C Hamano | b551377 | 2019-04-22 03:38:39 | [diff] [blame] | 2304 | </div></div> |
| Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 2305 | <div class="ulist"><ul> |
| 2306 | <li> |
| 2307 | <p> |
| 2308 | there is no comma after the day-of-week |
| 2309 | </p> |
| 2310 | </li> |
| 2311 | <li> |
| 2312 | <p> |
| 2313 | the time zone is omitted when the local time zone is used |
| 2314 | </p> |
| 2315 | </li> |
| 2316 | </ul></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2317 | </dd> |
| 2318 | <dt class="hdlist1"> |
| 2319 | --parents |
| 2320 | </dt> |
| 2321 | <dd> |
| 2322 | <p> |
| 2323 | Print also the parents of the commit (in the form "commit parent…"). |
| Junio C Hamano | ce019c0 | 2017-10-30 05:57:46 | [diff] [blame] | 2324 | Also enables parent rewriting, see <em>History Simplification</em> above. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2325 | </p> |
| 2326 | </dd> |
| 2327 | <dt class="hdlist1"> |
| 2328 | --children |
| 2329 | </dt> |
| 2330 | <dd> |
| 2331 | <p> |
| 2332 | Print also the children of the commit (in the form "commit child…"). |
| Junio C Hamano | ce019c0 | 2017-10-30 05:57:46 | [diff] [blame] | 2333 | Also enables parent rewriting, see <em>History Simplification</em> above. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2334 | </p> |
| 2335 | </dd> |
| 2336 | <dt class="hdlist1"> |
| 2337 | --left-right |
| 2338 | </dt> |
| 2339 | <dd> |
| 2340 | <p> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 2341 | Mark which side of a symmetric difference a commit is reachable from. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2342 | Commits from the left side are prefixed with <code><</code> and those from |
| 2343 | the right with <code>></code>. If combined with <code>--boundary</code>, those |
| 2344 | commits are prefixed with <code>-</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2345 | </p> |
| 2346 | <div class="paragraph"><p>For example, if you have this topology:</p></div> |
| 2347 | <div class="listingblock"> |
| 2348 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2349 | <pre><code> y---b---b branch B |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2350 | / \ / |
| 2351 | / . |
| 2352 | / / \ |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2353 | o---x---a---a branch A</code></pre> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2354 | </div></div> |
| 2355 | <div class="paragraph"><p>you would get an output like this:</p></div> |
| 2356 | <div class="listingblock"> |
| 2357 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2358 | <pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2359 | |
| 2360 | >bbbbbbb... 3rd on b |
| 2361 | >bbbbbbb... 2nd on b |
| 2362 | <aaaaaaa... 3rd on a |
| 2363 | <aaaaaaa... 2nd on a |
| 2364 | -yyyyyyy... 1st on b |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2365 | -xxxxxxx... 1st on a</code></pre> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2366 | </div></div> |
| 2367 | </dd> |
| 2368 | <dt class="hdlist1"> |
| 2369 | --graph |
| 2370 | </dt> |
| 2371 | <dd> |
| 2372 | <p> |
| 2373 | Draw a text-based graphical representation of the commit history |
| 2374 | on the left hand side of the output. This may cause extra lines |
| 2375 | to be printed in between commits, in order for the graph history |
| 2376 | to be drawn properly. |
| Junio C Hamano | ef57d1e | 2015-03-25 21:23:00 | [diff] [blame] | 2377 | Cannot be combined with <code>--no-walk</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2378 | </p> |
| Junio C Hamano | ce019c0 | 2017-10-30 05:57:46 | [diff] [blame] | 2379 | <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> above.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2380 | <div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the |
| 2381 | <code>--date-order</code> option may also be specified.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2382 | </dd> |
| Junio C Hamano | 624dd4c | 2014-04-03 21:56:30 | [diff] [blame] | 2383 | <dt class="hdlist1"> |
| 2384 | --show-linear-break[=<barrier>] |
| 2385 | </dt> |
| 2386 | <dd> |
| 2387 | <p> |
| 2388 | When --graph is not used, all history branches are flattened |
| 2389 | which can make it hard to see that the two consecutive commits |
| 2390 | do not belong to a linear branch. This option puts a barrier |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2391 | in between them in that case. If <code><barrier></code> is specified, it |
| Junio C Hamano | 624dd4c | 2014-04-03 21:56:30 | [diff] [blame] | 2392 | is the string that will be shown instead of the default one. |
| 2393 | </p> |
| 2394 | </dd> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2395 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2396 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2397 | </div> |
| 2398 | </div> |
| 2399 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2400 | <h2 id="_pretty_formats">PRETTY FORMATS</h2> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2401 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2402 | <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] | 2403 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 2404 | inserted before the <em>Author:</em> line. This line begins with |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2405 | "Merge: " and the hashes of ancestral commits are printed, |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2406 | separated by spaces. Note that the listed commits may not |
| 2407 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 2408 | have limited your view of history: for example, if you are |
| 2409 | only interested in changes related to a certain directory or |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2410 | file.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2411 | <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] | 2412 | additional formats by setting a pretty.<name> |
| 2413 | config option to either another format name, or a |
| 2414 | <em>format:</em> string, as described below (see |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2415 | <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] | 2416 | built-in formats:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2417 | <div class="ulist"><ul> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2418 | <li> |
| 2419 | <p> |
| 2420 | <em>oneline</em> |
| 2421 | </p> |
| 2422 | <div class="literalblock"> |
| 2423 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2424 | <pre><code><hash> <title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2425 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2426 | <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] | 2427 | </li> |
| 2428 | <li> |
| 2429 | <p> |
| 2430 | <em>short</em> |
| 2431 | </p> |
| 2432 | <div class="literalblock"> |
| 2433 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2434 | <pre><code>commit <hash> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2435 | Author: <author></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2436 | </div></div> |
| 2437 | <div class="literalblock"> |
| 2438 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2439 | <pre><code><title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2440 | </div></div> |
| 2441 | </li> |
| 2442 | <li> |
| 2443 | <p> |
| 2444 | <em>medium</em> |
| 2445 | </p> |
| 2446 | <div class="literalblock"> |
| 2447 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2448 | <pre><code>commit <hash> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2449 | Author: <author> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2450 | Date: <author date></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2451 | </div></div> |
| 2452 | <div class="literalblock"> |
| 2453 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2454 | <pre><code><title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2455 | </div></div> |
| 2456 | <div class="literalblock"> |
| 2457 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2458 | <pre><code><full commit message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2459 | </div></div> |
| 2460 | </li> |
| 2461 | <li> |
| 2462 | <p> |
| 2463 | <em>full</em> |
| 2464 | </p> |
| 2465 | <div class="literalblock"> |
| 2466 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2467 | <pre><code>commit <hash> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2468 | Author: <author> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2469 | Commit: <committer></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2470 | </div></div> |
| 2471 | <div class="literalblock"> |
| 2472 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2473 | <pre><code><title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2474 | </div></div> |
| 2475 | <div class="literalblock"> |
| 2476 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2477 | <pre><code><full commit message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2478 | </div></div> |
| 2479 | </li> |
| 2480 | <li> |
| 2481 | <p> |
| 2482 | <em>fuller</em> |
| 2483 | </p> |
| 2484 | <div class="literalblock"> |
| 2485 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2486 | <pre><code>commit <hash> |
| Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 2487 | Author: <author> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2488 | AuthorDate: <author date> |
| Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 2489 | Commit: <committer> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2490 | CommitDate: <committer date></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2491 | </div></div> |
| 2492 | <div class="literalblock"> |
| 2493 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2494 | <pre><code><title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2495 | </div></div> |
| 2496 | <div class="literalblock"> |
| 2497 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2498 | <pre><code><full commit message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2499 | </div></div> |
| 2500 | </li> |
| 2501 | <li> |
| 2502 | <p> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2503 | <em>reference</em> |
| 2504 | </p> |
| 2505 | <div class="literalblock"> |
| 2506 | <div class="content"> |
| 2507 | <pre><code><abbrev hash> (<title line>, <short author date>)</code></pre> |
| 2508 | </div></div> |
| 2509 | <div class="paragraph"><p>This format is used to refer to another commit in a commit message and |
| 2510 | is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default, |
| 2511 | the date is formatted with <code>--date=short</code> unless another <code>--date</code> option |
| 2512 | is explicitly specified. As with any <code>format:</code> with format |
| 2513 | placeholders, its output is not affected by other options like |
| 2514 | <code>--decorate</code> and <code>--walk-reflogs</code>.</p></div> |
| 2515 | </li> |
| 2516 | <li> |
| 2517 | <p> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2518 | <em>email</em> |
| 2519 | </p> |
| 2520 | <div class="literalblock"> |
| 2521 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2522 | <pre><code>From <hash> <date> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2523 | From: <author> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2524 | Date: <author date> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2525 | Subject: [PATCH] <title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2526 | </div></div> |
| 2527 | <div class="literalblock"> |
| 2528 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2529 | <pre><code><full commit message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2530 | </div></div> |
| 2531 | </li> |
| 2532 | <li> |
| 2533 | <p> |
| Junio C Hamano | 0dd5094 | 2020-04-29 21:21:05 | [diff] [blame] | 2534 | <em>mboxrd</em> |
| 2535 | </p> |
| 2536 | <div class="paragraph"><p>Like <em>email</em>, but lines in the commit message starting with "From " |
| 2537 | (preceded by zero or more ">") are quoted with ">" so they aren’t |
| 2538 | confused as starting a new commit.</p></div> |
| 2539 | </li> |
| 2540 | <li> |
| 2541 | <p> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2542 | <em>raw</em> |
| 2543 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2544 | <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2545 | stored in the commit object. Notably, the hashes are |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2546 | displayed in full, regardless of whether --abbrev or |
| 2547 | --no-abbrev are used, and <em>parents</em> information show the |
| Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 2548 | true parent commits, without taking grafts or history |
| Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 2549 | simplification into account. Note that this format affects the way |
| 2550 | commits are displayed, but not the way the diff is shown e.g. with |
| 2551 | <code>git log --raw</code>. To get full object names in a raw diff format, |
| 2552 | use <code>--no-abbrev</code>.</p></div> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2553 | </li> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2554 | <li> |
| 2555 | <p> |
| Junio C Hamano | e32ec8b | 2010-06-02 23:32:31 | [diff] [blame] | 2556 | <em>format:<string></em> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2557 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2558 | <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] | 2559 | you want to show. It works a little bit like printf format, |
| 2560 | 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] | 2561 | instead of <em>\n</em>.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2562 | <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] | 2563 | would show something like this:</p></div> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2564 | <div class="listingblock"> |
| 2565 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2566 | <pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
| 2567 | 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] | 2568 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2569 | <div class="paragraph"><p>The placeholders are:</p></div> |
| 2570 | <div class="ulist"><ul> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2571 | <li> |
| 2572 | <p> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 2573 | Placeholders that expand to a single literal character: |
| 2574 | </p> |
| 2575 | <div class="dlist"><dl> |
| 2576 | <dt class="hdlist1"> |
| 2577 | <em>%n</em> |
| 2578 | </dt> |
| 2579 | <dd> |
| 2580 | <p> |
| 2581 | newline |
| 2582 | </p> |
| 2583 | </dd> |
| 2584 | <dt class="hdlist1"> |
| 2585 | <em>%%</em> |
| 2586 | </dt> |
| 2587 | <dd> |
| 2588 | <p> |
| 2589 | a raw <em>%</em> |
| 2590 | </p> |
| 2591 | </dd> |
| 2592 | <dt class="hdlist1"> |
| 2593 | <em>%x00</em> |
| 2594 | </dt> |
| 2595 | <dd> |
| 2596 | <p> |
| 2597 | print a byte from a hex code |
| 2598 | </p> |
| 2599 | </dd> |
| 2600 | </dl></div> |
| 2601 | </li> |
| 2602 | <li> |
| 2603 | <p> |
| 2604 | Placeholders that affect formatting of later placeholders: |
| 2605 | </p> |
| 2606 | <div class="dlist"><dl> |
| 2607 | <dt class="hdlist1"> |
| 2608 | <em>%Cred</em> |
| 2609 | </dt> |
| 2610 | <dd> |
| 2611 | <p> |
| 2612 | switch color to red |
| 2613 | </p> |
| 2614 | </dd> |
| 2615 | <dt class="hdlist1"> |
| 2616 | <em>%Cgreen</em> |
| 2617 | </dt> |
| 2618 | <dd> |
| 2619 | <p> |
| 2620 | switch color to green |
| 2621 | </p> |
| 2622 | </dd> |
| 2623 | <dt class="hdlist1"> |
| 2624 | <em>%Cblue</em> |
| 2625 | </dt> |
| 2626 | <dd> |
| 2627 | <p> |
| 2628 | switch color to blue |
| 2629 | </p> |
| 2630 | </dd> |
| 2631 | <dt class="hdlist1"> |
| 2632 | <em>%Creset</em> |
| 2633 | </dt> |
| 2634 | <dd> |
| 2635 | <p> |
| 2636 | reset color |
| 2637 | </p> |
| 2638 | </dd> |
| 2639 | <dt class="hdlist1"> |
| 2640 | <em>%C(…)</em> |
| 2641 | </dt> |
| 2642 | <dd> |
| 2643 | <p> |
| 2644 | color specification, as described under Values in the |
| 2645 | "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By |
| 2646 | default, colors are shown only when enabled for log output |
| 2647 | (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting |
| 2648 | the <code>auto</code> settings of the former if we are going to a |
| 2649 | terminal). <code>%C(auto,...)</code> is accepted as a historical |
| 2650 | synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying |
| 2651 | <code>%C(always,...)</code> will show the colors even when color is |
| 2652 | not otherwise enabled (though consider just using |
| 2653 | <code>--color=always</code> to enable color for the whole output, |
| 2654 | including this format and anything else git might color). |
| 2655 | <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring |
| 2656 | on the next placeholders until the color is switched |
| 2657 | again. |
| 2658 | </p> |
| 2659 | </dd> |
| 2660 | <dt class="hdlist1"> |
| 2661 | <em>%m</em> |
| 2662 | </dt> |
| 2663 | <dd> |
| 2664 | <p> |
| 2665 | left (<code><</code>), right (<code>></code>) or boundary (<code>-</code>) mark |
| 2666 | </p> |
| 2667 | </dd> |
| 2668 | <dt class="hdlist1"> |
| 2669 | <em>%w([<w>[,<i1>[,<i2>]]])</em> |
| 2670 | </dt> |
| 2671 | <dd> |
| 2672 | <p> |
| 2673 | switch line wrapping, like the -w option of |
| 2674 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
| 2675 | </p> |
| 2676 | </dd> |
| 2677 | <dt class="hdlist1"> |
| 2678 | <em>%<(<N>[,trunc|ltrunc|mtrunc])</em> |
| 2679 | </dt> |
| 2680 | <dd> |
| 2681 | <p> |
| 2682 | make the next placeholder take at |
| 2683 | least N columns, padding spaces on |
| 2684 | the right if necessary. Optionally |
| 2685 | truncate at the beginning (ltrunc), |
| 2686 | the middle (mtrunc) or the end |
| 2687 | (trunc) if the output is longer than |
| 2688 | N columns. Note that truncating |
| 2689 | only works correctly with N >= 2. |
| 2690 | </p> |
| 2691 | </dd> |
| 2692 | <dt class="hdlist1"> |
| 2693 | <em>%<|(<N>)</em> |
| 2694 | </dt> |
| 2695 | <dd> |
| 2696 | <p> |
| 2697 | make the next placeholder take at least until Nth |
| 2698 | columns, padding spaces on the right if necessary |
| 2699 | </p> |
| 2700 | </dd> |
| 2701 | <dt class="hdlist1"> |
| 2702 | <em>%>(<N>)</em>, <em>%>|(<N>)</em> |
| 2703 | </dt> |
| 2704 | <dd> |
| 2705 | <p> |
| 2706 | similar to <em>%<(<N>)</em>, <em>%<|(<N>)</em> respectively, |
| 2707 | but padding spaces on the left |
| 2708 | </p> |
| 2709 | </dd> |
| 2710 | <dt class="hdlist1"> |
| 2711 | <em>%>>(<N>)</em>, <em>%>>|(<N>)</em> |
| 2712 | </dt> |
| 2713 | <dd> |
| 2714 | <p> |
| 2715 | similar to <em>%>(<N>)</em>, <em>%>|(<N>)</em> |
| 2716 | respectively, except that if the next |
| 2717 | placeholder takes more spaces than given and |
| 2718 | there are spaces on its left, use those |
| 2719 | spaces |
| 2720 | </p> |
| 2721 | </dd> |
| 2722 | <dt class="hdlist1"> |
| 2723 | <em>%><(<N>)</em>, <em>%><|(<N>)</em> |
| 2724 | </dt> |
| 2725 | <dd> |
| 2726 | <p> |
| 2727 | similar to <em>%<(<N>)</em>, <em>%<|(<N>)</em> |
| 2728 | respectively, but padding both sides |
| 2729 | (i.e. the text is centered) |
| 2730 | </p> |
| 2731 | </dd> |
| 2732 | </dl></div> |
| 2733 | </li> |
| 2734 | <li> |
| 2735 | <p> |
| 2736 | Placeholders that expand to information extracted from the commit: |
| 2737 | </p> |
| 2738 | <div class="dlist"><dl> |
| 2739 | <dt class="hdlist1"> |
| 2740 | <em>%H</em> |
| 2741 | </dt> |
| 2742 | <dd> |
| 2743 | <p> |
| 2744 | commit hash |
| 2745 | </p> |
| 2746 | </dd> |
| 2747 | <dt class="hdlist1"> |
| 2748 | <em>%h</em> |
| 2749 | </dt> |
| 2750 | <dd> |
| 2751 | <p> |
| 2752 | abbreviated commit hash |
| 2753 | </p> |
| 2754 | </dd> |
| 2755 | <dt class="hdlist1"> |
| 2756 | <em>%T</em> |
| 2757 | </dt> |
| 2758 | <dd> |
| 2759 | <p> |
| 2760 | tree hash |
| 2761 | </p> |
| 2762 | </dd> |
| 2763 | <dt class="hdlist1"> |
| 2764 | <em>%t</em> |
| 2765 | </dt> |
| 2766 | <dd> |
| 2767 | <p> |
| 2768 | abbreviated tree hash |
| 2769 | </p> |
| 2770 | </dd> |
| 2771 | <dt class="hdlist1"> |
| 2772 | <em>%P</em> |
| 2773 | </dt> |
| 2774 | <dd> |
| 2775 | <p> |
| 2776 | parent hashes |
| 2777 | </p> |
| 2778 | </dd> |
| 2779 | <dt class="hdlist1"> |
| 2780 | <em>%p</em> |
| 2781 | </dt> |
| 2782 | <dd> |
| 2783 | <p> |
| 2784 | abbreviated parent hashes |
| 2785 | </p> |
| 2786 | </dd> |
| 2787 | <dt class="hdlist1"> |
| 2788 | <em>%an</em> |
| 2789 | </dt> |
| 2790 | <dd> |
| 2791 | <p> |
| 2792 | author name |
| 2793 | </p> |
| 2794 | </dd> |
| 2795 | <dt class="hdlist1"> |
| 2796 | <em>%aN</em> |
| 2797 | </dt> |
| 2798 | <dd> |
| 2799 | <p> |
| 2800 | author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> |
| 2801 | or <a href="git-blame.html">git-blame(1)</a>) |
| 2802 | </p> |
| 2803 | </dd> |
| 2804 | <dt class="hdlist1"> |
| 2805 | <em>%ae</em> |
| 2806 | </dt> |
| 2807 | <dd> |
| 2808 | <p> |
| 2809 | author email |
| 2810 | </p> |
| 2811 | </dd> |
| 2812 | <dt class="hdlist1"> |
| 2813 | <em>%aE</em> |
| 2814 | </dt> |
| 2815 | <dd> |
| 2816 | <p> |
| 2817 | author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> |
| 2818 | or <a href="git-blame.html">git-blame(1)</a>) |
| 2819 | </p> |
| 2820 | </dd> |
| 2821 | <dt class="hdlist1"> |
| Junio C Hamano | 8ac8a3d | 2019-11-11 04:33:46 | [diff] [blame] | 2822 | <em>%al</em> |
| 2823 | </dt> |
| 2824 | <dd> |
| 2825 | <p> |
| 2826 | author email local-part (the part before the <em>@</em> sign) |
| 2827 | </p> |
| 2828 | </dd> |
| 2829 | <dt class="hdlist1"> |
| 2830 | <em>%aL</em> |
| 2831 | </dt> |
| 2832 | <dd> |
| 2833 | <p> |
| 2834 | author local-part (see <em>%al</em>) respecting .mailmap, see |
| 2835 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 2836 | </p> |
| 2837 | </dd> |
| 2838 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 2839 | <em>%ad</em> |
| 2840 | </dt> |
| 2841 | <dd> |
| 2842 | <p> |
| 2843 | author date (format respects --date= option) |
| 2844 | </p> |
| 2845 | </dd> |
| 2846 | <dt class="hdlist1"> |
| 2847 | <em>%aD</em> |
| 2848 | </dt> |
| 2849 | <dd> |
| 2850 | <p> |
| 2851 | author date, RFC2822 style |
| 2852 | </p> |
| 2853 | </dd> |
| 2854 | <dt class="hdlist1"> |
| 2855 | <em>%ar</em> |
| 2856 | </dt> |
| 2857 | <dd> |
| 2858 | <p> |
| 2859 | author date, relative |
| 2860 | </p> |
| 2861 | </dd> |
| 2862 | <dt class="hdlist1"> |
| 2863 | <em>%at</em> |
| 2864 | </dt> |
| 2865 | <dd> |
| 2866 | <p> |
| 2867 | author date, UNIX timestamp |
| 2868 | </p> |
| 2869 | </dd> |
| 2870 | <dt class="hdlist1"> |
| 2871 | <em>%ai</em> |
| 2872 | </dt> |
| 2873 | <dd> |
| 2874 | <p> |
| 2875 | author date, ISO 8601-like format |
| 2876 | </p> |
| 2877 | </dd> |
| 2878 | <dt class="hdlist1"> |
| 2879 | <em>%aI</em> |
| 2880 | </dt> |
| 2881 | <dd> |
| 2882 | <p> |
| 2883 | author date, strict ISO 8601 format |
| 2884 | </p> |
| 2885 | </dd> |
| 2886 | <dt class="hdlist1"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2887 | <em>%as</em> |
| 2888 | </dt> |
| 2889 | <dd> |
| 2890 | <p> |
| 2891 | author date, short format (<code>YYYY-MM-DD</code>) |
| 2892 | </p> |
| 2893 | </dd> |
| 2894 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 2895 | <em>%cn</em> |
| 2896 | </dt> |
| 2897 | <dd> |
| 2898 | <p> |
| 2899 | committer name |
| 2900 | </p> |
| 2901 | </dd> |
| 2902 | <dt class="hdlist1"> |
| 2903 | <em>%cN</em> |
| 2904 | </dt> |
| 2905 | <dd> |
| 2906 | <p> |
| 2907 | committer name (respecting .mailmap, see |
| 2908 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 2909 | </p> |
| 2910 | </dd> |
| 2911 | <dt class="hdlist1"> |
| 2912 | <em>%ce</em> |
| 2913 | </dt> |
| 2914 | <dd> |
| 2915 | <p> |
| 2916 | committer email |
| 2917 | </p> |
| 2918 | </dd> |
| 2919 | <dt class="hdlist1"> |
| 2920 | <em>%cE</em> |
| 2921 | </dt> |
| 2922 | <dd> |
| 2923 | <p> |
| 2924 | committer email (respecting .mailmap, see |
| 2925 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 2926 | </p> |
| 2927 | </dd> |
| 2928 | <dt class="hdlist1"> |
| Junio C Hamano | 8ac8a3d | 2019-11-11 04:33:46 | [diff] [blame] | 2929 | <em>%cl</em> |
| 2930 | </dt> |
| 2931 | <dd> |
| 2932 | <p> |
| Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 2933 | committer email local-part (the part before the <em>@</em> sign) |
| Junio C Hamano | 8ac8a3d | 2019-11-11 04:33:46 | [diff] [blame] | 2934 | </p> |
| 2935 | </dd> |
| 2936 | <dt class="hdlist1"> |
| 2937 | <em>%cL</em> |
| 2938 | </dt> |
| 2939 | <dd> |
| 2940 | <p> |
| Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 2941 | committer local-part (see <em>%cl</em>) respecting .mailmap, see |
| Junio C Hamano | 8ac8a3d | 2019-11-11 04:33:46 | [diff] [blame] | 2942 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 2943 | </p> |
| 2944 | </dd> |
| 2945 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 2946 | <em>%cd</em> |
| 2947 | </dt> |
| 2948 | <dd> |
| 2949 | <p> |
| 2950 | committer date (format respects --date= option) |
| 2951 | </p> |
| 2952 | </dd> |
| 2953 | <dt class="hdlist1"> |
| 2954 | <em>%cD</em> |
| 2955 | </dt> |
| 2956 | <dd> |
| 2957 | <p> |
| 2958 | committer date, RFC2822 style |
| 2959 | </p> |
| 2960 | </dd> |
| 2961 | <dt class="hdlist1"> |
| 2962 | <em>%cr</em> |
| 2963 | </dt> |
| 2964 | <dd> |
| 2965 | <p> |
| 2966 | committer date, relative |
| 2967 | </p> |
| 2968 | </dd> |
| 2969 | <dt class="hdlist1"> |
| 2970 | <em>%ct</em> |
| 2971 | </dt> |
| 2972 | <dd> |
| 2973 | <p> |
| 2974 | committer date, UNIX timestamp |
| 2975 | </p> |
| 2976 | </dd> |
| 2977 | <dt class="hdlist1"> |
| 2978 | <em>%ci</em> |
| 2979 | </dt> |
| 2980 | <dd> |
| 2981 | <p> |
| 2982 | committer date, ISO 8601-like format |
| 2983 | </p> |
| 2984 | </dd> |
| 2985 | <dt class="hdlist1"> |
| 2986 | <em>%cI</em> |
| 2987 | </dt> |
| 2988 | <dd> |
| 2989 | <p> |
| 2990 | committer date, strict ISO 8601 format |
| 2991 | </p> |
| 2992 | </dd> |
| 2993 | <dt class="hdlist1"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2994 | <em>%cs</em> |
| 2995 | </dt> |
| 2996 | <dd> |
| 2997 | <p> |
| 2998 | committer date, short format (<code>YYYY-MM-DD</code>) |
| 2999 | </p> |
| 3000 | </dd> |
| 3001 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3002 | <em>%d</em> |
| 3003 | </dt> |
| 3004 | <dd> |
| 3005 | <p> |
| 3006 | ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a> |
| 3007 | </p> |
| 3008 | </dd> |
| 3009 | <dt class="hdlist1"> |
| 3010 | <em>%D</em> |
| 3011 | </dt> |
| 3012 | <dd> |
| 3013 | <p> |
| 3014 | ref names without the " (", ")" wrapping. |
| 3015 | </p> |
| 3016 | </dd> |
| 3017 | <dt class="hdlist1"> |
| 3018 | <em>%S</em> |
| 3019 | </dt> |
| 3020 | <dd> |
| 3021 | <p> |
| 3022 | ref name given on the command line by which the commit was reached |
| 3023 | (like <code>git log --source</code>), only works with <code>git log</code> |
| 3024 | </p> |
| 3025 | </dd> |
| 3026 | <dt class="hdlist1"> |
| 3027 | <em>%e</em> |
| 3028 | </dt> |
| 3029 | <dd> |
| 3030 | <p> |
| 3031 | encoding |
| 3032 | </p> |
| 3033 | </dd> |
| 3034 | <dt class="hdlist1"> |
| 3035 | <em>%s</em> |
| 3036 | </dt> |
| 3037 | <dd> |
| 3038 | <p> |
| 3039 | subject |
| 3040 | </p> |
| 3041 | </dd> |
| 3042 | <dt class="hdlist1"> |
| 3043 | <em>%f</em> |
| 3044 | </dt> |
| 3045 | <dd> |
| 3046 | <p> |
| 3047 | sanitized subject line, suitable for a filename |
| 3048 | </p> |
| 3049 | </dd> |
| 3050 | <dt class="hdlist1"> |
| 3051 | <em>%b</em> |
| 3052 | </dt> |
| 3053 | <dd> |
| 3054 | <p> |
| 3055 | body |
| 3056 | </p> |
| 3057 | </dd> |
| 3058 | <dt class="hdlist1"> |
| 3059 | <em>%B</em> |
| 3060 | </dt> |
| 3061 | <dd> |
| 3062 | <p> |
| 3063 | raw body (unwrapped subject and body) |
| 3064 | </p> |
| 3065 | </dd> |
| 3066 | <dt class="hdlist1"> |
| 3067 | <em>%N</em> |
| 3068 | </dt> |
| 3069 | <dd> |
| 3070 | <p> |
| 3071 | commit notes |
| 3072 | </p> |
| 3073 | </dd> |
| 3074 | <dt class="hdlist1"> |
| 3075 | <em>%GG</em> |
| 3076 | </dt> |
| 3077 | <dd> |
| 3078 | <p> |
| 3079 | raw verification message from GPG for a signed commit |
| 3080 | </p> |
| 3081 | </dd> |
| 3082 | <dt class="hdlist1"> |
| 3083 | <em>%G?</em> |
| 3084 | </dt> |
| 3085 | <dd> |
| 3086 | <p> |
| 3087 | show "G" for a good (valid) signature, |
| 3088 | "B" for a bad signature, |
| 3089 | "U" for a good signature with unknown validity, |
| 3090 | "X" for a good signature that has expired, |
| 3091 | "Y" for a good signature made by an expired key, |
| 3092 | "R" for a good signature made by a revoked key, |
| 3093 | "E" if the signature cannot be checked (e.g. missing key) |
| 3094 | and "N" for no signature |
| 3095 | </p> |
| 3096 | </dd> |
| 3097 | <dt class="hdlist1"> |
| 3098 | <em>%GS</em> |
| 3099 | </dt> |
| 3100 | <dd> |
| 3101 | <p> |
| 3102 | show the name of the signer for a signed commit |
| 3103 | </p> |
| 3104 | </dd> |
| 3105 | <dt class="hdlist1"> |
| 3106 | <em>%GK</em> |
| 3107 | </dt> |
| 3108 | <dd> |
| 3109 | <p> |
| 3110 | show the key used to sign a signed commit |
| 3111 | </p> |
| 3112 | </dd> |
| 3113 | <dt class="hdlist1"> |
| 3114 | <em>%GF</em> |
| 3115 | </dt> |
| 3116 | <dd> |
| 3117 | <p> |
| 3118 | show the fingerprint of the key used to sign a signed commit |
| 3119 | </p> |
| 3120 | </dd> |
| 3121 | <dt class="hdlist1"> |
| 3122 | <em>%GP</em> |
| 3123 | </dt> |
| 3124 | <dd> |
| 3125 | <p> |
| 3126 | show the fingerprint of the primary key whose subkey was used |
| 3127 | to sign a signed commit |
| 3128 | </p> |
| 3129 | </dd> |
| 3130 | <dt class="hdlist1"> |
| Junio C Hamano | bee061d | 2020-01-30 23:21:18 | [diff] [blame] | 3131 | <em>%GT</em> |
| 3132 | </dt> |
| 3133 | <dd> |
| 3134 | <p> |
| 3135 | show the trust level for the key used to sign a signed commit |
| 3136 | </p> |
| 3137 | </dd> |
| 3138 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3139 | <em>%gD</em> |
| 3140 | </dt> |
| 3141 | <dd> |
| 3142 | <p> |
| 3143 | reflog selector, e.g., <code>refs/stash@{1}</code> or <code>refs/stash@{2 |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 3144 | minutes ago}</code>; the format follows the rules described for the |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3145 | <code>-g</code> option. The portion before the <code>@</code> is the refname as |
| 3146 | given on the command line (so <code>git log -g refs/heads/master</code> |
| 3147 | would yield <code>refs/heads/master@{0}</code>). |
| 3148 | </p> |
| 3149 | </dd> |
| 3150 | <dt class="hdlist1"> |
| 3151 | <em>%gd</em> |
| 3152 | </dt> |
| 3153 | <dd> |
| 3154 | <p> |
| 3155 | shortened reflog selector; same as <code>%gD</code>, but the refname |
| 3156 | portion is shortened for human readability (so |
| 3157 | <code>refs/heads/master</code> becomes just <code>master</code>). |
| 3158 | </p> |
| 3159 | </dd> |
| 3160 | <dt class="hdlist1"> |
| 3161 | <em>%gn</em> |
| 3162 | </dt> |
| 3163 | <dd> |
| 3164 | <p> |
| 3165 | reflog identity name |
| 3166 | </p> |
| 3167 | </dd> |
| 3168 | <dt class="hdlist1"> |
| 3169 | <em>%gN</em> |
| 3170 | </dt> |
| 3171 | <dd> |
| 3172 | <p> |
| 3173 | reflog identity name (respecting .mailmap, see |
| 3174 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 3175 | </p> |
| 3176 | </dd> |
| 3177 | <dt class="hdlist1"> |
| 3178 | <em>%ge</em> |
| 3179 | </dt> |
| 3180 | <dd> |
| 3181 | <p> |
| 3182 | reflog identity email |
| 3183 | </p> |
| 3184 | </dd> |
| 3185 | <dt class="hdlist1"> |
| 3186 | <em>%gE</em> |
| 3187 | </dt> |
| 3188 | <dd> |
| 3189 | <p> |
| 3190 | reflog identity email (respecting .mailmap, see |
| 3191 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 3192 | </p> |
| 3193 | </dd> |
| 3194 | <dt class="hdlist1"> |
| 3195 | <em>%gs</em> |
| 3196 | </dt> |
| 3197 | <dd> |
| 3198 | <p> |
| 3199 | reflog subject |
| 3200 | </p> |
| 3201 | </dd> |
| 3202 | <dt class="hdlist1"> |
| 3203 | <em>%(trailers[:options])</em> |
| 3204 | </dt> |
| 3205 | <dd> |
| 3206 | <p> |
| 3207 | display the trailers of the body as |
| 3208 | interpreted by |
| 3209 | <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The |
| 3210 | <code>trailers</code> string may be followed by a colon |
| 3211 | and zero or more comma-separated options: |
| 3212 | </p> |
| 3213 | <div class="ulist"><ul> |
| 3214 | <li> |
| 3215 | <p> |
| 3216 | <em>key=<K></em>: only show trailers with specified key. Matching is done |
| 3217 | case-insensitively and trailing colon is optional. If option is |
| 3218 | given multiple times trailer lines matching any of the keys are |
| 3219 | shown. This option automatically enables the <code>only</code> option so that |
| 3220 | non-trailer lines in the trailer block are hidden. If that is not |
| 3221 | desired it can be disabled with <code>only=false</code>. E.g., |
| 3222 | <code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key |
| 3223 | <code>Reviewed-by</code>. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3224 | </p> |
| 3225 | </li> |
| 3226 | <li> |
| 3227 | <p> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3228 | <em>only[=val]</em>: select whether non-trailer lines from the trailer |
| 3229 | block should be included. The <code>only</code> keyword may optionally be |
| 3230 | followed by an equal sign and one of <code>true</code>, <code>on</code>, <code>yes</code> to omit or |
| 3231 | <code>false</code>, <code>off</code>, <code>no</code> to show the non-trailer lines. If option is |
| 3232 | given without value it is enabled. If given multiple times the last |
| 3233 | value is used. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3234 | </p> |
| 3235 | </li> |
| 3236 | <li> |
| 3237 | <p> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3238 | <em>separator=<SEP></em>: specify a separator inserted between trailer |
| 3239 | lines. When this option is not given each trailer line is |
| 3240 | terminated with a line feed character. The string SEP may contain |
| 3241 | the literal formatting codes described above. To use comma as |
| 3242 | separator one must use <code>%x2C</code> as it would otherwise be parsed as |
| 3243 | next option. If separator option is given multiple times only the |
| 3244 | last one is used. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code> |
| 3245 | shows all trailer lines whose key is "Ticket" separated by a comma |
| 3246 | and a space. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3247 | </p> |
| 3248 | </li> |
| 3249 | <li> |
| 3250 | <p> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3251 | <em>unfold[=val]</em>: make it behave as if interpret-trailer’s <code>--unfold</code> |
| 3252 | option was given. In same way as to for <code>only</code> it can be followed |
| 3253 | by an equal sign and explicit value. E.g., |
| 3254 | <code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3255 | </p> |
| 3256 | </li> |
| 3257 | <li> |
| 3258 | <p> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3259 | <em>valueonly[=val]</em>: skip over the key part of the trailer line and only |
| 3260 | show the value part. Also this optionally allows explicit value. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3261 | </p> |
| 3262 | </li> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3263 | </ul></div> |
| 3264 | </dd> |
| 3265 | </dl></div> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 3266 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3267 | </ul></div> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3268 | </li> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 3269 | </ul></div> |
| 3270 | <div class="admonitionblock"> |
| 3271 | <table><tr> |
| 3272 | <td class="icon"> |
| 3273 | <div class="title">Note</div> |
| 3274 | </td> |
| 3275 | <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] | 3276 | revision traversal engine. For example, the <code>%g*</code> reflog options will |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 3277 | 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] | 3278 | <code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short" |
| 3279 | decoration format if <code>--decorate</code> was not already provided on the command |
| 3280 | line.</td> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 3281 | </tr></table> |
| 3282 | </div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3283 | <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] | 3284 | is inserted immediately before the expansion if and only if the |
| 3285 | placeholder expands to a non-empty string.</p></div> |
| Junio C Hamano | 535c65c | 2017-06-24 22:51:58 | [diff] [blame] | 3286 | <div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive |
| 3287 | line-feeds immediately preceding the expansion are deleted if and only if the |
| Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 3288 | placeholder expands to an empty string.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3289 | <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] | 3290 | is inserted immediately before the expansion if and only if the |
| 3291 | placeholder expands to a non-empty string.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3292 | <div class="ulist"><ul> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3293 | <li> |
| 3294 | <p> |
| 3295 | <em>tformat:</em> |
| 3296 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3297 | <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] | 3298 | provides "terminator" semantics instead of "separator" semantics. In |
| 3299 | other words, each commit has the message terminator character (usually a |
| 3300 | newline) appended, rather than a separator placed between entries. |
| 3301 | This means that the final entry of a single-line format will be properly |
| 3302 | terminated with a new line, just as the "oneline" format does. |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3303 | For example:</p></div> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3304 | <div class="listingblock"> |
| 3305 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3306 | <pre><code>$ git log -2 --pretty=format:%h 4da45bef \ |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3307 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 3308 | 4da45be |
| 3309 | 7134973 -- NO NEWLINE |
| 3310 | |
| 3311 | $ git log -2 --pretty=tformat:%h 4da45bef \ |
| 3312 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 3313 | 4da45be |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3314 | 7134973</code></pre> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3315 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3316 | <div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted |
| 3317 | 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] | 3318 | equivalent:</p></div> |
| 3319 | <div class="listingblock"> |
| 3320 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3321 | <pre><code>$ git log -2 --pretty=tformat:%h 4da45bef |
| 3322 | $ git log -2 --pretty=%h 4da45bef</code></pre> |
| Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 3323 | </div></div> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3324 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3325 | </ul></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3326 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3327 | </div> |
| 3328 | <div class="sect1"> |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 3329 | <h2 id="_diff_formatting">DIFF FORMATTING</h2> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3330 | <div class="sectionbody"> |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 3331 | <div class="paragraph"><p>By default, <code>git log</code> does not generate any diff output. The options |
| 3332 | below can be used to show the changes made by each commit.</p></div> |
| 3333 | <div class="paragraph"><p>Note that unless one of <code>-c</code>, <code>--cc</code>, or <code>-m</code> is given, merge commits |
| 3334 | will never show a diff, even if a diff format like <code>--patch</code> is |
| 3335 | selected, nor will they match search options like <code>-S</code>. The exception is |
| 3336 | when <code>--first-parent</code> is in use, in which merges are treated like normal |
| 3337 | single-parent commits (this can be overridden by providing a |
| 3338 | combined-diff option or with <code>--no-diff-merges</code>).</p></div> |
| 3339 | <div class="dlist"><dl> |
| 3340 | <dt class="hdlist1"> |
| 3341 | -c |
| 3342 | </dt> |
| 3343 | <dd> |
| 3344 | <p> |
| 3345 | With this option, diff output for a merge commit |
| 3346 | shows the differences from each of the parents to the merge result |
| 3347 | simultaneously instead of showing pairwise diff between a parent |
| 3348 | and the result one at a time. Furthermore, it lists only files |
| 3349 | which were modified from all parents. |
| 3350 | </p> |
| 3351 | </dd> |
| 3352 | <dt class="hdlist1"> |
| 3353 | --cc |
| 3354 | </dt> |
| 3355 | <dd> |
| 3356 | <p> |
| 3357 | This flag implies the <code>-c</code> option and further compresses the |
| 3358 | patch output by omitting uninteresting hunks whose contents in |
| 3359 | the parents have only two variants and the merge result picks |
| 3360 | one of them without modification. |
| 3361 | </p> |
| 3362 | </dd> |
| 3363 | <dt class="hdlist1"> |
| 3364 | --combined-all-paths |
| 3365 | </dt> |
| 3366 | <dd> |
| 3367 | <p> |
| 3368 | This flag causes combined diffs (used for merge commits) to |
| 3369 | list the name of the file from all parents. It thus only has |
| 3370 | effect when -c or --cc are specified, and is likely only |
| 3371 | useful if filename changes are detected (i.e. when either |
| 3372 | rename or copy detection have been requested). |
| 3373 | </p> |
| 3374 | </dd> |
| 3375 | <dt class="hdlist1"> |
| 3376 | -m |
| 3377 | </dt> |
| 3378 | <dd> |
| 3379 | <p> |
| 3380 | This flag makes the merge commits show the full diff like |
| 3381 | regular commits; for each merge parent, a separate log entry |
| 3382 | and diff is generated. An exception is that only diff against |
| 3383 | the first parent is shown when <code>--first-parent</code> option is given; |
| 3384 | in that case, the output represents the changes the merge |
| 3385 | brought <em>into</em> the then-current branch. |
| 3386 | </p> |
| 3387 | </dd> |
| 3388 | <dt class="hdlist1"> |
| 3389 | --diff-merges=off |
| 3390 | </dt> |
| 3391 | <dt class="hdlist1"> |
| 3392 | --no-diff-merges |
| 3393 | </dt> |
| 3394 | <dd> |
| 3395 | <p> |
| 3396 | Disable output of diffs for merge commits (default). Useful to |
| 3397 | override <code>-m</code>, <code>-c</code>, or <code>--cc</code>. |
| 3398 | </p> |
| 3399 | </dd> |
| 3400 | </dl></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3401 | <div class="dlist"><dl> |
| 3402 | <dt class="hdlist1"> |
| 3403 | -p |
| 3404 | </dt> |
| 3405 | <dt class="hdlist1"> |
| 3406 | -u |
| 3407 | </dt> |
| 3408 | <dt class="hdlist1"> |
| 3409 | --patch |
| 3410 | </dt> |
| 3411 | <dd> |
| 3412 | <p> |
| 3413 | Generate patch (see section on generating patches). |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3414 | </p> |
| 3415 | </dd> |
| 3416 | <dt class="hdlist1"> |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 3417 | -s |
| 3418 | </dt> |
| 3419 | <dt class="hdlist1"> |
| 3420 | --no-patch |
| 3421 | </dt> |
| 3422 | <dd> |
| 3423 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3424 | Suppress diff output. Useful for commands like <code>git show</code> that |
| 3425 | 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] | 3426 | </p> |
| 3427 | </dd> |
| 3428 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3429 | -U<n> |
| 3430 | </dt> |
| 3431 | <dt class="hdlist1"> |
| 3432 | --unified=<n> |
| 3433 | </dt> |
| 3434 | <dd> |
| 3435 | <p> |
| 3436 | Generate diffs with <n> lines of context instead of |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3437 | the usual three. Implies <code>--patch</code>. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3438 | Implies <code>-p</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3439 | </p> |
| 3440 | </dd> |
| 3441 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3442 | --output=<file> |
| 3443 | </dt> |
| 3444 | <dd> |
| 3445 | <p> |
| 3446 | Output to a specific file instead of stdout. |
| 3447 | </p> |
| 3448 | </dd> |
| 3449 | <dt class="hdlist1"> |
| 3450 | --output-indicator-new=<char> |
| 3451 | </dt> |
| 3452 | <dt class="hdlist1"> |
| 3453 | --output-indicator-old=<char> |
| 3454 | </dt> |
| 3455 | <dt class="hdlist1"> |
| 3456 | --output-indicator-context=<char> |
| 3457 | </dt> |
| 3458 | <dd> |
| 3459 | <p> |
| 3460 | Specify the character used to indicate new, old or context |
| 3461 | lines in the generated patch. Normally they are <em>+</em>, <em>-</em> and |
| 3462 | ' ' respectively. |
| 3463 | </p> |
| 3464 | </dd> |
| 3465 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3466 | --raw |
| 3467 | </dt> |
| 3468 | <dd> |
| 3469 | <p> |
| Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 3470 | For each commit, show a summary of changes using the raw diff |
| 3471 | format. See the "RAW OUTPUT FORMAT" section of |
| 3472 | <a href="git-diff.html">git-diff(1)</a>. This is different from showing the log |
| 3473 | itself in raw format, which you can achieve with |
| 3474 | <code>--format=raw</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3475 | </p> |
| 3476 | </dd> |
| 3477 | <dt class="hdlist1"> |
| 3478 | --patch-with-raw |
| 3479 | </dt> |
| 3480 | <dd> |
| 3481 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3482 | Synonym for <code>-p --raw</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3483 | </p> |
| 3484 | </dd> |
| 3485 | <dt class="hdlist1"> |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 3486 | -t |
| 3487 | </dt> |
| 3488 | <dd> |
| 3489 | <p> |
| 3490 | Show the tree objects in the diff output. |
| 3491 | </p> |
| 3492 | </dd> |
| 3493 | <dt class="hdlist1"> |
| Junio C Hamano | ad70bf0 | 2016-09-26 23:44:27 | [diff] [blame] | 3494 | --indent-heuristic |
| 3495 | </dt> |
| Junio C Hamano | a65b676 | 2017-11-06 04:45:42 | [diff] [blame] | 3496 | <dd> |
| 3497 | <p> |
| Junio C Hamano | 14e6683 | 2018-06-18 18:32:19 | [diff] [blame] | 3498 | Enable the heuristic that shifts diff hunk boundaries to make patches |
| Junio C Hamano | a65b676 | 2017-11-06 04:45:42 | [diff] [blame] | 3499 | easier to read. This is the default. |
| 3500 | </p> |
| 3501 | </dd> |
| Junio C Hamano | ad70bf0 | 2016-09-26 23:44:27 | [diff] [blame] | 3502 | <dt class="hdlist1"> |
| 3503 | --no-indent-heuristic |
| 3504 | </dt> |
| Junio C Hamano | 5f88833 | 2016-06-13 19:28:31 | [diff] [blame] | 3505 | <dd> |
| 3506 | <p> |
| Junio C Hamano | a65b676 | 2017-11-06 04:45:42 | [diff] [blame] | 3507 | Disable the indent heuristic. |
| Junio C Hamano | 5f88833 | 2016-06-13 19:28:31 | [diff] [blame] | 3508 | </p> |
| 3509 | </dd> |
| 3510 | <dt class="hdlist1"> |
| Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame] | 3511 | --minimal |
| 3512 | </dt> |
| 3513 | <dd> |
| 3514 | <p> |
| 3515 | Spend extra time to make sure the smallest possible |
| 3516 | diff is produced. |
| 3517 | </p> |
| 3518 | </dd> |
| 3519 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3520 | --patience |
| 3521 | </dt> |
| 3522 | <dd> |
| 3523 | <p> |
| 3524 | Generate a diff using the "patience diff" algorithm. |
| 3525 | </p> |
| 3526 | </dd> |
| 3527 | <dt class="hdlist1"> |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 3528 | --histogram |
| 3529 | </dt> |
| 3530 | <dd> |
| 3531 | <p> |
| 3532 | Generate a diff using the "histogram diff" algorithm. |
| 3533 | </p> |
| 3534 | </dd> |
| 3535 | <dt class="hdlist1"> |
| Junio C Hamano | 047135e | 2017-12-19 21:57:54 | [diff] [blame] | 3536 | --anchored=<text> |
| 3537 | </dt> |
| 3538 | <dd> |
| 3539 | <p> |
| 3540 | Generate a diff using the "anchored diff" algorithm. |
| 3541 | </p> |
| 3542 | <div class="paragraph"><p>This option may be specified more than once.</p></div> |
| 3543 | <div class="paragraph"><p>If a line exists in both the source and destination, exists only once, |
| 3544 | and starts with this text, this algorithm attempts to prevent it from |
| 3545 | appearing as a deletion or addition in the output. It uses the "patience |
| 3546 | diff" algorithm internally.</p></div> |
| 3547 | </dd> |
| 3548 | <dt class="hdlist1"> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3549 | --diff-algorithm={patience|minimal|histogram|myers} |
| 3550 | </dt> |
| 3551 | <dd> |
| 3552 | <p> |
| 3553 | Choose a diff algorithm. The variants are as follows: |
| 3554 | </p> |
| 3555 | <div class="openblock"> |
| 3556 | <div class="content"> |
| 3557 | <div class="dlist"><dl> |
| 3558 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3559 | <code>default</code>, <code>myers</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3560 | </dt> |
| 3561 | <dd> |
| 3562 | <p> |
| 3563 | The basic greedy diff algorithm. Currently, this is the default. |
| 3564 | </p> |
| 3565 | </dd> |
| 3566 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3567 | <code>minimal</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3568 | </dt> |
| 3569 | <dd> |
| 3570 | <p> |
| 3571 | Spend extra time to make sure the smallest possible diff is |
| 3572 | produced. |
| 3573 | </p> |
| 3574 | </dd> |
| 3575 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3576 | <code>patience</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3577 | </dt> |
| 3578 | <dd> |
| 3579 | <p> |
| 3580 | Use "patience diff" algorithm when generating patches. |
| 3581 | </p> |
| 3582 | </dd> |
| 3583 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3584 | <code>histogram</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3585 | </dt> |
| 3586 | <dd> |
| 3587 | <p> |
| 3588 | This algorithm extends the patience algorithm to "support |
| 3589 | low-occurrence common elements". |
| 3590 | </p> |
| 3591 | </dd> |
| 3592 | </dl></div> |
| 3593 | </div></div> |
| Junio C Hamano | 14e6683 | 2018-06-18 18:32:19 | [diff] [blame] | 3594 | <div class="paragraph"><p>For instance, if you configured the <code>diff.algorithm</code> variable to a |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3595 | non-default value and want to use the default one, then you |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3596 | have to use <code>--diff-algorithm=default</code> option.</p></div> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3597 | </dd> |
| 3598 | <dt class="hdlist1"> |
| Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 3599 | --stat[=<width>[,<name-width>[,<count>]]] |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3600 | </dt> |
| 3601 | <dd> |
| 3602 | <p> |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 3603 | Generate a diffstat. By default, as much space as necessary |
| 3604 | will be used for the filename part, and the rest for the graph |
| 3605 | part. Maximum width defaults to terminal width, or 80 columns |
| Junio C Hamano | 7f2b3cb | 2012-06-22 22:42:39 | [diff] [blame] | 3606 | if not connected to a terminal, and can be overridden by |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3607 | <code><width></code>. The width of the filename part can be limited by |
| 3608 | giving another width <code><name-width></code> after a comma. The width |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 3609 | of the graph part can be limited by using |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3610 | <code>--stat-graph-width=<width></code> (affects all commands generating |
| 3611 | a stat graph) or by setting <code>diff.statGraphWidth=<width></code> |
| 3612 | (does not affect <code>git format-patch</code>). |
| 3613 | By giving a third parameter <code><count></code>, you can limit the |
| 3614 | output to the first <code><count></code> lines, followed by <code>...</code> if |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 3615 | there are more. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3616 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3617 | <div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=<width></code>, |
| 3618 | <code>--stat-name-width=<name-width></code> and <code>--stat-count=<count></code>.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3619 | </dd> |
| 3620 | <dt class="hdlist1"> |
| Junio C Hamano | 45badf0 | 2018-03-14 21:56:41 | [diff] [blame] | 3621 | --compact-summary |
| 3622 | </dt> |
| 3623 | <dd> |
| 3624 | <p> |
| 3625 | Output a condensed summary of extended header information such |
| 3626 | as file creations or deletions ("new" or "gone", optionally "+l" |
| 3627 | if it’s a symlink) and mode changes ("+x" or "-x" for adding |
| 3628 | or removing executable bit respectively) in diffstat. The |
| Junio C Hamano | fa2915c | 2018-06-19 19:50:18 | [diff] [blame] | 3629 | information is put between the filename part and the graph |
| Junio C Hamano | 45badf0 | 2018-03-14 21:56:41 | [diff] [blame] | 3630 | part. Implies <code>--stat</code>. |
| 3631 | </p> |
| 3632 | </dd> |
| 3633 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3634 | --numstat |
| 3635 | </dt> |
| 3636 | <dd> |
| 3637 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3638 | Similar to <code>--stat</code>, but shows number of added and |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3639 | deleted lines in decimal notation and pathname without |
| 3640 | abbreviation, to make it more machine friendly. For |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3641 | binary files, outputs two <code>-</code> instead of saying |
| 3642 | <code>0 0</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3643 | </p> |
| 3644 | </dd> |
| 3645 | <dt class="hdlist1"> |
| 3646 | --shortstat |
| 3647 | </dt> |
| 3648 | <dd> |
| 3649 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3650 | Output only the last line of the <code>--stat</code> format containing total |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3651 | number of modified files, as well as number of added and deleted |
| 3652 | lines. |
| 3653 | </p> |
| 3654 | </dd> |
| 3655 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3656 | -X[<param1,param2,…>] |
| 3657 | </dt> |
| 3658 | <dt class="hdlist1"> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3659 | --dirstat[=<param1,param2,…>] |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3660 | </dt> |
| 3661 | <dd> |
| 3662 | <p> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3663 | Output the distribution of relative amount of changes for each |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3664 | sub-directory. The behavior of <code>--dirstat</code> can be customized by |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3665 | passing it a comma separated list of parameters. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3666 | The defaults are controlled by the <code>diff.dirstat</code> configuration |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 3667 | variable (see <a href="git-config.html">git-config(1)</a>). |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3668 | The following parameters are available: |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3669 | </p> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3670 | <div class="openblock"> |
| 3671 | <div class="content"> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3672 | <div class="dlist"><dl> |
| 3673 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3674 | <code>changes</code> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3675 | </dt> |
| 3676 | <dd> |
| 3677 | <p> |
| 3678 | Compute the dirstat numbers by counting the lines that have been |
| 3679 | removed from the source, or added to the destination. This ignores |
| 3680 | the amount of pure code movements within a file. In other words, |
| 3681 | rearranging lines in a file is not counted as much as other changes. |
| 3682 | This is the default behavior when no parameter is given. |
| 3683 | </p> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3684 | </dd> |
| 3685 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3686 | <code>lines</code> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3687 | </dt> |
| 3688 | <dd> |
| 3689 | <p> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3690 | Compute the dirstat numbers by doing the regular line-based diff |
| 3691 | analysis, and summing the removed/added line counts. (For binary |
| 3692 | files, count 64-byte chunks instead, since binary files have no |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3693 | natural concept of lines). This is a more expensive <code>--dirstat</code> |
| 3694 | behavior than the <code>changes</code> behavior, but it does count rearranged |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3695 | lines within a file as much as other changes. The resulting output |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3696 | is consistent with what you get from the other <code>--*stat</code> options. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3697 | </p> |
| 3698 | </dd> |
| 3699 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3700 | <code>files</code> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3701 | </dt> |
| 3702 | <dd> |
| 3703 | <p> |
| 3704 | Compute the dirstat numbers by counting the number of files changed. |
| 3705 | Each changed file counts equally in the dirstat analysis. This is |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3706 | the computationally cheapest <code>--dirstat</code> behavior, since it does |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3707 | not have to look at the file contents at all. |
| 3708 | </p> |
| 3709 | </dd> |
| 3710 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3711 | <code>cumulative</code> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3712 | </dt> |
| 3713 | <dd> |
| 3714 | <p> |
| 3715 | Count changes in a child directory for the parent directory as well. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3716 | Note that when using <code>cumulative</code>, the sum of the percentages |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3717 | reported may exceed 100%. The default (non-cumulative) behavior can |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3718 | be specified with the <code>noncumulative</code> parameter. |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3719 | </p> |
| 3720 | </dd> |
| 3721 | <dt class="hdlist1"> |
| 3722 | <limit> |
| 3723 | </dt> |
| 3724 | <dd> |
| 3725 | <p> |
| 3726 | An integer parameter specifies a cut-off percent (3% by default). |
| 3727 | Directories contributing less than this percentage of the changes |
| 3728 | are not shown in the output. |
| 3729 | </p> |
| 3730 | </dd> |
| 3731 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3732 | </div></div> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3733 | <div class="paragraph"><p>Example: The following will count changed files, while ignoring |
| 3734 | directories with less than 10% of the total amount of changed files, |
| 3735 | and accumulating child directory counts in the parent directories: |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3736 | <code>--dirstat=files,10,cumulative</code>.</p></div> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3737 | </dd> |
| 3738 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3739 | --cumulative |
| 3740 | </dt> |
| 3741 | <dd> |
| 3742 | <p> |
| 3743 | Synonym for --dirstat=cumulative |
| 3744 | </p> |
| 3745 | </dd> |
| 3746 | <dt class="hdlist1"> |
| 3747 | --dirstat-by-file[=<param1,param2>…] |
| 3748 | </dt> |
| 3749 | <dd> |
| 3750 | <p> |
| 3751 | Synonym for --dirstat=files,param1,param2… |
| 3752 | </p> |
| 3753 | </dd> |
| 3754 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3755 | --summary |
| 3756 | </dt> |
| 3757 | <dd> |
| 3758 | <p> |
| 3759 | Output a condensed summary of extended header information |
| 3760 | such as creations, renames and mode changes. |
| 3761 | </p> |
| 3762 | </dd> |
| 3763 | <dt class="hdlist1"> |
| 3764 | --patch-with-stat |
| 3765 | </dt> |
| 3766 | <dd> |
| 3767 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3768 | Synonym for <code>-p --stat</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3769 | </p> |
| 3770 | </dd> |
| 3771 | <dt class="hdlist1"> |
| 3772 | -z |
| 3773 | </dt> |
| 3774 | <dd> |
| 3775 | <p> |
| 3776 | Separate the commits with NULs instead of with new newlines. |
| 3777 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3778 | <div class="paragraph"><p>Also, when <code>--raw</code> or <code>--numstat</code> has been given, do not munge |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3779 | pathnames and use NULs as output field terminators.</p></div> |
| Junio C Hamano | 0f6f3bf | 2017-03-13 07:01:53 | [diff] [blame] | 3780 | <div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as |
| 3781 | explained for the configuration variable <code>core.quotePath</code> (see |
| 3782 | <a href="git-config.html">git-config(1)</a>).</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3783 | </dd> |
| 3784 | <dt class="hdlist1"> |
| 3785 | --name-only |
| 3786 | </dt> |
| 3787 | <dd> |
| 3788 | <p> |
| 3789 | Show only names of changed files. |
| 3790 | </p> |
| 3791 | </dd> |
| 3792 | <dt class="hdlist1"> |
| 3793 | --name-status |
| 3794 | </dt> |
| 3795 | <dd> |
| 3796 | <p> |
| 3797 | Show only names and status of changed files. See the description |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3798 | of the <code>--diff-filter</code> option on what the status letters mean. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3799 | </p> |
| 3800 | </dd> |
| 3801 | <dt class="hdlist1"> |
| 3802 | --submodule[=<format>] |
| 3803 | </dt> |
| 3804 | <dd> |
| 3805 | <p> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 3806 | Specify how differences in submodules are shown. When specifying |
| 3807 | <code>--submodule=short</code> the <em>short</em> format is used. This format just |
| 3808 | shows the names of the commits at the beginning and end of the range. |
| 3809 | When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em> |
| 3810 | format is used. This format lists the commits in the range like |
| 3811 | <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code> |
| 3812 | is specified, the <em>diff</em> format is used. This format shows an |
| 3813 | inline diff of the changes in the submodule contents between the |
| 3814 | commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format |
| 3815 | if the config option is unset. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3816 | </p> |
| 3817 | </dd> |
| 3818 | <dt class="hdlist1"> |
| 3819 | --color[=<when>] |
| 3820 | </dt> |
| 3821 | <dd> |
| 3822 | <p> |
| 3823 | Show colored diff. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3824 | <code>--color</code> (i.e. without <em>=<when></em>) is the same as <code>--color=always</code>. |
| 3825 | <em><when></em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3826 | </p> |
| 3827 | </dd> |
| 3828 | <dt class="hdlist1"> |
| 3829 | --no-color |
| 3830 | </dt> |
| 3831 | <dd> |
| 3832 | <p> |
| Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 3833 | Turn off colored diff. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3834 | It is the same as <code>--color=never</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3835 | </p> |
| 3836 | </dd> |
| 3837 | <dt class="hdlist1"> |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 3838 | --color-moved[=<mode>] |
| 3839 | </dt> |
| 3840 | <dd> |
| 3841 | <p> |
| 3842 | Moved lines of code are colored differently. |
| 3843 | The <mode> defaults to <em>no</em> if the option is not given |
| 3844 | and to <em>zebra</em> if the option with no mode is given. |
| 3845 | The mode must be one of: |
| 3846 | </p> |
| 3847 | <div class="openblock"> |
| 3848 | <div class="content"> |
| 3849 | <div class="dlist"><dl> |
| 3850 | <dt class="hdlist1"> |
| 3851 | no |
| 3852 | </dt> |
| 3853 | <dd> |
| 3854 | <p> |
| 3855 | Moved lines are not highlighted. |
| 3856 | </p> |
| 3857 | </dd> |
| 3858 | <dt class="hdlist1"> |
| 3859 | default |
| 3860 | </dt> |
| 3861 | <dd> |
| 3862 | <p> |
| 3863 | Is a synonym for <code>zebra</code>. This may change to a more sensible mode |
| 3864 | in the future. |
| 3865 | </p> |
| 3866 | </dd> |
| 3867 | <dt class="hdlist1"> |
| 3868 | plain |
| 3869 | </dt> |
| 3870 | <dd> |
| 3871 | <p> |
| 3872 | Any line that is added in one location and was removed |
| 3873 | in another location will be colored with <em>color.diff.newMoved</em>. |
| 3874 | Similarly <em>color.diff.oldMoved</em> will be used for removed lines |
| 3875 | that are added somewhere else in the diff. This mode picks up any |
| 3876 | moved line, but it is not very useful in a review to determine |
| 3877 | if a block of code was moved without permutation. |
| 3878 | </p> |
| 3879 | </dd> |
| 3880 | <dt class="hdlist1"> |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 3881 | blocks |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 3882 | </dt> |
| 3883 | <dd> |
| 3884 | <p> |
| 3885 | Blocks of moved text of at least 20 alphanumeric characters |
| 3886 | are detected greedily. The detected blocks are |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 3887 | painted using either the <em>color.diff.{old,new}Moved</em> color. |
| 3888 | Adjacent blocks cannot be told apart. |
| 3889 | </p> |
| 3890 | </dd> |
| 3891 | <dt class="hdlist1"> |
| 3892 | zebra |
| 3893 | </dt> |
| 3894 | <dd> |
| 3895 | <p> |
| 3896 | Blocks of moved text are detected as in <em>blocks</em> mode. The blocks |
| 3897 | are painted using either the <em>color.diff.{old,new}Moved</em> color or |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 3898 | <em>color.diff.{old,new}MovedAlternative</em>. The change between |
| 3899 | the two colors indicates that a new block was detected. |
| 3900 | </p> |
| 3901 | </dd> |
| 3902 | <dt class="hdlist1"> |
| Junio C Hamano | bfd91f4 | 2018-08-17 22:21:16 | [diff] [blame] | 3903 | dimmed-zebra |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 3904 | </dt> |
| 3905 | <dd> |
| 3906 | <p> |
| 3907 | Similar to <em>zebra</em>, but additional dimming of uninteresting parts |
| 3908 | of moved code is performed. The bordering lines of two adjacent |
| 3909 | blocks are considered interesting, the rest is uninteresting. |
| Junio C Hamano | bfd91f4 | 2018-08-17 22:21:16 | [diff] [blame] | 3910 | <code>dimmed_zebra</code> is a deprecated synonym. |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 3911 | </p> |
| 3912 | </dd> |
| 3913 | </dl></div> |
| 3914 | </div></div> |
| 3915 | </dd> |
| 3916 | <dt class="hdlist1"> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 3917 | --no-color-moved |
| 3918 | </dt> |
| 3919 | <dd> |
| 3920 | <p> |
| 3921 | Turn off move detection. This can be used to override configuration |
| 3922 | settings. It is the same as <code>--color-moved=no</code>. |
| 3923 | </p> |
| 3924 | </dd> |
| 3925 | <dt class="hdlist1"> |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 3926 | --color-moved-ws=<modes> |
| 3927 | </dt> |
| 3928 | <dd> |
| 3929 | <p> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 3930 | This configures how whitespace is ignored when performing the |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 3931 | move detection for <code>--color-moved</code>. |
| 3932 | These modes can be given as a comma separated list: |
| 3933 | </p> |
| 3934 | <div class="openblock"> |
| 3935 | <div class="content"> |
| 3936 | <div class="dlist"><dl> |
| 3937 | <dt class="hdlist1"> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 3938 | no |
| 3939 | </dt> |
| 3940 | <dd> |
| 3941 | <p> |
| 3942 | Do not ignore whitespace when performing move detection. |
| 3943 | </p> |
| 3944 | </dd> |
| 3945 | <dt class="hdlist1"> |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 3946 | ignore-space-at-eol |
| 3947 | </dt> |
| 3948 | <dd> |
| 3949 | <p> |
| 3950 | Ignore changes in whitespace at EOL. |
| 3951 | </p> |
| 3952 | </dd> |
| 3953 | <dt class="hdlist1"> |
| 3954 | ignore-space-change |
| 3955 | </dt> |
| 3956 | <dd> |
| 3957 | <p> |
| 3958 | Ignore changes in amount of whitespace. This ignores whitespace |
| 3959 | at line end, and considers all other sequences of one or |
| 3960 | more whitespace characters to be equivalent. |
| 3961 | </p> |
| 3962 | </dd> |
| 3963 | <dt class="hdlist1"> |
| 3964 | ignore-all-space |
| 3965 | </dt> |
| 3966 | <dd> |
| 3967 | <p> |
| 3968 | Ignore whitespace when comparing lines. This ignores differences |
| 3969 | even if one line has whitespace where the other line has none. |
| 3970 | </p> |
| 3971 | </dd> |
| 3972 | <dt class="hdlist1"> |
| 3973 | allow-indentation-change |
| 3974 | </dt> |
| 3975 | <dd> |
| 3976 | <p> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 3977 | Initially ignore any whitespace in the move detection, then |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 3978 | group the moved code blocks only into a block if the change in |
| 3979 | whitespace is the same per line. This is incompatible with the |
| 3980 | other modes. |
| 3981 | </p> |
| 3982 | </dd> |
| 3983 | </dl></div> |
| 3984 | </div></div> |
| 3985 | </dd> |
| 3986 | <dt class="hdlist1"> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 3987 | --no-color-moved-ws |
| 3988 | </dt> |
| 3989 | <dd> |
| 3990 | <p> |
| 3991 | Do not ignore whitespace when performing move detection. This can be |
| 3992 | used to override configuration settings. It is the same as |
| 3993 | <code>--color-moved-ws=no</code>. |
| 3994 | </p> |
| 3995 | </dd> |
| 3996 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3997 | --word-diff[=<mode>] |
| 3998 | </dt> |
| 3999 | <dd> |
| 4000 | <p> |
| 4001 | Show a word diff, using the <mode> to delimit changed words. |
| 4002 | By default, words are delimited by whitespace; see |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4003 | <code>--word-diff-regex</code> below. The <mode> defaults to <em>plain</em>, and |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4004 | must be one of: |
| 4005 | </p> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4006 | <div class="openblock"> |
| 4007 | <div class="content"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4008 | <div class="dlist"><dl> |
| 4009 | <dt class="hdlist1"> |
| 4010 | color |
| 4011 | </dt> |
| 4012 | <dd> |
| 4013 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4014 | Highlight changed words using only colors. Implies <code>--color</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4015 | </p> |
| 4016 | </dd> |
| 4017 | <dt class="hdlist1"> |
| 4018 | plain |
| 4019 | </dt> |
| 4020 | <dd> |
| 4021 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4022 | Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4023 | attempts to escape the delimiters if they appear in the input, |
| 4024 | so the output may be ambiguous. |
| 4025 | </p> |
| 4026 | </dd> |
| 4027 | <dt class="hdlist1"> |
| 4028 | porcelain |
| 4029 | </dt> |
| 4030 | <dd> |
| 4031 | <p> |
| 4032 | Use a special line-based format intended for script |
| 4033 | consumption. Added/removed/unchanged runs are printed in the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4034 | usual unified diff format, starting with a <code>+</code>/<code>-</code>/` ` |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4035 | character at the beginning of the line and extending to the |
| 4036 | end of the line. Newlines in the input are represented by a |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4037 | tilde <code>~</code> on a line of its own. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4038 | </p> |
| 4039 | </dd> |
| 4040 | <dt class="hdlist1"> |
| 4041 | none |
| 4042 | </dt> |
| 4043 | <dd> |
| 4044 | <p> |
| 4045 | Disable word diff again. |
| 4046 | </p> |
| 4047 | </dd> |
| 4048 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4049 | </div></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4050 | <div class="paragraph"><p>Note that despite the name of the first mode, color is used to |
| 4051 | highlight the changed parts in all modes if enabled.</p></div> |
| 4052 | </dd> |
| 4053 | <dt class="hdlist1"> |
| 4054 | --word-diff-regex=<regex> |
| 4055 | </dt> |
| 4056 | <dd> |
| 4057 | <p> |
| 4058 | Use <regex> to decide what a word is, instead of considering |
| 4059 | runs of non-whitespace to be a word. Also implies |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4060 | <code>--word-diff</code> unless it was already enabled. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4061 | </p> |
| 4062 | <div class="paragraph"><p>Every non-overlapping match of the |
| 4063 | <regex> is considered a word. Anything between these matches is |
| 4064 | considered whitespace and ignored(!) for the purposes of finding |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4065 | differences. You may want to append <code>|[^[:space:]]</code> to your regular |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4066 | expression to make sure that it matches all non-whitespace characters. |
| 4067 | A match that contains a newline is silently truncated(!) at the |
| 4068 | newline.</p></div> |
| Junio C Hamano | 713eded | 2015-12-03 00:24:02 | [diff] [blame] | 4069 | <div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word |
| 4070 | and, correspondingly, show differences character by character.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4071 | <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see |
| Junio C Hamano | 198b1f1 | 2016-05-17 22:27:24 | [diff] [blame] | 4072 | <a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4073 | overrides any diff driver or configuration setting. Diff drivers |
| 4074 | override configuration settings.</p></div> |
| 4075 | </dd> |
| 4076 | <dt class="hdlist1"> |
| 4077 | --color-words[=<regex>] |
| 4078 | </dt> |
| 4079 | <dd> |
| 4080 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4081 | Equivalent to <code>--word-diff=color</code> plus (if a regex was |
| 4082 | specified) <code>--word-diff-regex=<regex></code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4083 | </p> |
| 4084 | </dd> |
| 4085 | <dt class="hdlist1"> |
| 4086 | --no-renames |
| 4087 | </dt> |
| 4088 | <dd> |
| 4089 | <p> |
| 4090 | Turn off rename detection, even when the configuration |
| 4091 | file gives the default to do so. |
| 4092 | </p> |
| 4093 | </dd> |
| 4094 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 4095 | --[no-]rename-empty |
| 4096 | </dt> |
| 4097 | <dd> |
| 4098 | <p> |
| 4099 | Whether to use empty blobs as rename source. |
| 4100 | </p> |
| 4101 | </dd> |
| 4102 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4103 | --check |
| 4104 | </dt> |
| 4105 | <dd> |
| 4106 | <p> |
| Junio C Hamano | 84ea1e4 | 2016-04-08 21:53:48 | [diff] [blame] | 4107 | Warn if changes introduce conflict markers or whitespace errors. |
| 4108 | What are considered whitespace errors is controlled by <code>core.whitespace</code> |
| Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 4109 | configuration. By default, trailing whitespaces (including |
| Junio C Hamano | 14e6683 | 2018-06-18 18:32:19 | [diff] [blame] | 4110 | lines that consist solely of whitespaces) and a space character |
| Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 4111 | that is immediately followed by a tab character inside the |
| 4112 | initial indent of the line are considered whitespace errors. |
| 4113 | Exits with non-zero status if problems are found. Not compatible |
| 4114 | with --exit-code. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4115 | </p> |
| 4116 | </dd> |
| 4117 | <dt class="hdlist1"> |
| Junio C Hamano | 8c5d594 | 2015-06-11 19:37:48 | [diff] [blame] | 4118 | --ws-error-highlight=<kind> |
| 4119 | </dt> |
| 4120 | <dd> |
| 4121 | <p> |
| Junio C Hamano | 4b2a6c1 | 2017-08-22 18:32:37 | [diff] [blame] | 4122 | Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code> |
| 4123 | lines of the diff. Multiple values are separated by comma, |
| 4124 | <code>none</code> resets previous values, <code>default</code> reset the list to |
| 4125 | <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When |
| 4126 | this option is not given, and the configuration variable |
| 4127 | <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in |
| 4128 | <code>new</code> lines are highlighted. The whitespace errors are colored |
| Junio C Hamano | 14e6683 | 2018-06-18 18:32:19 | [diff] [blame] | 4129 | with <code>color.diff.whitespace</code>. |
| Junio C Hamano | 8c5d594 | 2015-06-11 19:37:48 | [diff] [blame] | 4130 | </p> |
| 4131 | </dd> |
| 4132 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4133 | --full-index |
| 4134 | </dt> |
| 4135 | <dd> |
| 4136 | <p> |
| 4137 | Instead of the first handful of characters, show the full |
| 4138 | pre- and post-image blob object names on the "index" |
| 4139 | line when generating patch format output. |
| 4140 | </p> |
| 4141 | </dd> |
| 4142 | <dt class="hdlist1"> |
| 4143 | --binary |
| 4144 | </dt> |
| 4145 | <dd> |
| 4146 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4147 | In addition to <code>--full-index</code>, output a binary diff that |
| Junio C Hamano | 6b7d215 | 2019-04-16 12:51:15 | [diff] [blame] | 4148 | can be applied with <code>git-apply</code>. Implies <code>--patch</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4149 | </p> |
| 4150 | </dd> |
| 4151 | <dt class="hdlist1"> |
| 4152 | --abbrev[=<n>] |
| 4153 | </dt> |
| 4154 | <dd> |
| 4155 | <p> |
| 4156 | Instead of showing the full 40-byte hexadecimal object |
| 4157 | name in diff-raw format output and diff-tree header |
| Junio C Hamano | cf8aeaf | 2020-08-31 23:16:35 | [diff] [blame] | 4158 | lines, show only a partial prefix. |
| 4159 | In diff-patch output format, <code>--full-index</code> takes higher |
| 4160 | precedence, i.e. if <code>--full-index</code> is specified, full blob |
| 4161 | names will be shown regardless of <code>--abbrev</code>. |
| 4162 | Non default number of digits can be specified with <code>--abbrev=<n></code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4163 | </p> |
| 4164 | </dd> |
| 4165 | <dt class="hdlist1"> |
| 4166 | -B[<n>][/<m>] |
| 4167 | </dt> |
| 4168 | <dt class="hdlist1"> |
| 4169 | --break-rewrites[=[<n>][/<m>]] |
| 4170 | </dt> |
| 4171 | <dd> |
| 4172 | <p> |
| 4173 | Break complete rewrite changes into pairs of delete and |
| 4174 | create. This serves two purposes: |
| 4175 | </p> |
| 4176 | <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file |
| 4177 | not as a series of deletion and insertion mixed together with a very |
| 4178 | few lines that happen to match textually as the context, but as a |
| 4179 | single deletion of everything old followed by a single insertion of |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4180 | everything new, and the number <code>m</code> controls this aspect of the -B |
| 4181 | option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the |
| Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 4182 | original should remain in the result for Git to consider it a total |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4183 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 4184 | deletion and insertion mixed together with context lines).</p></div> |
| 4185 | <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the |
| 4186 | source of a rename (usually -M only considers a file that disappeared |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4187 | as the source of a rename), and the number <code>n</code> controls this aspect of |
| 4188 | the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4189 | addition and deletion compared to 20% or more of the file’s size are |
| 4190 | eligible for being picked up as a possible source of a rename to |
| 4191 | another file.</p></div> |
| 4192 | </dd> |
| 4193 | <dt class="hdlist1"> |
| 4194 | -M[<n>] |
| 4195 | </dt> |
| 4196 | <dt class="hdlist1"> |
| 4197 | --find-renames[=<n>] |
| 4198 | </dt> |
| 4199 | <dd> |
| 4200 | <p> |
| 4201 | If generating diffs, detect and report renames for each commit. |
| 4202 | For following files across renames while traversing history, see |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4203 | <code>--follow</code>. |
| 4204 | If <code>n</code> is specified, it is a threshold on the similarity |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4205 | index (i.e. amount of addition/deletions compared to the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4206 | file’s size). For example, <code>-M90%</code> means Git should consider a |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4207 | 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] | 4208 | hasn’t changed. Without a <code>%</code> sign, the number is to be read as |
| 4209 | a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes |
| 4210 | 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is |
| 4211 | the same as <code>-M5%</code>. To limit detection to exact renames, use |
| 4212 | <code>-M100%</code>. The default similarity index is 50%. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4213 | </p> |
| 4214 | </dd> |
| 4215 | <dt class="hdlist1"> |
| 4216 | -C[<n>] |
| 4217 | </dt> |
| 4218 | <dt class="hdlist1"> |
| 4219 | --find-copies[=<n>] |
| 4220 | </dt> |
| 4221 | <dd> |
| 4222 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4223 | Detect copies as well as renames. See also <code>--find-copies-harder</code>. |
| 4224 | If <code>n</code> is specified, it has the same meaning as for <code>-M<n></code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4225 | </p> |
| 4226 | </dd> |
| 4227 | <dt class="hdlist1"> |
| 4228 | --find-copies-harder |
| 4229 | </dt> |
| 4230 | <dd> |
| 4231 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4232 | For performance reasons, by default, <code>-C</code> option finds copies only |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4233 | if the original file of the copy was modified in the same |
| 4234 | changeset. This flag makes the command |
| 4235 | inspect unmodified files as candidates for the source of |
| 4236 | copy. This is a very expensive operation for large |
| 4237 | projects, so use it with caution. Giving more than one |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4238 | <code>-C</code> option has the same effect. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4239 | </p> |
| 4240 | </dd> |
| 4241 | <dt class="hdlist1"> |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 4242 | -D |
| 4243 | </dt> |
| 4244 | <dt class="hdlist1"> |
| 4245 | --irreversible-delete |
| 4246 | </dt> |
| 4247 | <dd> |
| 4248 | <p> |
| 4249 | 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] | 4250 | the diff between the preimage and <code>/dev/null</code>. The resulting patch |
| 4251 | is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 4252 | solely for people who want to just concentrate on reviewing the |
| Junio C Hamano | d16fd1b | 2017-08-04 16:41:51 | [diff] [blame] | 4253 | text after the change. In addition, the output obviously lacks |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 4254 | enough information to apply such a patch in reverse, even manually, |
| 4255 | hence the name of the option. |
| 4256 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4257 | <div class="paragraph"><p>When used together with <code>-B</code>, omit also the preimage in the deletion part |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 4258 | of a delete/create pair.</p></div> |
| 4259 | </dd> |
| 4260 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4261 | -l<num> |
| 4262 | </dt> |
| 4263 | <dd> |
| 4264 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4265 | The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4266 | is the number of potential rename/copy targets. This |
| 4267 | option prevents rename/copy detection from running if |
| 4268 | the number of rename/copy targets exceeds the specified |
| 4269 | number. |
| 4270 | </p> |
| 4271 | </dd> |
| 4272 | <dt class="hdlist1"> |
| 4273 | --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] |
| 4274 | </dt> |
| 4275 | <dd> |
| 4276 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4277 | Select only files that are Added (<code>A</code>), Copied (<code>C</code>), |
| 4278 | Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their |
| 4279 | type (i.e. regular file, symlink, submodule, …) changed (<code>T</code>), |
| 4280 | are Unmerged (<code>U</code>), are |
| 4281 | Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>). |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4282 | Any combination of the filter characters (including none) can be used. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4283 | When <code>*</code> (All-or-none) is added to the combination, all |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4284 | paths are selected if there is any file that matches |
| 4285 | other criteria in the comparison; if there is no file |
| 4286 | that matches other criteria, nothing is selected. |
| 4287 | </p> |
| Junio C Hamano | eed15af | 2016-07-25 22:49:42 | [diff] [blame] | 4288 | <div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g. |
| 4289 | <code>--diff-filter=ad</code> excludes added and deleted paths.</p></div> |
| Junio C Hamano | 3a34f15 | 2018-01-09 23:09:38 | [diff] [blame] | 4290 | <div class="paragraph"><p>Note that not all diffs can feature all types. For instance, diffs |
| 4291 | from the index to the working tree can never have Added entries |
| 4292 | (because the set of paths included in the diff is limited by what is in |
| 4293 | the index). Similarly, copied and renamed entries cannot appear if |
| 4294 | detection for those types is disabled.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4295 | </dd> |
| 4296 | <dt class="hdlist1"> |
| 4297 | -S<string> |
| 4298 | </dt> |
| 4299 | <dd> |
| 4300 | <p> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4301 | Look for differences that change the number of occurrences of |
| 4302 | the specified string (i.e. addition/deletion) in a file. |
| 4303 | Intended for the scripter’s use. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4304 | </p> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4305 | <div class="paragraph"><p>It is useful when you’re looking for an exact block of code (like a |
| 4306 | struct), and want to know the history of that block since it first |
| 4307 | came into being: use the feature iteratively to feed the interesting |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4308 | block in the preimage back into <code>-S</code>, and keep going until you get the |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4309 | very first version of the block.</p></div> |
| Junio C Hamano | ace33e4 | 2019-01-18 23:16:05 | [diff] [blame] | 4310 | <div class="paragraph"><p>Binary files are searched as well.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4311 | </dd> |
| 4312 | <dt class="hdlist1"> |
| 4313 | -G<regex> |
| 4314 | </dt> |
| 4315 | <dd> |
| 4316 | <p> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4317 | Look for differences whose patch text contains added/removed |
| 4318 | lines that match <regex>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4319 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4320 | <div class="paragraph"><p>To illustrate the difference between <code>-S<regex> --pickaxe-regex</code> and |
| 4321 | <code>-G<regex></code>, consider a commit with the following diff in the same |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4322 | file:</p></div> |
| 4323 | <div class="listingblock"> |
| 4324 | <div class="content"> |
| Junio C Hamano | b7e497f | 2020-02-12 21:41:37 | [diff] [blame] | 4325 | <pre><code>+ return frotz(nitfol, two->ptr, 1, 0); |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4326 | ... |
| Junio C Hamano | b7e497f | 2020-02-12 21:41:37 | [diff] [blame] | 4327 | - hit = frotz(nitfol, mf2.ptr, 1, 0);</code></pre> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4328 | </div></div> |
| Junio C Hamano | b7e497f | 2020-02-12 21:41:37 | [diff] [blame] | 4329 | <div class="paragraph"><p>While <code>git log -G"frotz\(nitfol"</code> will show this commit, <code>git log |
| 4330 | -S"frotz\(nitfol" --pickaxe-regex</code> will not (because the number of |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4331 | occurrences of that string did not change).</p></div> |
| Junio C Hamano | ace33e4 | 2019-01-18 23:16:05 | [diff] [blame] | 4332 | <div class="paragraph"><p>Unless <code>--text</code> is supplied patches of binary files without a textconv |
| 4333 | filter will be ignored.</p></div> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4334 | <div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more |
| 4335 | information.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4336 | </dd> |
| 4337 | <dt class="hdlist1"> |
| Junio C Hamano | 7b9cce9 | 2018-01-23 22:34:27 | [diff] [blame] | 4338 | --find-object=<object-id> |
| 4339 | </dt> |
| 4340 | <dd> |
| 4341 | <p> |
| 4342 | Look for differences that change the number of occurrences of |
| 4343 | the specified object. Similar to <code>-S</code>, just the argument is different |
| 4344 | in that it doesn’t search for a specific string but for a specific |
| 4345 | object id. |
| 4346 | </p> |
| 4347 | <div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in |
| 4348 | <code>git-log</code> to also find trees.</p></div> |
| 4349 | </dd> |
| 4350 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4351 | --pickaxe-all |
| 4352 | </dt> |
| 4353 | <dd> |
| 4354 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4355 | When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4356 | changeset, not just the files that contain the change |
| 4357 | in <string>. |
| 4358 | </p> |
| 4359 | </dd> |
| 4360 | <dt class="hdlist1"> |
| 4361 | --pickaxe-regex |
| 4362 | </dt> |
| 4363 | <dd> |
| 4364 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4365 | Treat the <string> given to <code>-S</code> as an extended POSIX regular |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4366 | expression to match. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4367 | </p> |
| 4368 | </dd> |
| 4369 | <dt class="hdlist1"> |
| 4370 | -O<orderfile> |
| 4371 | </dt> |
| 4372 | <dd> |
| 4373 | <p> |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 4374 | Control the order in which files appear in the output. |
| Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 4375 | This overrides the <code>diff.orderFile</code> configuration variable |
| 4376 | (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] | 4377 | use <code>-O/dev/null</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4378 | </p> |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 4379 | <div class="paragraph"><p>The output order is determined by the order of glob patterns in |
| 4380 | <orderfile>. |
| 4381 | All files with pathnames that match the first pattern are output |
| 4382 | first, all files with pathnames that match the second pattern (but not |
| 4383 | the first) are output next, and so on. |
| 4384 | All files with pathnames that do not match any pattern are output |
| 4385 | last, as if there was an implicit match-all pattern at the end of the |
| 4386 | file. |
| 4387 | If multiple pathnames have the same rank (they match the same pattern |
| 4388 | but no earlier patterns), their output order relative to each other is |
| 4389 | the normal order.</p></div> |
| 4390 | <div class="paragraph"><p><orderfile> is parsed as follows:</p></div> |
| 4391 | <div class="openblock"> |
| 4392 | <div class="content"> |
| 4393 | <div class="ulist"><ul> |
| 4394 | <li> |
| 4395 | <p> |
| 4396 | Blank lines are ignored, so they can be used as separators for |
| 4397 | readability. |
| 4398 | </p> |
| 4399 | </li> |
| 4400 | <li> |
| 4401 | <p> |
| 4402 | Lines starting with a hash ("<code>#</code>") are ignored, so they can be used |
| 4403 | for comments. Add a backslash ("<code>\</code>") to the beginning of the |
| 4404 | pattern if it starts with a hash. |
| 4405 | </p> |
| 4406 | </li> |
| 4407 | <li> |
| 4408 | <p> |
| 4409 | Each other line contains a single pattern. |
| 4410 | </p> |
| 4411 | </li> |
| 4412 | </ul></div> |
| 4413 | </div></div> |
| 4414 | <div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for |
| Junio C Hamano | 96153bf | 2018-04-25 08:25:34 | [diff] [blame] | 4415 | fnmatch(3) without the FNM_PATHNAME flag, except a pathname also |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 4416 | matches a pattern if removing any number of the final pathname |
| 4417 | components matches the pattern. For example, the pattern "<code>foo*bar</code>" |
| 4418 | matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4419 | </dd> |
| 4420 | <dt class="hdlist1"> |
| 4421 | -R |
| 4422 | </dt> |
| 4423 | <dd> |
| 4424 | <p> |
| 4425 | Swap two inputs; that is, show differences from index or |
| 4426 | on-disk file to tree contents. |
| 4427 | </p> |
| 4428 | </dd> |
| 4429 | <dt class="hdlist1"> |
| 4430 | --relative[=<path>] |
| 4431 | </dt> |
| Junio C Hamano | 3ef9e67 | 2020-06-02 21:51:31 | [diff] [blame] | 4432 | <dt class="hdlist1"> |
| 4433 | --no-relative |
| 4434 | </dt> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4435 | <dd> |
| 4436 | <p> |
| 4437 | When run from a subdirectory of the project, it can be |
| 4438 | told to exclude changes outside the directory and show |
| 4439 | pathnames relative to it with this option. When you are |
| 4440 | not in a subdirectory (e.g. in a bare repository), you |
| 4441 | can name which subdirectory to make the output relative |
| 4442 | to by giving a <path> as an argument. |
| Junio C Hamano | 3ef9e67 | 2020-06-02 21:51:31 | [diff] [blame] | 4443 | <code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config |
| 4444 | option and previous <code>--relative</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4445 | </p> |
| 4446 | </dd> |
| 4447 | <dt class="hdlist1"> |
| 4448 | -a |
| 4449 | </dt> |
| 4450 | <dt class="hdlist1"> |
| 4451 | --text |
| 4452 | </dt> |
| 4453 | <dd> |
| 4454 | <p> |
| 4455 | Treat all files as text. |
| 4456 | </p> |
| 4457 | </dd> |
| 4458 | <dt class="hdlist1"> |
| Junio C Hamano | 4886c77 | 2017-11-27 03:33:28 | [diff] [blame] | 4459 | --ignore-cr-at-eol |
| 4460 | </dt> |
| 4461 | <dd> |
| 4462 | <p> |
| Junio C Hamano | 96153bf | 2018-04-25 08:25:34 | [diff] [blame] | 4463 | Ignore carriage-return at the end of line when doing a comparison. |
| Junio C Hamano | 4886c77 | 2017-11-27 03:33:28 | [diff] [blame] | 4464 | </p> |
| 4465 | </dd> |
| 4466 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4467 | --ignore-space-at-eol |
| 4468 | </dt> |
| 4469 | <dd> |
| 4470 | <p> |
| 4471 | Ignore changes in whitespace at EOL. |
| 4472 | </p> |
| 4473 | </dd> |
| 4474 | <dt class="hdlist1"> |
| 4475 | -b |
| 4476 | </dt> |
| 4477 | <dt class="hdlist1"> |
| 4478 | --ignore-space-change |
| 4479 | </dt> |
| 4480 | <dd> |
| 4481 | <p> |
| 4482 | Ignore changes in amount of whitespace. This ignores whitespace |
| 4483 | at line end, and considers all other sequences of one or |
| 4484 | more whitespace characters to be equivalent. |
| 4485 | </p> |
| 4486 | </dd> |
| 4487 | <dt class="hdlist1"> |
| 4488 | -w |
| 4489 | </dt> |
| 4490 | <dt class="hdlist1"> |
| 4491 | --ignore-all-space |
| 4492 | </dt> |
| 4493 | <dd> |
| 4494 | <p> |
| 4495 | Ignore whitespace when comparing lines. This ignores |
| 4496 | differences even if one line has whitespace where the other |
| 4497 | line has none. |
| 4498 | </p> |
| 4499 | </dd> |
| 4500 | <dt class="hdlist1"> |
| Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 4501 | --ignore-blank-lines |
| 4502 | </dt> |
| 4503 | <dd> |
| 4504 | <p> |
| 4505 | Ignore changes whose lines are all blank. |
| 4506 | </p> |
| 4507 | </dd> |
| 4508 | <dt class="hdlist1"> |
| Junio C Hamano | df3d3cd | 2020-11-02 22:05:05 | [diff] [blame^] | 4509 | -I<regex> |
| 4510 | </dt> |
| 4511 | <dt class="hdlist1"> |
| 4512 | --ignore-matching-lines=<regex> |
| 4513 | </dt> |
| 4514 | <dd> |
| 4515 | <p> |
| 4516 | Ignore changes whose all lines match <regex>. This option may |
| 4517 | be specified more than once. |
| 4518 | </p> |
| 4519 | </dd> |
| 4520 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4521 | --inter-hunk-context=<lines> |
| 4522 | </dt> |
| 4523 | <dd> |
| 4524 | <p> |
| 4525 | Show the context between diff hunks, up to the specified number |
| 4526 | of lines, thereby fusing hunks that are close to each other. |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 4527 | Defaults to <code>diff.interHunkContext</code> or 0 if the config option |
| 4528 | is unset. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4529 | </p> |
| 4530 | </dd> |
| 4531 | <dt class="hdlist1"> |
| Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 4532 | -W |
| 4533 | </dt> |
| 4534 | <dt class="hdlist1"> |
| 4535 | --function-context |
| 4536 | </dt> |
| 4537 | <dd> |
| 4538 | <p> |
| 4539 | Show whole surrounding functions of changes. |
| 4540 | </p> |
| 4541 | </dd> |
| 4542 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4543 | --ext-diff |
| 4544 | </dt> |
| 4545 | <dd> |
| 4546 | <p> |
| 4547 | Allow an external diff helper to be executed. If you set an |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4548 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 4549 | to use this option with <a href="git-log.html">git-log(1)</a> and friends. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4550 | </p> |
| 4551 | </dd> |
| 4552 | <dt class="hdlist1"> |
| 4553 | --no-ext-diff |
| 4554 | </dt> |
| 4555 | <dd> |
| 4556 | <p> |
| 4557 | Disallow external diff drivers. |
| 4558 | </p> |
| 4559 | </dd> |
| 4560 | <dt class="hdlist1"> |
| Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 4561 | --textconv |
| 4562 | </dt> |
| 4563 | <dt class="hdlist1"> |
| 4564 | --no-textconv |
| 4565 | </dt> |
| 4566 | <dd> |
| 4567 | <p> |
| 4568 | Allow (or disallow) external text conversion filters to be run |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4569 | when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for |
| Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 4570 | details. Because textconv filters are typically a one-way |
| 4571 | conversion, the resulting diff is suitable for human |
| 4572 | consumption, but cannot be applied. For this reason, textconv |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4573 | filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and |
| 4574 | <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or |
| Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 4575 | diff plumbing commands. |
| 4576 | </p> |
| 4577 | </dd> |
| 4578 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4579 | --ignore-submodules[=<when>] |
| 4580 | </dt> |
| 4581 | <dd> |
| 4582 | <p> |
| 4583 | Ignore changes to submodules in the diff generation. <when> can be |
| Junio C Hamano | c710296 | 2013-05-29 23:57:17 | [diff] [blame] | 4584 | either "none", "untracked", "dirty" or "all", which is the default. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4585 | Using "none" will consider the submodule modified when it either contains |
| 4586 | untracked or modified files or its HEAD differs from the commit recorded |
| 4587 | in the superproject and can be used to override any settings of the |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4588 | <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4589 | "untracked" is used submodules are not considered dirty when they only |
| 4590 | contain untracked content (but they are still scanned for modified |
| 4591 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 4592 | only changes to the commits stored in the superproject are shown (this was |
| 4593 | the behavior until 1.7.0). Using "all" hides all changes to submodules. |
| 4594 | </p> |
| 4595 | </dd> |
| 4596 | <dt class="hdlist1"> |
| 4597 | --src-prefix=<prefix> |
| 4598 | </dt> |
| 4599 | <dd> |
| 4600 | <p> |
| 4601 | Show the given source prefix instead of "a/". |
| 4602 | </p> |
| 4603 | </dd> |
| 4604 | <dt class="hdlist1"> |
| 4605 | --dst-prefix=<prefix> |
| 4606 | </dt> |
| 4607 | <dd> |
| 4608 | <p> |
| 4609 | Show the given destination prefix instead of "b/". |
| 4610 | </p> |
| 4611 | </dd> |
| 4612 | <dt class="hdlist1"> |
| 4613 | --no-prefix |
| 4614 | </dt> |
| 4615 | <dd> |
| 4616 | <p> |
| 4617 | Do not show any source or destination prefix. |
| 4618 | </p> |
| 4619 | </dd> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 4620 | <dt class="hdlist1"> |
| 4621 | --line-prefix=<prefix> |
| 4622 | </dt> |
| 4623 | <dd> |
| 4624 | <p> |
| 4625 | Prepend an additional prefix to every line of output. |
| 4626 | </p> |
| 4627 | </dd> |
| Junio C Hamano | f7017f1 | 2016-10-27 23:31:34 | [diff] [blame] | 4628 | <dt class="hdlist1"> |
| 4629 | --ita-invisible-in-index |
| 4630 | </dt> |
| 4631 | <dd> |
| 4632 | <p> |
| 4633 | By default entries added by "git add -N" appear as an existing |
| 4634 | empty file in "git diff" and a new file in "git diff --cached". |
| 4635 | This option makes the entry appear as a new file in "git diff" |
| 4636 | and non-existent in "git diff --cached". This option could be |
| 4637 | reverted with <code>--ita-visible-in-index</code>. Both options are |
| 4638 | experimental and could be removed in future. |
| 4639 | </p> |
| 4640 | </dd> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4641 | </dl></div> |
| 4642 | <div class="paragraph"><p>For more detailed explanation on these common options, see also |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4643 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4644 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4645 | </div> |
| 4646 | <div class="sect1"> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4647 | <h2 id="_generating_patch_text_with_p">Generating patch text with -p</h2> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4648 | <div class="sectionbody"> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4649 | <div class="paragraph"><p>Running |
| 4650 | <a href="git-diff.html">git-diff(1)</a>, |
| 4651 | <a href="git-log.html">git-log(1)</a>, |
| 4652 | <a href="git-show.html">git-show(1)</a>, |
| 4653 | <a href="git-diff-index.html">git-diff-index(1)</a>, |
| 4654 | <a href="git-diff-tree.html">git-diff-tree(1)</a>, or |
| 4655 | <a href="git-diff-files.html">git-diff-files(1)</a> |
| 4656 | with the <code>-p</code> option produces patch text. |
| 4657 | You can customize the creation of patch text via the |
| Junio C Hamano | 558abd2 | 2020-09-03 20:22:34 | [diff] [blame] | 4658 | <code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables |
| 4659 | (see <a href="git.html">git(1)</a>).</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4660 | <div class="paragraph"><p>What the -p option produces is slightly different from the traditional |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4661 | diff format:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4662 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4663 | <li> |
| 4664 | <p> |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4665 | It is preceded with a "git diff" header that looks like this: |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4666 | </p> |
| 4667 | <div class="literalblock"> |
| 4668 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4669 | <pre><code>diff --git a/file1 b/file2</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4670 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4671 | <div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4672 | involved. Especially, even for a creation or a deletion, |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4673 | <code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div> |
| 4674 | <div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4675 | name of the source file of the rename/copy and the name of |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4676 | the file that rename/copy produces, respectively.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4677 | </li> |
| 4678 | <li> |
| 4679 | <p> |
| 4680 | It is followed by one or more extended header lines: |
| 4681 | </p> |
| 4682 | <div class="literalblock"> |
| 4683 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4684 | <pre><code>old mode <mode> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4685 | new mode <mode> |
| 4686 | deleted file mode <mode> |
| 4687 | new file mode <mode> |
| 4688 | copy from <path> |
| 4689 | copy to <path> |
| 4690 | rename from <path> |
| 4691 | rename to <path> |
| 4692 | similarity index <number> |
| 4693 | dissimilarity index <number> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4694 | index <hash>..<hash> <mode></code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4695 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4696 | <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4697 | and file permission bits.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4698 | <div class="paragraph"><p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4699 | <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4700 | the dissimilarity index is the percentage of changed lines. It |
| 4701 | is a rounded down integer, followed by a percent sign. The |
| 4702 | similarity index value of 100% is thus reserved for two equal |
| 4703 | files, while 100% dissimilarity means that no line from the old |
| 4704 | file made it into the new one.</p></div> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4705 | <div class="paragraph"><p>The index line includes the blob object names before and after the change. |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4706 | The <mode> is included if the file mode does not change; otherwise, |
| 4707 | separate lines indicate the old and the new mode.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4708 | </li> |
| 4709 | <li> |
| 4710 | <p> |
| Junio C Hamano | 0f6f3bf | 2017-03-13 07:01:53 | [diff] [blame] | 4711 | Pathnames with "unusual" characters are quoted as explained for |
| 4712 | the configuration variable <code>core.quotePath</code> (see |
| 4713 | <a href="git-config.html">git-config(1)</a>). |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4714 | </p> |
| 4715 | </li> |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4716 | <li> |
| 4717 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4718 | All the <code>file1</code> files in the output refer to files before the |
| 4719 | commit, and all the <code>file2</code> files refer to files after the commit. |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4720 | It is incorrect to apply each change to each file sequentially. For |
| 4721 | example, this patch will swap a and b: |
| 4722 | </p> |
| 4723 | <div class="literalblock"> |
| 4724 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4725 | <pre><code>diff --git a/a b/b |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4726 | rename from a |
| 4727 | rename to b |
| 4728 | diff --git a/b b/a |
| 4729 | rename from b |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4730 | rename to a</code></pre> |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4731 | </div></div> |
| 4732 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4733 | </ol></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4734 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4735 | </div> |
| 4736 | <div class="sect1"> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4737 | <h2 id="_combined_diff_format">Combined diff format</h2> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4738 | <div class="sectionbody"> |
| Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 4739 | <div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to |
| Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 4740 | produce a <em>combined diff</em> when showing a merge. This is the default |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4741 | 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] | 4742 | <a href="git-show.html">git-show(1)</a>. Note also that you can give the <code>-m</code> option to any |
| Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 4743 | of these commands to force generation of diffs with individual parents |
| 4744 | of a merge.</p></div> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4745 | <div class="paragraph"><p>A "combined diff" format looks like this:</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4746 | <div class="listingblock"> |
| 4747 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4748 | <pre><code>diff --combined describe.c |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4749 | index fabadb8,cc95eb0..4866510 |
| 4750 | --- a/describe.c |
| 4751 | +++ b/describe.c |
| 4752 | @@@ -98,20 -98,12 +98,20 @@@ |
| 4753 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
| 4754 | } |
| 4755 | |
| 4756 | - static void describe(char *arg) |
| 4757 | -static void describe(struct commit *cmit, int last_one) |
| 4758 | ++static void describe(char *arg, int last_one) |
| 4759 | { |
| 4760 | + unsigned char sha1[20]; |
| 4761 | + struct commit *cmit; |
| 4762 | struct commit_list *list; |
| 4763 | static int initialized = 0; |
| 4764 | struct commit_name *n; |
| 4765 | |
| 4766 | + if (get_sha1(arg, sha1) < 0) |
| 4767 | + usage(describe_usage); |
| 4768 | + cmit = lookup_commit_reference(sha1); |
| 4769 | + if (!cmit) |
| 4770 | + usage(describe_usage); |
| 4771 | + |
| 4772 | if (!initialized) { |
| 4773 | initialized = 1; |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4774 | for_each_ref(get_name);</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4775 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4776 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4777 | <li> |
| 4778 | <p> |
| 4779 | It is preceded with a "git diff" header, that looks like |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4780 | this (when the <code>-c</code> option is used): |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4781 | </p> |
| 4782 | <div class="literalblock"> |
| 4783 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4784 | <pre><code>diff --combined file</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4785 | </div></div> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4786 | <div class="paragraph"><p>or like this (when the <code>--cc</code> option is used):</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4787 | <div class="literalblock"> |
| 4788 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4789 | <pre><code>diff --cc file</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4790 | </div></div> |
| 4791 | </li> |
| 4792 | <li> |
| 4793 | <p> |
| 4794 | It is followed by one or more extended header lines |
| 4795 | (this example shows a merge with two parents): |
| 4796 | </p> |
| 4797 | <div class="literalblock"> |
| 4798 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4799 | <pre><code>index <hash>,<hash>..<hash> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4800 | mode <mode>,<mode>..<mode> |
| 4801 | new file mode <mode> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4802 | deleted file mode <mode>,<mode></code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4803 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4804 | <div class="paragraph"><p>The <code>mode <mode>,<mode>..<mode></code> line appears only if at least one of |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4805 | the <mode> is different from the rest. Extended headers with |
| 4806 | information about detected contents movement (renames and |
| 4807 | copying detection) are designed to work with diff of two |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4808 | <tree-ish> and are not used by combined diff format.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4809 | </li> |
| 4810 | <li> |
| 4811 | <p> |
| 4812 | It is followed by two-line from-file/to-file header |
| 4813 | </p> |
| 4814 | <div class="literalblock"> |
| 4815 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4816 | <pre><code>--- a/file |
| 4817 | +++ b/file</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4818 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4819 | <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] | 4820 | format, <code>/dev/null</code> is used to signal created or deleted |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4821 | files.</p></div> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 4822 | <div class="paragraph"><p>However, if the --combined-all-paths option is provided, instead of a |
| 4823 | two-line from-file/to-file you get a N+1 line from-file/to-file header, |
| 4824 | where N is the number of parents in the merge commit</p></div> |
| 4825 | <div class="literalblock"> |
| 4826 | <div class="content"> |
| 4827 | <pre><code>--- a/file |
| 4828 | --- a/file |
| 4829 | --- a/file |
| 4830 | +++ b/file</code></pre> |
| 4831 | </div></div> |
| 4832 | <div class="paragraph"><p>This extended format can be useful if rename or copy detection is |
| 4833 | active, to allow you to see the original name of the file in different |
| 4834 | parents.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4835 | </li> |
| 4836 | <li> |
| 4837 | <p> |
| 4838 | Chunk header format is modified to prevent people from |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4839 | accidentally feeding it to <code>patch -p1</code>. Combined diff format |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4840 | was created for review of merge commit changes, and was not |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4841 | meant to be applied. The change is similar to the change in the |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4842 | extended <em>index</em> header: |
| 4843 | </p> |
| 4844 | <div class="literalblock"> |
| 4845 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4846 | <pre><code>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4847 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4848 | <div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4849 | header for combined diff format.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4850 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4851 | </ol></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4852 | <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] | 4853 | 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 |
| 4854 | added to B), or <code>" "</code> (space — unchanged) prefix, this format |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4855 | compares two or more files file1, file2,… with one file X, and |
| 4856 | shows how X differs from each of fileN. One column for each of |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4857 | fileN is prepended to the output line to note how X’s line is |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4858 | different from it.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4859 | <div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in |
| 4860 | fileN but it does not appear in the result. A <code>+</code> character |
| Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 4861 | in the column N means that the line appears in the result, |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4862 | and fileN does not have that line (in other words, the line was |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4863 | added, from the point of view of that parent).</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4864 | <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] | 4865 | from both files (hence two <code>-</code> removals from both file1 and |
| 4866 | 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] | 4867 | in either file1 or file2). Also eight other lines are the same |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4868 | from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div> |
| 4869 | <div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4870 | merge commit with the merge result (i.e. file1..fileN are the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4871 | parents). When shown by <code>git diff-files -c</code>, it compares the |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4872 | two unresolved merge parents with the working tree file |
| 4873 | (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4874 | "their version").</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4875 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4876 | </div> |
| 4877 | <div class="sect1"> |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 4878 | <h2 id="_examples">EXAMPLES</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4879 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4880 | <div class="dlist"><dl> |
| 4881 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4882 | <code>git log --no-merges</code> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4883 | </dt> |
| 4884 | <dd> |
| 4885 | <p> |
| 4886 | Show the whole commit history, but skip any merges |
| 4887 | </p> |
| 4888 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4889 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4890 | <code>git log v2.6.12.. include/scsi drivers/scsi</code> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4891 | </dt> |
| 4892 | <dd> |
| 4893 | <p> |
| 4894 | Show all commits since version <em>v2.6.12</em> that changed any file |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4895 | in the <code>include/scsi</code> or <code>drivers/scsi</code> subdirectories |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4896 | </p> |
| 4897 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4898 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4899 | <code>git log --since="2 weeks ago" -- gitk</code> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4900 | </dt> |
| 4901 | <dd> |
| 4902 | <p> |
| 4903 | Show the changes during the last two weeks to the file <em>gitk</em>. |
| Junio C Hamano | ccb8252 | 2018-05-08 07:52:09 | [diff] [blame] | 4904 | The <code>--</code> is necessary to avoid confusion with the <strong>branch</strong> named |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4905 | <em>gitk</em> |
| 4906 | </p> |
| 4907 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4908 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4909 | <code>git log --name-status release..test</code> |
| Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 4910 | </dt> |
| 4911 | <dd> |
| 4912 | <p> |
| 4913 | Show the commits that are in the "test" branch but not yet |
| 4914 | in the "release" branch, along with the list of paths |
| 4915 | each commit modifies. |
| 4916 | </p> |
| 4917 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4918 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4919 | <code>git log --follow builtin/rev-list.c</code> |
| Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 4920 | </dt> |
| 4921 | <dd> |
| 4922 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4923 | Shows the commits that changed <code>builtin/rev-list.c</code>, including |
| Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 4924 | those commits that occurred before the file was given its |
| 4925 | present name. |
| 4926 | </p> |
| 4927 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4928 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4929 | <code>git log --branches --not --remotes=origin</code> |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 4930 | </dt> |
| 4931 | <dd> |
| 4932 | <p> |
| 4933 | Shows all commits that are in any of local branches but not in |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 4934 | any of remote-tracking branches for <em>origin</em> (what you have that |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4935 | origin doesn’t). |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 4936 | </p> |
| 4937 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4938 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4939 | <code>git log master --not --remotes=*/master</code> |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 4940 | </dt> |
| 4941 | <dd> |
| 4942 | <p> |
| 4943 | Shows all commits that are in local master but not in any remote |
| 4944 | repository master branches. |
| 4945 | </p> |
| 4946 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4947 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4948 | <code>git log -p -m --first-parent</code> |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 4949 | </dt> |
| 4950 | <dd> |
| 4951 | <p> |
| 4952 | Shows the history including change diffs, but only from the |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 4953 | “main branch” perspective, skipping commits that come from merged |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 4954 | branches, and showing full diffs of changes introduced by the merges. |
| 4955 | This makes sense only when following a strict policy of merging all |
| 4956 | topic branches when staying on a single integration branch. |
| 4957 | </p> |
| 4958 | </dd> |
| Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 4959 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4960 | <code>git log -L '/int main/',/^}/:main.c</code> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 4961 | </dt> |
| 4962 | <dd> |
| 4963 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4964 | Shows how the function <code>main()</code> in the file <code>main.c</code> evolved |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 4965 | over time. |
| 4966 | </p> |
| 4967 | </dd> |
| 4968 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4969 | <code>git log -3</code> |
| Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 4970 | </dt> |
| 4971 | <dd> |
| 4972 | <p> |
| 4973 | Limits the number of commits to show to 3. |
| 4974 | </p> |
| 4975 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4976 | </dl></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4977 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4978 | </div> |
| 4979 | <div class="sect1"> |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 4980 | <h2 id="_discussion">DISCUSSION</h2> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 4981 | <div class="sectionbody"> |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 4982 | <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] | 4983 | <div class="ulist"><ul> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 4984 | <li> |
| 4985 | <p> |
| Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 4986 | The contents of the blob objects are uninterpreted sequences |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 4987 | of bytes. There is no encoding translation at the core |
| 4988 | level. |
| 4989 | </p> |
| 4990 | </li> |
| 4991 | <li> |
| 4992 | <p> |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 4993 | Path names are encoded in UTF-8 normalization form C. This |
| 4994 | applies to tree objects, the index file, ref names, as well as |
| 4995 | path names in command line arguments, environment variables |
| 4996 | and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>), |
| 4997 | <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and |
| 4998 | <a href="gitmodules.html">gitmodules(5)</a>). |
| 4999 | </p> |
| 5000 | <div class="paragraph"><p>Note that Git at the core level treats path names simply as |
| 5001 | sequences of non-NUL bytes, there are no path name encoding |
| 5002 | conversions (except on Mac and Windows). Therefore, using |
| 5003 | non-ASCII path names will mostly work even on platforms and file |
| 5004 | systems that use legacy extended ASCII encodings. However, |
| 5005 | repositories created on such systems will not work properly on |
| 5006 | UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa. |
| 5007 | Additionally, many Git-based tools simply assume path names to |
| 5008 | be UTF-8 and will fail to display other encodings correctly.</p></div> |
| 5009 | </li> |
| 5010 | <li> |
| 5011 | <p> |
| 5012 | Commit log messages are typically encoded in UTF-8, but other |
| 5013 | extended ASCII encodings are also supported. This includes |
| 5014 | ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32, |
| 5015 | EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5, |
| 5016 | EUC-x, CP9xx etc.). |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5017 | </p> |
| 5018 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5019 | </ul></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5020 | <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] | 5021 | 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] | 5022 | force UTF-8 on projects. If all participants of a particular |
| Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 5023 | project find it more convenient to use legacy encodings, Git |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5024 | 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] | 5025 | mind.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5026 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5027 | <li> |
| 5028 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 5029 | <em>git commit</em> and <em>git commit-tree</em> issues |
| Junio C Hamano | 14b7648 | 2008-01-05 10:32:26 | [diff] [blame] | 5030 | 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] | 5031 | like a valid UTF-8 string, unless you explicitly say your |
| 5032 | project uses a legacy encoding. The way to say this is to |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5033 | have i18n.commitencoding in <code>.git/config</code> file, like this: |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5034 | </p> |
| 5035 | <div class="listingblock"> |
| 5036 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5037 | <pre><code>[i18n] |
| Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 5038 | commitEncoding = ISO-8859-1</code></pre> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5039 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5040 | <div class="paragraph"><p>Commit objects created with the above setting record the value |
| Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 5041 | 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] | 5042 | help other people who look at them later. Lack of this header |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5043 | 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] | 5044 | </li> |
| 5045 | <li> |
| 5046 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 5047 | <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] | 5048 | <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] | 5049 | log message into UTF-8 unless otherwise specified. You can |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5050 | specify the desired output encoding with |
| Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 5051 | <code>i18n.logOutputEncoding</code> in <code>.git/config</code> file, like this: |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5052 | </p> |
| 5053 | <div class="listingblock"> |
| 5054 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5055 | <pre><code>[i18n] |
| Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 5056 | logOutputEncoding = ISO-8859-1</code></pre> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5057 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5058 | <div class="paragraph"><p>If you do not have this configuration variable, the value of |
| Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 5059 | <code>i18n.commitEncoding</code> is used instead.</p></div> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5060 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5061 | </ol></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5062 | <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] | 5063 | message when a commit is made to force UTF-8 at the commit |
| 5064 | object level, because re-coding to UTF-8 is not necessarily a |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5065 | reversible operation.</p></div> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5066 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5067 | </div> |
| 5068 | <div class="sect1"> |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 5069 | <h2 id="_configuration">CONFIGURATION</h2> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5070 | <div class="sectionbody"> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 5071 | <div class="paragraph"><p>See <a href="git-config.html">git-config(1)</a> for core variables and <a href="git-diff.html">git-diff(1)</a> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5072 | for settings related to diff generation.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5073 | <div class="dlist"><dl> |
| 5074 | <dt class="hdlist1"> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5075 | format.pretty |
| 5076 | </dt> |
| 5077 | <dd> |
| 5078 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5079 | Default for the <code>--format</code> option. (See <em>Pretty Formats</em> above.) |
| 5080 | Defaults to <code>medium</code>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5081 | </p> |
| 5082 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5083 | <dt class="hdlist1"> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5084 | i18n.logOutputEncoding |
| 5085 | </dt> |
| 5086 | <dd> |
| 5087 | <p> |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 5088 | Encoding to use when displaying logs. (See <em>Discussion</em> above.) |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5089 | Defaults to the value of <code>i18n.commitEncoding</code> if set, and UTF-8 |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5090 | otherwise. |
| 5091 | </p> |
| 5092 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5093 | <dt class="hdlist1"> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5094 | log.date |
| 5095 | </dt> |
| 5096 | <dd> |
| 5097 | <p> |
| 5098 | Default format for human-readable dates. (Compare the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5099 | <code>--date</code> option.) Defaults to "default", which means to write |
| 5100 | dates like <code>Sat May 8 19:35:34 2010 -0500</code>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5101 | </p> |
| Junio C Hamano | 23168ef | 2019-02-07 07:20:47 | [diff] [blame] | 5102 | <div class="paragraph"><p>If the format is set to "auto:foo" and the pager is in use, format |
| 5103 | "foo" will be the used for the date format. Otherwise "default" will |
| 5104 | be used.</p></div> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5105 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5106 | <dt class="hdlist1"> |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 5107 | log.follow |
| 5108 | </dt> |
| 5109 | <dd> |
| 5110 | <p> |
| Junio C Hamano | b0a1e83 | 2015-10-15 23:08:31 | [diff] [blame] | 5111 | If <code>true</code>, <code>git log</code> will act as if the <code>--follow</code> option was used when |
| 5112 | a single <path> is given. This has the same limitations as <code>--follow</code>, |
| 5113 | i.e. it cannot be used to follow multiple files and does not work well |
| 5114 | on non-linear history. |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 5115 | </p> |
| 5116 | </dd> |
| 5117 | <dt class="hdlist1"> |
| Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 5118 | log.showRoot |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5119 | </dt> |
| 5120 | <dd> |
| 5121 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5122 | If <code>false</code>, <code>git log</code> and related commands will not treat the |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5123 | initial commit as a big creation event. Any root commits in |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5124 | <code>git log -p</code> output would be shown without a diff attached. |
| 5125 | The default is <code>true</code>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5126 | </p> |
| 5127 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5128 | <dt class="hdlist1"> |
| Junio C Hamano | 48931e2 | 2016-07-11 20:08:47 | [diff] [blame] | 5129 | log.showSignature |
| 5130 | </dt> |
| 5131 | <dd> |
| 5132 | <p> |
| 5133 | If <code>true</code>, <code>git log</code> and related commands will act as if the |
| 5134 | <code>--show-signature</code> option was passed to them. |
| 5135 | </p> |
| 5136 | </dd> |
| 5137 | <dt class="hdlist1"> |
| Junio C Hamano | abad6da | 2013-01-06 09:06:32 | [diff] [blame] | 5138 | mailmap.* |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5139 | </dt> |
| 5140 | <dd> |
| 5141 | <p> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 5142 | See <a href="git-shortlog.html">git-shortlog(1)</a>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5143 | </p> |
| 5144 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5145 | <dt class="hdlist1"> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5146 | notes.displayRef |
| 5147 | </dt> |
| 5148 | <dd> |
| 5149 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5150 | Which refs, in addition to the default set by <code>core.notesRef</code> |
| Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 5151 | or <code>GIT_NOTES_REF</code>, to read notes from when showing commit |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5152 | messages with the <code>log</code> family of commands. See |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 5153 | <a href="git-notes.html">git-notes(1)</a>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5154 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5155 | <div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5156 | multiple times. A warning will be issued for refs that do not exist, |
| 5157 | but a glob that does not match any refs is silently ignored.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5158 | <div class="paragraph"><p>This setting can be disabled by the <code>--no-notes</code> option, |
| Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 5159 | overridden by the <code>GIT_NOTES_DISPLAY_REF</code> environment variable, |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5160 | and overridden by the <code>--notes=<ref></code> option.</p></div> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5161 | </dd> |
| 5162 | </dl></div> |
| 5163 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5164 | </div> |
| 5165 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5166 | <h2 id="_git">GIT</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5167 | <div class="sectionbody"> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 5168 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5169 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 5170 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5171 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 5172 | <div id="footnotes"><hr /></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5173 | <div id="footer"> |
| 5174 | <div id="footer-text"> |
| Junio C Hamano | 2ef0ba3 | 2018-01-26 23:13:53 | [diff] [blame] | 5175 | Last updated |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 5176 | 2020-08-17 17:32:33 PDT |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5177 | </div> |
| 5178 | </div> |
| 5179 | </body> |
| 5180 | </html> |