| 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 | a85030a | 2022-07-27 16:48:21 | [diff] [blame] | 7 | <meta name="generator" content="AsciiDoc 10.2.0" /> |
| 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 | 2b15318 | 2021-12-15 21:00:31 | [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; |
| 583 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
| 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"); |
| 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]; |
| 612 | if (entry.nodeName.toLowerCase() == 'div' |
| 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. |
| 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 () { |
| 649 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 650 | var i; |
| 651 | var noteholder = document.getElementById("footnotes"); |
| 652 | if (!noteholder) { |
| 653 | return; |
| 654 | } |
| 655 | var entriesToRemove = []; |
| 656 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 657 | var entry = noteholder.childNodes[i]; |
| 658 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
| 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"); |
| 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++; |
| 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 | } |
| 683 | noteholder.innerHTML += |
| 684 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 685 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 686 | n + "</a>. " + note + "</div>"; |
| 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 | } |
| 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; |
| 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 | 59a32b0 | 2021-12-10 22:53:38 | [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 |
| Junio C Hamano | 91a411f | 2021-07-14 00:40:50 | [diff] [blame] | 827 | shown. The option <code>--decorate</code> is short-hand for <code>--decorate=short</code>. |
| 828 | Default to configuration value of <code>log.decorate</code> if configured, |
| 829 | otherwise, <code>auto</code>. |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 830 | </p> |
| 831 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 832 | <dt class="hdlist1"> |
| Junio C Hamano | 371470a | 2017-12-13 22:26:40 | [diff] [blame] | 833 | --decorate-refs=<pattern> |
| 834 | </dt> |
| 835 | <dt class="hdlist1"> |
| 836 | --decorate-refs-exclude=<pattern> |
| 837 | </dt> |
| 838 | <dd> |
| 839 | <p> |
| Junio C Hamano | 594d2d4 | 2022-08-30 17:58:50 | [diff] [blame^] | 840 | For each candidate reference, do not use it for decoration if it |
| Junio C Hamano | 371470a | 2017-12-13 22:26:40 | [diff] [blame] | 841 | 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] | 842 | doesn’t match any of the patterns given to <code>--decorate-refs</code>. The |
| 843 | <code>log.excludeDecoration</code> config option allows excluding refs from |
| 844 | the decorations, but an explicit <code>--decorate-refs</code> pattern will |
| 845 | override a match in <code>log.excludeDecoration</code>. |
| Junio C Hamano | 371470a | 2017-12-13 22:26:40 | [diff] [blame] | 846 | </p> |
| Junio C Hamano | 594d2d4 | 2022-08-30 17:58:50 | [diff] [blame^] | 847 | <div class="paragraph"><p>If none of these options or config settings are given, then references are |
| 848 | used as decoration if they match <code>HEAD</code>, <code>refs/heads/</code>, <code>refs/remotes/</code>, |
| 849 | <code>refs/stash/</code>, or <code>refs/tags/</code>.</p></div> |
| 850 | </dd> |
| 851 | <dt class="hdlist1"> |
| 852 | --clear-decorations |
| 853 | </dt> |
| 854 | <dd> |
| 855 | <p> |
| 856 | When specified, this option clears all previous <code>--decorate-refs</code> |
| 857 | or <code>--decorate-refs-exclude</code> options and relaxes the default |
| 858 | decoration filter to include all references. This option is |
| 859 | assumed if the config value <code>log.initialDecorationSet</code> is set to |
| 860 | <code>all</code>. |
| 861 | </p> |
| Junio C Hamano | 371470a | 2017-12-13 22:26:40 | [diff] [blame] | 862 | </dd> |
| 863 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 864 | --source |
| 865 | </dt> |
| 866 | <dd> |
| 867 | <p> |
| 868 | Print out the ref name given on the command line by which each |
| 869 | commit was reached. |
| 870 | </p> |
| 871 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 872 | <dt class="hdlist1"> |
| Junio C Hamano | 0dd5094 | 2020-04-29 21:21:05 | [diff] [blame] | 873 | --[no-]mailmap |
| 874 | </dt> |
| 875 | <dt class="hdlist1"> |
| Junio C Hamano | 3659495 | 2019-07-25 22:26:52 | [diff] [blame] | 876 | --[no-]use-mailmap |
| Junio C Hamano | ce836cc | 2013-01-21 02:01:53 | [diff] [blame] | 877 | </dt> |
| 878 | <dd> |
| 879 | <p> |
| 880 | Use mailmap file to map author and committer names and email |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 881 | addresses to canonical real names and email addresses. See |
| Junio C Hamano | ce836cc | 2013-01-21 02:01:53 | [diff] [blame] | 882 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
| 883 | </p> |
| 884 | </dd> |
| 885 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 886 | --full-diff |
| 887 | </dt> |
| 888 | <dd> |
| 889 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 890 | Without this flag, <code>git log -p <path>...</code> shows commits that |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 891 | touch the specified paths, and diffs about the same specified |
| 892 | paths. With this, the full diff is shown for commits that touch |
| 893 | the specified paths; this means that "<path>…" limits only |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 894 | commits, and doesn’t limit diff for those commits. |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 895 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 896 | <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] | 897 | produced by <code>--stat</code>, etc.</p></div> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 898 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 899 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 900 | --log-size |
| 901 | </dt> |
| 902 | <dd> |
| 903 | <p> |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 904 | Include a line “log size <number>” in the output for each commit, |
| 905 | where <number> is the length of that commit’s message in bytes. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 906 | 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] | 907 | output by allowing them to allocate space in advance. |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 908 | </p> |
| 909 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 910 | <dt class="hdlist1"> |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 911 | -L<start>,<end>:<file> |
| Junio C Hamano | 8eac268 | 2013-09-09 22:35:20 | [diff] [blame] | 912 | </dt> |
| 913 | <dt class="hdlist1"> |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 914 | -L:<funcname>:<file> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 915 | </dt> |
| 916 | <dd> |
| 917 | <p> |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 918 | Trace the evolution of the line range given by <em><start>,<end></em>, |
| 919 | or by the function name regex <em><funcname></em>, within the <em><file></em>. You may |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 920 | not give any pathspec limiters. This is currently limited to |
| 921 | a walk starting from a single revision, i.e., you may only |
| Junio C Hamano | 6879384 | 2020-01-06 23:07:09 | [diff] [blame] | 922 | give zero or one positive revision arguments, and |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 923 | <em><start></em> and <em><end></em> (or <em><funcname></em>) must exist in the starting revision. |
| Junio C Hamano | 6879384 | 2020-01-06 23:07:09 | [diff] [blame] | 924 | You can specify this option more than once. Implies <code>--patch</code>. |
| 925 | Patch output can be suppressed using <code>--no-patch</code>, but other diff formats |
| 926 | (namely <code>--raw</code>, <code>--numstat</code>, <code>--shortstat</code>, <code>--dirstat</code>, <code>--summary</code>, |
| 927 | <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] | 928 | </p> |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 929 | <div class="paragraph"><p><em><start></em> and <em><end></em> can take one of these forms:</p></div> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 930 | <div class="ulist"><ul> |
| 931 | <li> |
| 932 | <p> |
| 933 | number |
| 934 | </p> |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 935 | <div class="paragraph"><p>If <em><start></em> or <em><end></em> is a number, it specifies an |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 936 | absolute line number (lines count from 1).</p></div> |
| 937 | </li> |
| 938 | <li> |
| 939 | <p> |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 940 | <code>/regex/</code> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 941 | </p> |
| 942 | <div class="paragraph"><p>This form will use the first line matching the given |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 943 | POSIX regex. If <em><start></em> is a regex, it will search from the end of |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 944 | the previous <code>-L</code> range, if any, otherwise from the start of file. |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 945 | If <em><start></em> is <code>^/regex/</code>, it will search from the start of file. |
| 946 | If <em><end></em> is a regex, it will search |
| 947 | starting at the line given by <em><start></em>.</p></div> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 948 | </li> |
| 949 | <li> |
| 950 | <p> |
| 951 | +offset or -offset |
| 952 | </p> |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 953 | <div class="paragraph"><p>This is only valid for <em><end></em> and will specify a number |
| 954 | of lines before or after the line given by <em><start></em>.</p></div> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 955 | </li> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 956 | </ul></div> |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 957 | <div class="paragraph"><p>If <code>:<funcname></code> is given in place of <em><start></em> and <em><end></em>, it is a |
| Junio C Hamano | dd5004a | 2015-05-06 19:33:32 | [diff] [blame] | 958 | regular expression that denotes the range from the first funcname line |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 959 | that matches <em><funcname></em>, up to the next funcname line. <code>:<funcname></code> |
| Junio C Hamano | dd5004a | 2015-05-06 19:33:32 | [diff] [blame] | 960 | searches from the end of the previous <code>-L</code> range, if any, otherwise |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 961 | from the start of file. <code>^:<funcname></code> searches from the start of |
| 962 | file. The function names are determined in the same way as <code>git diff</code> |
| 963 | works out patch hunk headers (see <em>Defining a custom hunk-header</em> |
| 964 | in <a href="gitattributes.html">gitattributes(5)</a>).</p></div> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 965 | </dd> |
| 966 | <dt class="hdlist1"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 967 | <revision-range> |
| Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 968 | </dt> |
| 969 | <dd> |
| 970 | <p> |
| 971 | Show only commits in the specified revision range. When no |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 972 | <revision-range> is specified, it defaults to <code>HEAD</code> (i.e. the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 973 | whole history leading to the current commit). <code>origin..HEAD</code> |
| Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 974 | specifies all the commits reachable from the current commit |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 975 | (i.e. <code>HEAD</code>), but not from <code>origin</code>. For a complete list of |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 976 | ways to spell <revision-range>, see the <em>Specifying Ranges</em> |
| Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 977 | section of <a href="gitrevisions.html">gitrevisions(7)</a>. |
| 978 | </p> |
| 979 | </dd> |
| 980 | <dt class="hdlist1"> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 981 | [--] <path>… |
| 982 | </dt> |
| 983 | <dd> |
| 984 | <p> |
| Junio C Hamano | 5723afa | 2011-08-31 00:49:23 | [diff] [blame] | 985 | Show only commits that are enough to explain how the files |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 986 | that match the specified paths came to be. See <em>History |
| 987 | Simplification</em> below for details and other simplification |
| Junio C Hamano | 5723afa | 2011-08-31 00:49:23 | [diff] [blame] | 988 | modes. |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 989 | </p> |
| Junio C Hamano | ccb8252 | 2018-05-08 07:52:09 | [diff] [blame] | 990 | <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] | 991 | options or the revision range, when confusion arises.</p></div> |
| Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 992 | </dd> |
| 993 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 994 | <div class="sect2"> |
| 995 | <h3 id="_commit_limiting">Commit Limiting</h3> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 996 | <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] | 997 | special notations explained in the description, additional commit |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 998 | limiting may be applied.</p></div> |
| 999 | <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] | 1000 | <code>--since=<date1></code> limits to commits newer than <code><date1></code>, and using it |
| 1001 | with <code>--grep=<pattern></code> further limits to commits whose log message |
| 1002 | 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] | 1003 | <div class="paragraph"><p>Note that these are applied before commit |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1004 | ordering and formatting options, such as <code>--reverse</code>.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1005 | <div class="dlist"><dl> |
| 1006 | <dt class="hdlist1"> |
| Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 1007 | -<number> |
| 1008 | </dt> |
| 1009 | <dt class="hdlist1"> |
| 1010 | -n <number> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1011 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1012 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1013 | --max-count=<number> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1014 | </dt> |
| 1015 | <dd> |
| 1016 | <p> |
| Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 1017 | Limit the number of commits to output. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1018 | </p> |
| 1019 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1020 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1021 | --skip=<number> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1022 | </dt> |
| 1023 | <dd> |
| 1024 | <p> |
| 1025 | Skip <em>number</em> commits before starting to show the commit output. |
| 1026 | </p> |
| 1027 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1028 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1029 | --since=<date> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1030 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1031 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1032 | --after=<date> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1033 | </dt> |
| 1034 | <dd> |
| 1035 | <p> |
| 1036 | Show commits more recent than a specific date. |
| 1037 | </p> |
| 1038 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1039 | <dt class="hdlist1"> |
| Junio C Hamano | 72ea2ca | 2022-05-21 00:51:23 | [diff] [blame] | 1040 | --since-as-filter=<date> |
| 1041 | </dt> |
| 1042 | <dd> |
| 1043 | <p> |
| 1044 | Show all commits more recent than a specific date. This visits |
| 1045 | all commits in the range, rather than stopping at the first commit which |
| 1046 | is older than a specific date. |
| 1047 | </p> |
| 1048 | </dd> |
| 1049 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1050 | --until=<date> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1051 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1052 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1053 | --before=<date> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1054 | </dt> |
| 1055 | <dd> |
| 1056 | <p> |
| 1057 | Show commits older than a specific date. |
| 1058 | </p> |
| 1059 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1060 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1061 | --author=<pattern> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1062 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1063 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1064 | --committer=<pattern> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1065 | </dt> |
| 1066 | <dd> |
| 1067 | <p> |
| 1068 | Limit the commits output to ones with author/committer |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1069 | header lines that match the specified pattern (regular |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1070 | expression). With more than one <code>--author=<pattern></code>, |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1071 | commits whose author matches any of the given patterns are |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1072 | chosen (similarly for multiple <code>--committer=<pattern></code>). |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1073 | </p> |
| 1074 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1075 | <dt class="hdlist1"> |
| Junio C Hamano | 9954ed7 | 2012-10-03 04:54:00 | [diff] [blame] | 1076 | --grep-reflog=<pattern> |
| 1077 | </dt> |
| 1078 | <dd> |
| 1079 | <p> |
| 1080 | Limit the commits output to ones with reflog entries that |
| 1081 | match the specified pattern (regular expression). With |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1082 | more than one <code>--grep-reflog</code>, commits whose reflog message |
| Junio C Hamano | 9954ed7 | 2012-10-03 04:54:00 | [diff] [blame] | 1083 | matches any of the given patterns are chosen. It is an |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1084 | 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] | 1085 | </p> |
| 1086 | </dd> |
| 1087 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1088 | --grep=<pattern> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1089 | </dt> |
| 1090 | <dd> |
| 1091 | <p> |
| 1092 | Limit the commits output to ones with log message that |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1093 | matches the specified pattern (regular expression). With |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1094 | more than one <code>--grep=<pattern></code>, commits whose message |
| Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1095 | matches any of the given patterns are chosen (but see |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1096 | <code>--all-match</code>). |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1097 | </p> |
| Junio C Hamano | b3f862c | 2019-12-05 22:22:00 | [diff] [blame] | 1098 | <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] | 1099 | matched as if it were part of the log message.</p></div> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1100 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1101 | <dt class="hdlist1"> |
| Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1102 | --all-match |
| 1103 | </dt> |
| 1104 | <dd> |
| 1105 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1106 | 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] | 1107 | instead of ones that match at least one. |
| Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1108 | </p> |
| 1109 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1110 | <dt class="hdlist1"> |
| Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 1111 | --invert-grep |
| 1112 | </dt> |
| 1113 | <dd> |
| 1114 | <p> |
| 1115 | Limit the commits output to ones with log message that do not |
| 1116 | match the pattern specified with <code>--grep=<pattern></code>. |
| 1117 | </p> |
| 1118 | </dd> |
| 1119 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1120 | -i |
| 1121 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1122 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1123 | --regexp-ignore-case |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1124 | </dt> |
| 1125 | <dd> |
| 1126 | <p> |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1127 | Match the regular expression limiting patterns without regard to letter |
| 1128 | case. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1129 | </p> |
| 1130 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1131 | <dt class="hdlist1"> |
| Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1132 | --basic-regexp |
| 1133 | </dt> |
| 1134 | <dd> |
| 1135 | <p> |
| 1136 | Consider the limiting patterns to be basic regular expressions; |
| 1137 | this is the default. |
| 1138 | </p> |
| 1139 | </dd> |
| 1140 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1141 | -E |
| 1142 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1143 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1144 | --extended-regexp |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1145 | </dt> |
| 1146 | <dd> |
| 1147 | <p> |
| 1148 | Consider the limiting patterns to be extended regular expressions |
| 1149 | instead of the default basic regular expressions. |
| 1150 | </p> |
| 1151 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1152 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1153 | -F |
| 1154 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1155 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1156 | --fixed-strings |
| Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1157 | </dt> |
| 1158 | <dd> |
| 1159 | <p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1160 | Consider the limiting patterns to be fixed strings (don’t interpret |
| Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1161 | pattern as a regular expression). |
| 1162 | </p> |
| 1163 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1164 | <dt class="hdlist1"> |
| Junio C Hamano | a275c1f | 2017-06-19 20:10:12 | [diff] [blame] | 1165 | -P |
| 1166 | </dt> |
| 1167 | <dt class="hdlist1"> |
| Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1168 | --perl-regexp |
| 1169 | </dt> |
| 1170 | <dd> |
| 1171 | <p> |
| Junio C Hamano | 222ed82 | 2017-06-02 06:24:06 | [diff] [blame] | 1172 | Consider the limiting patterns to be Perl-compatible regular |
| 1173 | expressions. |
| Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1174 | </p> |
| Junio C Hamano | 222ed82 | 2017-06-02 06:24:06 | [diff] [blame] | 1175 | <div class="paragraph"><p>Support for these types of regular expressions is an optional |
| 1176 | compile-time dependency. If Git wasn’t compiled with support for them |
| 1177 | providing this option will cause it to die.</p></div> |
| Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1178 | </dd> |
| 1179 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1180 | --remove-empty |
| 1181 | </dt> |
| 1182 | <dd> |
| 1183 | <p> |
| 1184 | Stop when a given path disappears from the tree. |
| 1185 | </p> |
| 1186 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1187 | <dt class="hdlist1"> |
| Junio C Hamano | 934e178 | 2009-07-16 06:59:15 | [diff] [blame] | 1188 | --merges |
| 1189 | </dt> |
| 1190 | <dd> |
| 1191 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1192 | 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] | 1193 | </p> |
| 1194 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1195 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1196 | --no-merges |
| 1197 | </dt> |
| 1198 | <dd> |
| 1199 | <p> |
| Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1200 | Do not print commits with more than one parent. This is |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1201 | exactly the same as <code>--max-parents=1</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1202 | </p> |
| 1203 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1204 | <dt class="hdlist1"> |
| Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1205 | --min-parents=<number> |
| 1206 | </dt> |
| 1207 | <dt class="hdlist1"> |
| 1208 | --max-parents=<number> |
| 1209 | </dt> |
| 1210 | <dt class="hdlist1"> |
| 1211 | --no-min-parents |
| 1212 | </dt> |
| 1213 | <dt class="hdlist1"> |
| 1214 | --no-max-parents |
| 1215 | </dt> |
| 1216 | <dd> |
| 1217 | <p> |
| Junio C Hamano | c5bb3b3 | 2013-08-05 22:43:36 | [diff] [blame] | 1218 | 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] | 1219 | commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>, |
| 1220 | <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code> |
| 1221 | 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] | 1222 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1223 | <div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit) |
| 1224 | again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more |
| 1225 | 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] | 1226 | </dd> |
| 1227 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1228 | --first-parent |
| 1229 | </dt> |
| 1230 | <dd> |
| 1231 | <p> |
| Junio C Hamano | 034a2ff | 2022-02-18 00:40:11 | [diff] [blame] | 1232 | When finding commits to include, follow only the first |
| 1233 | parent commit upon seeing a merge commit. This option |
| 1234 | can give a better overview when viewing the evolution of |
| 1235 | a particular topic branch, because merges into a topic |
| 1236 | branch tend to be only about adjusting to updated upstream |
| 1237 | from time to time, and this option allows you to ignore |
| 1238 | the individual commits brought in to your history by such |
| 1239 | a merge. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1240 | </p> |
| Junio C Hamano | a372d5b | 2021-02-26 01:34:37 | [diff] [blame] | 1241 | <div class="paragraph"><p>This option also changes default diff format for merge commits |
| 1242 | to <code>first-parent</code>, see <code>--diff-merges=first-parent</code> for details.</p></div> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1243 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1244 | <dt class="hdlist1"> |
| Junio C Hamano | 034a2ff | 2022-02-18 00:40:11 | [diff] [blame] | 1245 | --exclude-first-parent-only |
| 1246 | </dt> |
| 1247 | <dd> |
| 1248 | <p> |
| 1249 | When finding commits to exclude (with a <em>^</em>), follow only |
| 1250 | the first parent commit upon seeing a merge commit. |
| 1251 | This can be used to find the set of changes in a topic branch |
| 1252 | from the point where it diverged from the remote branch, given |
| 1253 | that arbitrary merges can be valid topic branch changes. |
| 1254 | </p> |
| 1255 | </dd> |
| 1256 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1257 | --not |
| 1258 | </dt> |
| 1259 | <dd> |
| 1260 | <p> |
| 1261 | Reverses the meaning of the <em>^</em> prefix (or lack thereof) |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1262 | for all following revision specifiers, up to the next <code>--not</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1263 | </p> |
| 1264 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1265 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1266 | --all |
| 1267 | </dt> |
| 1268 | <dd> |
| 1269 | <p> |
| Junio C Hamano | e89102f | 2017-02-15 23:18:15 | [diff] [blame] | 1270 | Pretend as if all the refs in <code>refs/</code>, along with <code>HEAD</code>, are |
| 1271 | listed on the command line as <em><commit></em>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1272 | </p> |
| 1273 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1274 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1275 | --branches[=<pattern>] |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1276 | </dt> |
| 1277 | <dd> |
| 1278 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1279 | 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] | 1280 | 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] | 1281 | branches to ones matching given shell glob. If pattern lacks <em>?</em>, |
| Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1282 | <em>*</em>, or <em>[</em>, <em>/*</em> at the end is implied. |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1283 | </p> |
| 1284 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1285 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1286 | --tags[=<pattern>] |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1287 | </dt> |
| 1288 | <dd> |
| 1289 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1290 | 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] | 1291 | 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] | 1292 | tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>*</em>, |
| 1293 | or <em>[</em>, <em>/*</em> at the end is implied. |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1294 | </p> |
| 1295 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1296 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1297 | --remotes[=<pattern>] |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1298 | </dt> |
| 1299 | <dd> |
| 1300 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1301 | 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] | 1302 | 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] | 1303 | remote-tracking branches to ones matching given shell glob. |
| Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1304 | 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] | 1305 | </p> |
| 1306 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1307 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1308 | --glob=<glob-pattern> |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1309 | </dt> |
| 1310 | <dd> |
| 1311 | <p> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1312 | 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] | 1313 | 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] | 1314 | is automatically prepended if missing. If pattern lacks <em>?</em>, <em>*</em>, |
| 1315 | or <em>[</em>, <em>/*</em> at the end is implied. |
| Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1316 | </p> |
| 1317 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1318 | <dt class="hdlist1"> |
| Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1319 | --exclude=<glob-pattern> |
| 1320 | </dt> |
| 1321 | <dd> |
| 1322 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1323 | Do not include refs matching <em><glob-pattern></em> that the next <code>--all</code>, |
| 1324 | <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] | 1325 | consider. Repetitions of this option accumulate exclusion patterns |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1326 | up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or |
| 1327 | <code>--glob</code> option (other options or arguments do not clear |
| Junio C Hamano | fb5ffde | 2014-11-04 22:38:56 | [diff] [blame] | 1328 | accumulated patterns). |
| Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1329 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1330 | <div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or |
| 1331 | <code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>, |
| 1332 | respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code> |
| 1333 | 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] | 1334 | explicitly.</p></div> |
| 1335 | </dd> |
| 1336 | <dt class="hdlist1"> |
| Junio C Hamano | 2a4bcbc | 2014-10-29 20:07:39 | [diff] [blame] | 1337 | --reflog |
| 1338 | </dt> |
| 1339 | <dd> |
| 1340 | <p> |
| 1341 | Pretend as if all objects mentioned by reflogs are listed on the |
| 1342 | command line as <code><commit></code>. |
| 1343 | </p> |
| 1344 | </dd> |
| 1345 | <dt class="hdlist1"> |
| Junio C Hamano | a42e033 | 2019-07-19 19:49:37 | [diff] [blame] | 1346 | --alternate-refs |
| 1347 | </dt> |
| 1348 | <dd> |
| 1349 | <p> |
| 1350 | Pretend as if all objects mentioned as ref tips of alternate |
| 1351 | repositories were listed on the command line. An alternate |
| 1352 | repository is any repository whose object directory is specified |
| 1353 | in <code>objects/info/alternates</code>. The set of included objects may |
| 1354 | be modified by <code>core.alternateRefsCommand</code>, etc. See |
| 1355 | <a href="git-config.html">git-config(1)</a>. |
| 1356 | </p> |
| 1357 | </dd> |
| 1358 | <dt class="hdlist1"> |
| Junio C Hamano | 8d57fa9 | 2017-09-19 05:01:08 | [diff] [blame] | 1359 | --single-worktree |
| 1360 | </dt> |
| 1361 | <dd> |
| 1362 | <p> |
| 1363 | By default, all working trees will be examined by the |
| 1364 | following options when there are more than one (see |
| 1365 | <a href="git-worktree.html">git-worktree(1)</a>): <code>--all</code>, <code>--reflog</code> and |
| 1366 | <code>--indexed-objects</code>. |
| 1367 | This option forces them to examine the current working tree |
| 1368 | only. |
| 1369 | </p> |
| 1370 | </dd> |
| 1371 | <dt class="hdlist1"> |
| Junio C Hamano | 084228c | 2011-05-30 08:13:52 | [diff] [blame] | 1372 | --ignore-missing |
| 1373 | </dt> |
| 1374 | <dd> |
| 1375 | <p> |
| 1376 | Upon seeing an invalid object name in the input, pretend as if |
| 1377 | the bad input was not given. |
| 1378 | </p> |
| 1379 | </dd> |
| 1380 | <dt class="hdlist1"> |
| Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1381 | --bisect |
| 1382 | </dt> |
| 1383 | <dd> |
| 1384 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1385 | Pretend as if the bad bisection ref <code>refs/bisect/bad</code> |
| 1386 | was listed and as if it was followed by <code>--not</code> and the good |
| 1387 | bisection refs <code>refs/bisect/good-*</code> on the command |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 1388 | line. |
| Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1389 | </p> |
| 1390 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1391 | <dt class="hdlist1"> |
| Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1392 | --stdin |
| 1393 | </dt> |
| 1394 | <dd> |
| 1395 | <p> |
| 1396 | In addition to the <em><commit></em> listed on the command |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 1397 | 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] | 1398 | seen, stop reading commits and start reading paths to limit the |
| 1399 | result. |
| 1400 | </p> |
| 1401 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1402 | <dt class="hdlist1"> |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1403 | --cherry-mark |
| 1404 | </dt> |
| 1405 | <dd> |
| 1406 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1407 | Like <code>--cherry-pick</code> (see below) but mark equivalent commits |
| 1408 | 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] | 1409 | </p> |
| 1410 | </dd> |
| 1411 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1412 | --cherry-pick |
| 1413 | </dt> |
| 1414 | <dd> |
| 1415 | <p> |
| 1416 | Omit any commit that introduces the same change as |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1417 | another commit on the “other side” when the set of |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1418 | commits are limited with symmetric difference. |
| 1419 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1420 | <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] | 1421 | to list all commits on only one side of them is with |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1422 | <code>--left-right</code> (see the example below in the description of |
| 1423 | 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] | 1424 | cherry-picked from the other branch (for example, “3rd on b” may be |
| 1425 | 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] | 1426 | excluded from the output.</p></div> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1427 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1428 | <dt class="hdlist1"> |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1429 | --left-only |
| 1430 | </dt> |
| 1431 | <dt class="hdlist1"> |
| 1432 | --right-only |
| 1433 | </dt> |
| 1434 | <dd> |
| 1435 | <p> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 1436 | List only commits on the respective side of a symmetric difference, |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1437 | i.e. only those which would be marked <code><</code> resp. <code>></code> by |
| 1438 | <code>--left-right</code>. |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1439 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1440 | <div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those |
| 1441 | commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in |
| 1442 | <code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>. |
| 1443 | 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] | 1444 | list.</p></div> |
| 1445 | </dd> |
| 1446 | <dt class="hdlist1"> |
| 1447 | --cherry |
| 1448 | </dt> |
| 1449 | <dd> |
| 1450 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1451 | 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] | 1452 | limit the output to the commits on our side and mark those that |
| 1453 | have been applied to the other side of a forked history with |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1454 | <code>git log --cherry upstream...mybranch</code>, similar to |
| 1455 | <code>git cherry upstream mybranch</code>. |
| Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1456 | </p> |
| 1457 | </dd> |
| 1458 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1459 | -g |
| 1460 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1461 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1462 | --walk-reflogs |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1463 | </dt> |
| 1464 | <dd> |
| 1465 | <p> |
| 1466 | Instead of walking the commit ancestry chain, walk |
| 1467 | reflog entries from the most recent one to older ones. |
| 1468 | When this option is used you cannot specify commits to |
| 1469 | exclude (that is, <em>^commit</em>, <em>commit1..commit2</em>, |
| Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 1470 | and <em>commit1...commit2</em> notations cannot be used). |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1471 | </p> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 1472 | <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] | 1473 | this causes the output to have two extra lines of information |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 1474 | taken from the reflog. The reflog designator in the output may be shown |
| 1475 | as <code>ref@{Nth}</code> (where <code>Nth</code> is the reverse-chronological index in the |
| 1476 | reflog) or as <code>ref@{timestamp}</code> (with the timestamp for that entry), |
| 1477 | depending on a few rules:</p></div> |
| 1478 | <div class="openblock"> |
| 1479 | <div class="content"> |
| 1480 | <div class="olist arabic"><ol class="arabic"> |
| 1481 | <li> |
| 1482 | <p> |
| 1483 | 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] | 1484 | format. |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 1485 | </p> |
| 1486 | </li> |
| 1487 | <li> |
| 1488 | <p> |
| 1489 | 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] | 1490 | timestamp format. |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 1491 | </p> |
| 1492 | </li> |
| 1493 | <li> |
| 1494 | <p> |
| 1495 | 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] | 1496 | the timestamp in the format requested by <code>--date</code>. |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 1497 | </p> |
| 1498 | </li> |
| 1499 | <li> |
| 1500 | <p> |
| 1501 | Otherwise, show the index format. |
| 1502 | </p> |
| 1503 | </li> |
| 1504 | </ol></div> |
| 1505 | </div></div> |
| 1506 | <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] | 1507 | prefixed with this information on the same line. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1508 | This option cannot be combined with <code>--reverse</code>. |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1509 | 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] | 1510 | <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] | 1511 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1512 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1513 | --merge |
| 1514 | </dt> |
| 1515 | <dd> |
| 1516 | <p> |
| 1517 | After a failed merge, show refs that touch files having a |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1518 | conflict and don’t exist on all heads to merge. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1519 | </p> |
| 1520 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1521 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1522 | --boundary |
| 1523 | </dt> |
| 1524 | <dd> |
| 1525 | <p> |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1526 | Output excluded boundary commits. Boundary commits are |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1527 | prefixed with <code>-</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1528 | </p> |
| 1529 | </dd> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1530 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1531 | </div> |
| 1532 | <div class="sect2"> |
| 1533 | <h3 id="_history_simplification">History Simplification</h3> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1534 | <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] | 1535 | commits modifying a particular <path>. But there are two parts of |
| 1536 | <em>History Simplification</em>, one part is selecting the commits and the other |
| 1537 | 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] | 1538 | <div class="paragraph"><p>The following options select the commits to be shown:</p></div> |
| 1539 | <div class="dlist"><dl> |
| 1540 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1541 | <paths> |
| 1542 | </dt> |
| 1543 | <dd> |
| 1544 | <p> |
| 1545 | Commits modifying the given <paths> are selected. |
| 1546 | </p> |
| 1547 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1548 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1549 | --simplify-by-decoration |
| 1550 | </dt> |
| 1551 | <dd> |
| 1552 | <p> |
| 1553 | Commits that are referred by some branch or tag are selected. |
| 1554 | </p> |
| 1555 | </dd> |
| 1556 | </dl></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1557 | <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div> |
| 1558 | <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div> |
| 1559 | <div class="dlist"><dl> |
| 1560 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1561 | Default mode |
| 1562 | </dt> |
| 1563 | <dd> |
| 1564 | <p> |
| 1565 | Simplifies the history to the simplest history explaining the |
| 1566 | final state of the tree. Simplest because it prunes some side |
| 1567 | branches if the end result is the same (i.e. merging branches |
| 1568 | with the same content) |
| 1569 | </p> |
| 1570 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1571 | <dt class="hdlist1"> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1572 | --show-pulls |
| 1573 | </dt> |
| 1574 | <dd> |
| 1575 | <p> |
| 1576 | Include all commits from the default mode, but also any merge |
| 1577 | commits that are not TREESAME to the first parent but are |
| 1578 | TREESAME to a later parent. This mode is helpful for showing |
| 1579 | the merge commits that "first introduced" a change to a branch. |
| 1580 | </p> |
| 1581 | </dd> |
| 1582 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1583 | --full-history |
| 1584 | </dt> |
| 1585 | <dd> |
| 1586 | <p> |
| Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 1587 | Same as the default mode, but does not prune some history. |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1588 | </p> |
| 1589 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1590 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1591 | --dense |
| 1592 | </dt> |
| 1593 | <dd> |
| 1594 | <p> |
| 1595 | Only the selected commits are shown, plus some to have a |
| 1596 | meaningful history. |
| 1597 | </p> |
| 1598 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1599 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1600 | --sparse |
| 1601 | </dt> |
| 1602 | <dd> |
| 1603 | <p> |
| 1604 | All commits in the simplified history are shown. |
| 1605 | </p> |
| 1606 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1607 | <dt class="hdlist1"> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1608 | --simplify-merges |
| 1609 | </dt> |
| 1610 | <dd> |
| 1611 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1612 | Additional option to <code>--full-history</code> to remove some needless |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1613 | merges from the resulting history, as there are no selected |
| 1614 | commits contributing to this merge. |
| 1615 | </p> |
| 1616 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1617 | <dt class="hdlist1"> |
| Junio C Hamano | 594d2d4 | 2022-08-30 17:58:50 | [diff] [blame^] | 1618 | --ancestry-path[=<commit>] |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1619 | </dt> |
| 1620 | <dd> |
| 1621 | <p> |
| 1622 | When given a range of commits to display (e.g. <em>commit1..commit2</em> |
| Junio C Hamano | 594d2d4 | 2022-08-30 17:58:50 | [diff] [blame^] | 1623 | or <em>commit2 ^commit1</em>), only display commits in that range |
| 1624 | that are ancestors of <commit>, descendants of <commit>, or |
| 1625 | <commit> itself. If no commit is specified, use <em>commit1</em> (the |
| 1626 | excluded part of the range) as <commit>. Can be passed multiple |
| 1627 | times; if so, a commit is included if it is any of the commits |
| 1628 | given or if it is an ancestor or descendant of one of them. |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1629 | </p> |
| 1630 | </dd> |
| Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1631 | </dl></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1632 | <div class="paragraph"><p>A more detailed explanation follows.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1633 | <div class="paragraph"><p>Suppose you specified <code>foo</code> as the <paths>. We shall call commits |
| 1634 | that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff |
| 1635 | 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] | 1636 | <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] | 1637 | illustrate the differences between simplification settings. We assume |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1638 | 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] | 1639 | <div class="listingblock"> |
| 1640 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1641 | <pre><code> .-A---M---N---O---P---Q |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1642 | / / / / / / |
| 1643 | I B C D E Y |
| 1644 | \ / / / / / |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1645 | `-------------' X</code></pre> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1646 | </div></div> |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1647 | <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] | 1648 | each merge. The commits are:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1649 | <div class="ulist"><ul> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1650 | <li> |
| 1651 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1652 | <code>I</code> is the initial commit, in which <code>foo</code> exists with contents |
| 1653 | “asdf”, and a file <code>quux</code> exists with contents “quux”. Initial |
| 1654 | 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] | 1655 | </p> |
| 1656 | </li> |
| 1657 | <li> |
| 1658 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1659 | In <code>A</code>, <code>foo</code> contains just “foo”. |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1660 | </p> |
| 1661 | </li> |
| 1662 | <li> |
| 1663 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1664 | <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] | 1665 | hence TREESAME to all parents. |
| 1666 | </p> |
| 1667 | </li> |
| 1668 | <li> |
| 1669 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1670 | <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] | 1671 | so it is not TREESAME to any parent. |
| 1672 | </p> |
| 1673 | </li> |
| 1674 | <li> |
| 1675 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1676 | <code>D</code> sets <code>foo</code> to “baz”. Its merge <code>O</code> combines the strings from |
| 1677 | <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] | 1678 | </p> |
| 1679 | </li> |
| 1680 | <li> |
| 1681 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1682 | <code>E</code> changes <code>quux</code> to “xyzzy”, and its merge <code>P</code> combines the |
| 1683 | 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] | 1684 | </p> |
| 1685 | </li> |
| 1686 | <li> |
| 1687 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1688 | <code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code> |
| 1689 | 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 |
| 1690 | <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] | 1691 | </p> |
| 1692 | </li> |
| 1693 | </ul></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1694 | <div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding |
| 1695 | commits based on whether <code>--full-history</code> and/or parent rewriting |
| 1696 | (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] | 1697 | are available.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1698 | <div class="dlist"><dl> |
| 1699 | <dt class="hdlist1"> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1700 | Default mode |
| 1701 | </dt> |
| 1702 | <dd> |
| 1703 | <p> |
| 1704 | Commits are included if they are not TREESAME to any parent |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1705 | (though this can be changed, see <code>--sparse</code> below). If the |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1706 | commit was a merge, and it was TREESAME to one parent, follow |
| 1707 | only that parent. (Even if there are several TREESAME |
| 1708 | parents, follow only one of them.) Otherwise, follow all |
| 1709 | parents. |
| 1710 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1711 | <div class="paragraph"><p>This results in:</p></div> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1712 | <div class="listingblock"> |
| 1713 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1714 | <pre><code> .-A---N---O |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1715 | / / / |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1716 | I---------D</code></pre> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1717 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1718 | <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] | 1719 | available, removed <code>B</code> from consideration entirely. <code>C</code> was |
| 1720 | considered via <code>N</code>, but is TREESAME. Root commits are compared to an |
| 1721 | empty tree, so <code>I</code> is !TREESAME.</p></div> |
| 1722 | <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] | 1723 | not affect the commits selected in default mode, so we have shown the |
| 1724 | parent lines.</p></div> |
| 1725 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1726 | <dt class="hdlist1"> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1727 | --full-history without parent rewriting |
| 1728 | </dt> |
| 1729 | <dd> |
| 1730 | <p> |
| 1731 | This mode differs from the default in one point: always follow |
| 1732 | all parents of a merge, even if it is TREESAME to one of them. |
| 1733 | Even if more than one side of the merge has commits that are |
| 1734 | included, this does not imply that the merge itself is! In |
| 1735 | the example, we get |
| 1736 | </p> |
| 1737 | <div class="listingblock"> |
| 1738 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1739 | <pre><code> I A B N D O P Q</code></pre> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1740 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1741 | <div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>, |
| 1742 | <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] | 1743 | do not appear.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1744 | <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] | 1745 | about the parent/child relationships between the commits, so we show |
| 1746 | them disconnected.</p></div> |
| 1747 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1748 | <dt class="hdlist1"> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1749 | --full-history with parent rewriting |
| 1750 | </dt> |
| 1751 | <dd> |
| 1752 | <p> |
| 1753 | Ordinary commits are only included if they are !TREESAME |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1754 | (though this can be changed, see <code>--sparse</code> below). |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1755 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1756 | <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] | 1757 | Along each parent, prune away commits that are not included |
| 1758 | themselves. This results in</p></div> |
| 1759 | <div class="listingblock"> |
| 1760 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1761 | <pre><code> .-A---M---N---O---P---Q |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1762 | / / / / / |
| 1763 | I B / D / |
| 1764 | \ / / / / |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1765 | `-------------'</code></pre> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1766 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1767 | <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] | 1768 | 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] | 1769 | rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and |
| 1770 | <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] | 1771 | </dd> |
| 1772 | </dl></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1773 | <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] | 1774 | affects inclusion:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1775 | <div class="dlist"><dl> |
| 1776 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1777 | --dense |
| 1778 | </dt> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1779 | <dd> |
| 1780 | <p> |
| 1781 | Commits that are walked are included if they are not TREESAME |
| 1782 | to any parent. |
| 1783 | </p> |
| 1784 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1785 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1786 | --sparse |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1787 | </dt> |
| 1788 | <dd> |
| 1789 | <p> |
| Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1790 | All commits that are walked are included. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1791 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1792 | <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] | 1793 | one of the parents is TREESAME, we follow only that one, so the other |
| 1794 | sides of the merge are never walked.</p></div> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1795 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1796 | <dt class="hdlist1"> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1797 | --simplify-merges |
| 1798 | </dt> |
| 1799 | <dd> |
| 1800 | <p> |
| 1801 | First, build a history graph in the same way that |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1802 | <code>--full-history</code> with parent rewriting does (see above). |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1803 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1804 | <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] | 1805 | history according to the following rules:</p></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1806 | <div class="openblock"> |
| 1807 | <div class="content"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1808 | <div class="ulist"><ul> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1809 | <li> |
| 1810 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1811 | Set <code>C'</code> to <code>C</code>. |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1812 | </p> |
| 1813 | </li> |
| 1814 | <li> |
| 1815 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1816 | 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] | 1817 | the process, drop parents that are ancestors of other parents or that are |
| 1818 | root commits TREESAME to an empty tree, and remove duplicates, but take care |
| 1819 | to never drop all parents that we are TREESAME to. |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1820 | </p> |
| 1821 | </li> |
| 1822 | <li> |
| 1823 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1824 | 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] | 1825 | zero or >1 parents), a boundary commit, or !TREESAME, it remains. |
| 1826 | Otherwise, it is replaced with its only parent. |
| 1827 | </p> |
| 1828 | </li> |
| 1829 | </ul></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1830 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1831 | <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] | 1832 | <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] | 1833 | <div class="listingblock"> |
| 1834 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1835 | <pre><code> .-A---M---N---O |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1836 | / / / |
| 1837 | I B D |
| 1838 | \ / / |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1839 | `---------'</code></pre> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1840 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1841 | <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] | 1842 | <div class="openblock"> |
| 1843 | <div class="content"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1844 | <div class="ulist"><ul> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1845 | <li> |
| 1846 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1847 | <code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the |
| 1848 | 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] | 1849 | </p> |
| 1850 | </li> |
| 1851 | <li> |
| 1852 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1853 | <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] | 1854 | removed completely, because it had one parent and is TREESAME. |
| 1855 | </p> |
| 1856 | </li> |
| Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1857 | <li> |
| 1858 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1859 | <code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it |
| 1860 | 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] | 1861 | parent and is TREESAME. |
| 1862 | </p> |
| 1863 | </li> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1864 | </ul></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1865 | </div></div> |
| Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1866 | </dd> |
| 1867 | </dl></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1868 | <div class="paragraph"><p>There is another simplification mode available:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1869 | <div class="dlist"><dl> |
| 1870 | <dt class="hdlist1"> |
| Junio C Hamano | 594d2d4 | 2022-08-30 17:58:50 | [diff] [blame^] | 1871 | --ancestry-path[=<commit>] |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1872 | </dt> |
| 1873 | <dd> |
| 1874 | <p> |
| Junio C Hamano | 594d2d4 | 2022-08-30 17:58:50 | [diff] [blame^] | 1875 | Limit the displayed commits to those which are an ancestor of |
| 1876 | <commit>, or which are a descendant of <commit>, or are <commit> |
| 1877 | itself. |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1878 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1879 | <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] | 1880 | <div class="listingblock"> |
| 1881 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1882 | <pre><code> D---E-------F |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1883 | / \ \ |
| 1884 | B---C---G---H---I---J |
| 1885 | / \ |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1886 | A-------K---------------L--M</code></pre> |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1887 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1888 | <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>, |
| 1889 | but excludes the ones that are ancestors of <code>D</code>. This is useful to see |
| 1890 | what happened to the history leading to <code>M</code> since <code>D</code>, in the sense |
| 1891 | that “what does <code>M</code> have that did not exist in <code>D</code>”. The result in this |
| 1892 | 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] | 1893 | of course).</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1894 | <div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the |
| 1895 | bug introduced by <code>D</code> and need fixing, however, we might want to view |
| 1896 | only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e. |
| 1897 | 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] | 1898 | option does. Applied to the <em>D..M</em> range, it results in:</p></div> |
| 1899 | <div class="listingblock"> |
| 1900 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1901 | <pre><code> E-------F |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1902 | \ \ |
| 1903 | G---H---I---J |
| 1904 | \ |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1905 | L--M</code></pre> |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1906 | </div></div> |
| Junio C Hamano | 594d2d4 | 2022-08-30 17:58:50 | [diff] [blame^] | 1907 | <div class="paragraph"><p>We can also use <code>--ancestry-path=D</code> instead of <code>--ancestry-path</code> which |
| 1908 | means the same thing when applied to the <em>D..M</em> range but is just more |
| 1909 | explicit.</p></div> |
| 1910 | <div class="paragraph"><p>If we instead are interested in a given topic within this range, and all |
| 1911 | commits affected by that topic, we may only want to view the subset of |
| 1912 | <code>D..M</code> which contain that topic in their ancestry path. So, using |
| 1913 | <code>--ancestry-path=H D..M</code> for example would result in:</p></div> |
| 1914 | <div class="listingblock"> |
| 1915 | <div class="content"> |
| 1916 | <pre><code> E |
| 1917 | \ |
| 1918 | G---H---I---J |
| 1919 | \ |
| 1920 | L--M</code></pre> |
| 1921 | </div></div> |
| 1922 | <div class="paragraph"><p>Whereas <code>--ancestry-path=K D..M</code> would result in</p></div> |
| 1923 | <div class="listingblock"> |
| 1924 | <div class="content"> |
| 1925 | <pre><code> K---------------L--M</code></pre> |
| 1926 | </div></div> |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1927 | </dd> |
| 1928 | </dl></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1929 | <div class="paragraph"><p>Before discussing another option, <code>--show-pulls</code>, we need to |
| 1930 | create a new example history.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1931 | <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] | 1932 | commit they know changed a file somehow does not appear in the file’s |
| 1933 | simplified history. Let’s demonstrate a new example and show how options |
| 1934 | 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] | 1935 | <div class="listingblock"> |
| 1936 | <div class="content"> |
| 1937 | <pre><code> .-A---M-----C--N---O---P |
| 1938 | / / \ \ \/ / / |
| 1939 | I B \ R-'`-Z' / |
| 1940 | \ / \/ / |
| 1941 | \ / /\ / |
| 1942 | `---X--' `---Y--'</code></pre> |
| 1943 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1944 | <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] | 1945 | <code>A</code>, <code>B</code>, and <code>X</code> in different ways. The single-parent commits <code>C</code>, <code>Z</code>, |
| 1946 | and <code>Y</code> do not change <code>file.txt</code>. The merge commit <code>M</code> was created by |
| 1947 | resolving the merge conflict to include both changes from <code>A</code> and <code>B</code> |
| 1948 | and hence is not TREESAME to either. The merge commit <code>R</code>, however, was |
| 1949 | created by ignoring the contents of <code>file.txt</code> at <code>M</code> and taking only |
| 1950 | the contents of <code>file.txt</code> at <code>X</code>. Hence, <code>R</code> is TREESAME to <code>X</code> but not |
| 1951 | <code>M</code>. Finally, the natural merge resolution to create <code>N</code> is to take the |
| 1952 | 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>. |
| 1953 | The merge commits <code>O</code> and <code>P</code> are TREESAME to their first parents, but |
| 1954 | 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] | 1955 | <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] | 1956 | those edges are walked and the others are ignored. The resulting history |
| 1957 | graph is:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1958 | <div class="listingblock"> |
| 1959 | <div class="content"> |
| 1960 | <pre><code> I---X</code></pre> |
| 1961 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1962 | <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] | 1963 | the commits <code>A</code> and <code>B</code> and the merge <code>M</code>, but also will reveal the |
| 1964 | 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] | 1965 | <div class="listingblock"> |
| 1966 | <div class="content"> |
| 1967 | <pre><code> .-A---M--------N---O---P |
| 1968 | / / \ \ \/ / / |
| 1969 | I B \ R-'`--' / |
| 1970 | \ / \/ / |
| 1971 | \ / /\ / |
| 1972 | `---X--' `------'</code></pre> |
| 1973 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1974 | <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] | 1975 | not actually contribute a change to <code>file.txt</code>. They only merged a topic |
| 1976 | that was based on an older version of <code>file.txt</code>. This is a common |
| 1977 | issue in repositories using a workflow where many contributors work in |
| Junio C Hamano | 594d2d4 | 2022-08-30 17:58:50 | [diff] [blame^] | 1978 | parallel and merge their topic branches along a single trunk: many |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1979 | unrelated merges appear in the <code>--full-history</code> results.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1980 | <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] | 1981 | disappear from the results. This is because the rewritten second parents |
| 1982 | of <code>O</code> and <code>P</code> are reachable from their first parents. Those edges are |
| 1983 | removed and then the commits look like single-parent commits that are |
| 1984 | TREESAME to their parent. This also happens to the commit <code>N</code>, resulting |
| 1985 | in a history view as follows:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1986 | <div class="listingblock"> |
| 1987 | <div class="content"> |
| 1988 | <pre><code> .-A---M--. |
| 1989 | / / \ |
| 1990 | I B R |
| 1991 | \ / / |
| 1992 | \ / / |
| 1993 | `---X--'</code></pre> |
| 1994 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 1995 | <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] | 1996 | <code>A</code>, <code>B</code>, and <code>X</code>. We also see the carefully-resolved merge <code>M</code> and the |
| 1997 | not-so-carefully-resolved merge <code>R</code>. This is usually enough information |
| 1998 | to determine why the commits <code>A</code> and <code>B</code> "disappeared" from history in |
| 1999 | 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] | 2000 | <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] | 2001 | <code>--simplify-merges</code> option requires walking the entire commit history |
| 2002 | before returning a single result. This can make the option difficult to |
| 2003 | use for very large repositories.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 2004 | <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] | 2005 | on the same repository, it is important which merge commits introduced |
| 2006 | a change into an important branch. The problematic merge <code>R</code> above is |
| 2007 | not likely to be the merge commit that was used to merge into an |
| 2008 | important branch. Instead, the merge <code>N</code> was used to merge <code>R</code> and <code>X</code> |
| 2009 | into the important branch. This commit may have information about why |
| 2010 | the change <code>X</code> came to override the changes from <code>A</code> and <code>B</code> in its |
| 2011 | commit message.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 2012 | <div class="dlist"><dl> |
| 2013 | <dt class="hdlist1"> |
| 2014 | --show-pulls |
| 2015 | </dt> |
| 2016 | <dd> |
| 2017 | <p> |
| 2018 | In addition to the commits shown in the default history, show |
| 2019 | each merge commit that is not TREESAME to its first parent but |
| 2020 | is TREESAME to a later parent. |
| 2021 | </p> |
| 2022 | <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] | 2023 | treated as if it "pulled" the change from another branch. When using |
| 2024 | <code>--show-pulls</code> on this example (and no other options) the resulting |
| 2025 | graph is:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 2026 | <div class="listingblock"> |
| 2027 | <div class="content"> |
| 2028 | <pre><code> I---X---R---N</code></pre> |
| 2029 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 2030 | <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] | 2031 | the commits <code>X</code> and <code>R</code> into the base branch, respectively. These |
| 2032 | merges are the reason the commits <code>A</code> and <code>B</code> do not appear in the |
| 2033 | default history.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 2034 | <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] | 2035 | graph includes all of the necessary information:</p></div> |
| Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 2036 | <div class="listingblock"> |
| 2037 | <div class="content"> |
| 2038 | <pre><code> .-A---M--. N |
| 2039 | / / \ / |
| 2040 | I B R |
| 2041 | \ / / |
| 2042 | \ / / |
| 2043 | `---X--'</code></pre> |
| 2044 | </div></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 2045 | <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] | 2046 | was simplified away. However, <code>N</code> still appears in the history as an |
| 2047 | important commit because it "pulled" the change <code>R</code> into the main |
| 2048 | branch.</p></div> |
| Junio C Hamano | 0cb719f | 2020-05-31 20:04:39 | [diff] [blame] | 2049 | </dd> |
| 2050 | </dl></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2051 | <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] | 2052 | big picture of the topology of the history, by omitting commits |
| 2053 | that are not referenced by tags. Commits are marked as !TREESAME |
| 2054 | (in other words, kept after history simplification rules described |
| 2055 | above) if (1) they are referenced by tags, or (2) they change the |
| 2056 | contents of the paths given on the command line. All other |
| 2057 | commits are marked as TREESAME (subject to be simplified away).</p></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2058 | </div> |
| 2059 | <div class="sect2"> |
| 2060 | <h3 id="_commit_ordering">Commit Ordering</h3> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2061 | <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div> |
| 2062 | <div class="dlist"><dl> |
| 2063 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2064 | --date-order |
| 2065 | </dt> |
| 2066 | <dd> |
| 2067 | <p> |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2068 | Show no parents before all of its children are shown, but |
| 2069 | otherwise show commits in the commit timestamp order. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2070 | </p> |
| 2071 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2072 | <dt class="hdlist1"> |
| Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 2073 | --author-date-order |
| 2074 | </dt> |
| 2075 | <dd> |
| 2076 | <p> |
| 2077 | Show no parents before all of its children are shown, but |
| 2078 | otherwise show commits in the author timestamp order. |
| 2079 | </p> |
| 2080 | </dd> |
| 2081 | <dt class="hdlist1"> |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2082 | --topo-order |
| 2083 | </dt> |
| 2084 | <dd> |
| 2085 | <p> |
| 2086 | Show no parents before all of its children are shown, and |
| 2087 | avoid showing commits on multiple lines of history |
| 2088 | intermixed. |
| 2089 | </p> |
| 2090 | <div class="paragraph"><p>For example, in a commit history like this:</p></div> |
| 2091 | <div class="listingblock"> |
| 2092 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2093 | <pre><code> ---1----2----4----7 |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2094 | \ \ |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2095 | 3----5----6----8---</code></pre> |
| Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 2096 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2097 | <div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git |
| 2098 | 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] | 2099 | timestamp order: 8 7 6 5 4 3 2 1.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2100 | <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] | 2101 | 3 1); some older commits are shown before newer ones in order to |
| 2102 | avoid showing the commits from two parallel development track mixed |
| 2103 | together.</p></div> |
| 2104 | </dd> |
| 2105 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2106 | --reverse |
| 2107 | </dt> |
| 2108 | <dd> |
| 2109 | <p> |
| Junio C Hamano | f3ca7b8 | 2016-10-03 22:27:02 | [diff] [blame] | 2110 | Output the commits chosen to be shown (see Commit Limiting |
| 2111 | section above) in reverse order. Cannot be combined with |
| 2112 | <code>--walk-reflogs</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2113 | </p> |
| 2114 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2115 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2116 | </div> |
| 2117 | <div class="sect2"> |
| 2118 | <h3 id="_object_traversal">Object Traversal</h3> |
| Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 2119 | <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] | 2120 | <div class="dlist"><dl> |
| 2121 | <dt class="hdlist1"> |
| Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 2122 | --no-walk[=(sorted|unsorted)] |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2123 | </dt> |
| 2124 | <dd> |
| 2125 | <p> |
| Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 2126 | Only show the given commits, but do not traverse their ancestors. |
| 2127 | This has no effect if a range is specified. If the argument |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2128 | <code>unsorted</code> is given, the commits are shown in the order they were |
| 2129 | 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] | 2130 | was given), the commits are shown in reverse chronological order |
| Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 2131 | by commit time. |
| Junio C Hamano | e8fdbbb | 2021-11-12 23:42:03 | [diff] [blame] | 2132 | Cannot be combined with <code>--graph</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2133 | </p> |
| 2134 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2135 | <dt class="hdlist1"> |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2136 | --do-walk |
| 2137 | </dt> |
| 2138 | <dd> |
| 2139 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2140 | Overrides a previous <code>--no-walk</code>. |
| Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 2141 | </p> |
| 2142 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2143 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2144 | </div> |
| 2145 | <div class="sect2"> |
| 2146 | <h3 id="_commit_formatting">Commit Formatting</h3> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2147 | <div class="dlist"><dl> |
| 2148 | <dt class="hdlist1"> |
| 2149 | --pretty[=<format>] |
| 2150 | </dt> |
| 2151 | <dt class="hdlist1"> |
| 2152 | --format=<format> |
| 2153 | </dt> |
| 2154 | <dd> |
| 2155 | <p> |
| 2156 | Pretty-print the contents of the commit logs in a given format, |
| 2157 | 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] | 2158 | <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] | 2159 | and <em>tformat:<string></em>. When <em><format></em> is none of the above, |
| 2160 | and has <em>%placeholder</em> in it, it acts as if |
| 2161 | <em>--pretty=tformat:<format></em> were given. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2162 | </p> |
| Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 2163 | <div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each |
| 2164 | 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] | 2165 | <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] | 2166 | 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] | 2167 | </dd> |
| 2168 | <dt class="hdlist1"> |
| 2169 | --abbrev-commit |
| 2170 | </dt> |
| 2171 | <dd> |
| 2172 | <p> |
| 2173 | Instead of showing the full 40-byte hexadecimal commit object |
| Junio C Hamano | ee43d18 | 2020-11-11 22:10:41 | [diff] [blame] | 2174 | name, show a prefix that names the object uniquely. |
| 2175 | "--abbrev=<n>" (which also modifies diff output, if it is displayed) |
| 2176 | option can be used to specify the minimum length of the prefix. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2177 | </p> |
| 2178 | <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for |
| 2179 | people using 80-column terminals.</p></div> |
| 2180 | </dd> |
| 2181 | <dt class="hdlist1"> |
| Junio C Hamano | f93530e | 2011-05-25 23:59:59 | [diff] [blame] | 2182 | --no-abbrev-commit |
| 2183 | </dt> |
| 2184 | <dd> |
| 2185 | <p> |
| 2186 | Show the full 40-byte hexadecimal commit object name. This negates |
| Junio C Hamano | 558abd2 | 2020-09-03 20:22:34 | [diff] [blame] | 2187 | <code>--abbrev-commit</code>, either explicit or implied by other options such |
| 2188 | as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable. |
| Junio C Hamano | f93530e | 2011-05-25 23:59:59 | [diff] [blame] | 2189 | </p> |
| 2190 | </dd> |
| 2191 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2192 | --oneline |
| 2193 | </dt> |
| 2194 | <dd> |
| 2195 | <p> |
| 2196 | This is a shorthand for "--pretty=oneline --abbrev-commit" |
| 2197 | used together. |
| 2198 | </p> |
| 2199 | </dd> |
| 2200 | <dt class="hdlist1"> |
| Junio C Hamano | c5bb3b3 | 2013-08-05 22:43:36 | [diff] [blame] | 2201 | --encoding=<encoding> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2202 | </dt> |
| 2203 | <dd> |
| 2204 | <p> |
| Junio C Hamano | 7d6f46e | 2021-09-10 19:54:21 | [diff] [blame] | 2205 | Commit objects record the character encoding used for the log message |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2206 | in their encoding header; this option can be used to tell the |
| 2207 | command to re-code the commit log message in the encoding |
| 2208 | preferred by the user. For non plumbing commands this |
| Junio C Hamano | 823eebb | 2015-07-10 22:29:34 | [diff] [blame] | 2209 | defaults to UTF-8. Note that if an object claims to be encoded |
| 2210 | in <code>X</code> and we are outputting in <code>X</code>, we will output the object |
| 2211 | verbatim; this means that invalid sequences in the original |
| Junio C Hamano | 7d6f46e | 2021-09-10 19:54:21 | [diff] [blame] | 2212 | commit may be copied to the output. Likewise, if iconv(3) fails |
| Junio C Hamano | 19dcd3f | 2021-10-29 23:20:47 | [diff] [blame] | 2213 | to convert the commit, we will quietly output the original |
| 2214 | object verbatim. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2215 | </p> |
| 2216 | </dd> |
| 2217 | <dt class="hdlist1"> |
| Junio C Hamano | 5996b67 | 2016-04-13 22:01:41 | [diff] [blame] | 2218 | --expand-tabs=<n> |
| 2219 | </dt> |
| 2220 | <dt class="hdlist1"> |
| 2221 | --expand-tabs |
| 2222 | </dt> |
| 2223 | <dt class="hdlist1"> |
| 2224 | --no-expand-tabs |
| 2225 | </dt> |
| 2226 | <dd> |
| 2227 | <p> |
| 2228 | Perform a tab expansion (replace each tab with enough spaces |
| 2229 | to fill to the next display column that is multiple of <em><n></em>) |
| 2230 | in the log message before showing it in the output. |
| 2231 | <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and |
| 2232 | <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>, |
| 2233 | which disables tab expansion. |
| 2234 | </p> |
| 2235 | <div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log |
| 2236 | message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>, |
| 2237 | and <em>fuller</em>).</p></div> |
| 2238 | </dd> |
| 2239 | <dt class="hdlist1"> |
| Junio C Hamano | b3f862c | 2019-12-05 22:22:00 | [diff] [blame] | 2240 | --notes[=<ref>] |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2241 | </dt> |
| 2242 | <dd> |
| 2243 | <p> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2244 | 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] | 2245 | commit, when showing the commit log message. This is the default |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2246 | for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when |
| 2247 | 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] | 2248 | on the command line. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2249 | </p> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2250 | <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] | 2251 | <code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2252 | 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] | 2253 | <div class="paragraph"><p>With an optional <em><ref></em> argument, use the ref to find the notes |
| 2254 | to display. The ref can specify the full refname when it begins |
| Junio C Hamano | 1f7c4a5 | 2015-10-14 22:15:51 | [diff] [blame] | 2255 | with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise |
| 2256 | <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] | 2257 | <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are |
| 2258 | being displayed. Examples: "--notes=foo" will show only notes from |
| 2259 | "refs/notes/foo"; "--notes=foo --notes" will show both notes from |
| 2260 | "refs/notes/foo" and from the default notes ref(s).</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2261 | </dd> |
| 2262 | <dt class="hdlist1"> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2263 | --no-notes |
| 2264 | </dt> |
| 2265 | <dd> |
| 2266 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2267 | 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] | 2268 | resetting the list of notes refs from which notes are shown. |
| 2269 | Options are parsed in the order given on the command line, so e.g. |
| 2270 | "--notes --notes=foo --no-notes --notes=bar" will only show notes |
| 2271 | from "refs/notes/bar". |
| 2272 | </p> |
| 2273 | </dd> |
| 2274 | <dt class="hdlist1"> |
| Junio C Hamano | b3f862c | 2019-12-05 22:22:00 | [diff] [blame] | 2275 | --show-notes[=<ref>] |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2276 | </dt> |
| 2277 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2278 | --[no-]standard-notes |
| 2279 | </dt> |
| 2280 | <dd> |
| 2281 | <p> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2282 | These options are deprecated. Use the above --notes/--no-notes |
| 2283 | options instead. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2284 | </p> |
| 2285 | </dd> |
| 2286 | <dt class="hdlist1"> |
| Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2287 | --show-signature |
| 2288 | </dt> |
| 2289 | <dd> |
| 2290 | <p> |
| 2291 | Check the validity of a signed commit object by passing the signature |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2292 | to <code>gpg --verify</code> and show the output. |
| Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2293 | </p> |
| 2294 | </dd> |
| 2295 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2296 | --relative-date |
| 2297 | </dt> |
| 2298 | <dd> |
| 2299 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2300 | Synonym for <code>--date=relative</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2301 | </p> |
| 2302 | </dd> |
| 2303 | <dt class="hdlist1"> |
| Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 2304 | --date=<format> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2305 | </dt> |
| 2306 | <dd> |
| 2307 | <p> |
| 2308 | Only takes effect for dates shown in human-readable format, such |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2309 | 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] | 2310 | value for the log command’s <code>--date</code> option. By default, dates |
| 2311 | are shown in the original time zone (either committer’s or |
| 2312 | author’s). If <code>-local</code> is appended to the format (e.g., |
| 2313 | <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] | 2314 | </p> |
| Junio C Hamano | b551377 | 2019-04-22 03:38:39 | [diff] [blame] | 2315 | <div class="openblock"> |
| 2316 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2317 | <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] | 2318 | e.g. “2 hours ago”. The <code>-local</code> option has no effect for |
| 2319 | <code>--date=relative</code>.</p></div> |
| Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 2320 | <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] | 2321 | <div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format. |
| 2322 | The differences to the strict ISO 8601 format are:</p></div> |
| 2323 | <div class="ulist"><ul> |
| 2324 | <li> |
| 2325 | <p> |
| 2326 | a space instead of the <code>T</code> date/time delimiter |
| 2327 | </p> |
| 2328 | </li> |
| 2329 | <li> |
| 2330 | <p> |
| 2331 | a space between time and time zone |
| 2332 | </p> |
| 2333 | </li> |
| 2334 | <li> |
| 2335 | <p> |
| 2336 | no colon between hours and minutes of the time zone |
| 2337 | </p> |
| 2338 | </li> |
| 2339 | </ul></div> |
| 2340 | <div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict |
| 2341 | ISO 8601 format.</p></div> |
| 2342 | <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] | 2343 | format, often found in email messages.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2344 | <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] | 2345 | <div class="paragraph"><p><code>--date=raw</code> shows the date as seconds since the epoch (1970-01-01 |
| 2346 | 00:00:00 UTC), followed by a space, and then the timezone as an offset |
| 2347 | from UTC (a <code>+</code> or <code>-</code> with four digits; the first two are hours, and |
| 2348 | the second two are minutes). I.e., as if the timestamp were formatted |
| 2349 | with <code>strftime("%s %z")</code>). |
| 2350 | Note that the <code>-local</code> option does not affect the seconds-since-epoch |
| 2351 | value (which is always measured in UTC), but does switch the accompanying |
| 2352 | timezone value.</p></div> |
| Junio C Hamano | 23168ef | 2019-02-07 07:20:47 | [diff] [blame] | 2353 | <div class="paragraph"><p><code>--date=human</code> shows the timezone if the timezone does not match the |
| 2354 | current time-zone, and doesn’t print the whole date if that matches |
| 2355 | (ie skip printing year for dates that are "this year", but also skip |
| 2356 | the whole date itself if it’s in the last few days and we can just say |
| 2357 | what weekday it was). For older dates the hour and minute is also |
| 2358 | omitted.</p></div> |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 2359 | <div class="paragraph"><p><code>--date=unix</code> shows the date as a Unix epoch timestamp (seconds since |
| 2360 | 1970). As with <code>--raw</code>, this is always in UTC and therefore <code>-local</code> |
| 2361 | has no effect.</p></div> |
| Junio C Hamano | 55d9191 | 2017-06-22 22:32:46 | [diff] [blame] | 2362 | <div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>, |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2363 | except for %s, %z, and %Z, which are handled internally. |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 2364 | Use <code>--date=format:%c</code> to show the date in your system locale’s |
| 2365 | 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] | 2366 | format placeholders. When using <code>-local</code>, the correct syntax is |
| 2367 | <code>--date=format-local:...</code>.</p></div> |
| 2368 | <div class="paragraph"><p><code>--date=default</code> is the default format, and is similar to |
| 2369 | <code>--date=rfc2822</code>, with a few exceptions:</p></div> |
| Junio C Hamano | b551377 | 2019-04-22 03:38:39 | [diff] [blame] | 2370 | </div></div> |
| Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 2371 | <div class="ulist"><ul> |
| 2372 | <li> |
| 2373 | <p> |
| 2374 | there is no comma after the day-of-week |
| 2375 | </p> |
| 2376 | </li> |
| 2377 | <li> |
| 2378 | <p> |
| 2379 | the time zone is omitted when the local time zone is used |
| 2380 | </p> |
| 2381 | </li> |
| 2382 | </ul></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2383 | </dd> |
| 2384 | <dt class="hdlist1"> |
| 2385 | --parents |
| 2386 | </dt> |
| 2387 | <dd> |
| 2388 | <p> |
| 2389 | Print also the parents of the commit (in the form "commit parent…"). |
| Junio C Hamano | ce019c0 | 2017-10-30 05:57:46 | [diff] [blame] | 2390 | Also enables parent rewriting, see <em>History Simplification</em> above. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2391 | </p> |
| 2392 | </dd> |
| 2393 | <dt class="hdlist1"> |
| 2394 | --children |
| 2395 | </dt> |
| 2396 | <dd> |
| 2397 | <p> |
| 2398 | Print also the children of the commit (in the form "commit child…"). |
| Junio C Hamano | ce019c0 | 2017-10-30 05:57:46 | [diff] [blame] | 2399 | Also enables parent rewriting, see <em>History Simplification</em> above. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2400 | </p> |
| 2401 | </dd> |
| 2402 | <dt class="hdlist1"> |
| 2403 | --left-right |
| 2404 | </dt> |
| 2405 | <dd> |
| 2406 | <p> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 2407 | Mark which side of a symmetric difference a commit is reachable from. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2408 | Commits from the left side are prefixed with <code><</code> and those from |
| 2409 | the right with <code>></code>. If combined with <code>--boundary</code>, those |
| 2410 | commits are prefixed with <code>-</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2411 | </p> |
| 2412 | <div class="paragraph"><p>For example, if you have this topology:</p></div> |
| 2413 | <div class="listingblock"> |
| 2414 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2415 | <pre><code> y---b---b branch B |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2416 | / \ / |
| 2417 | / . |
| 2418 | / / \ |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2419 | o---x---a---a branch A</code></pre> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2420 | </div></div> |
| 2421 | <div class="paragraph"><p>you would get an output like this:</p></div> |
| 2422 | <div class="listingblock"> |
| 2423 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2424 | <pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2425 | |
| 2426 | >bbbbbbb... 3rd on b |
| 2427 | >bbbbbbb... 2nd on b |
| 2428 | <aaaaaaa... 3rd on a |
| 2429 | <aaaaaaa... 2nd on a |
| 2430 | -yyyyyyy... 1st on b |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2431 | -xxxxxxx... 1st on a</code></pre> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2432 | </div></div> |
| 2433 | </dd> |
| 2434 | <dt class="hdlist1"> |
| 2435 | --graph |
| 2436 | </dt> |
| 2437 | <dd> |
| 2438 | <p> |
| 2439 | Draw a text-based graphical representation of the commit history |
| 2440 | on the left hand side of the output. This may cause extra lines |
| 2441 | to be printed in between commits, in order for the graph history |
| 2442 | to be drawn properly. |
| Junio C Hamano | ef57d1e | 2015-03-25 21:23:00 | [diff] [blame] | 2443 | Cannot be combined with <code>--no-walk</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2444 | </p> |
| Junio C Hamano | ce019c0 | 2017-10-30 05:57:46 | [diff] [blame] | 2445 | <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] | 2446 | <div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the |
| 2447 | <code>--date-order</code> option may also be specified.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2448 | </dd> |
| Junio C Hamano | 624dd4c | 2014-04-03 21:56:30 | [diff] [blame] | 2449 | <dt class="hdlist1"> |
| 2450 | --show-linear-break[=<barrier>] |
| 2451 | </dt> |
| 2452 | <dd> |
| 2453 | <p> |
| 2454 | When --graph is not used, all history branches are flattened |
| 2455 | which can make it hard to see that the two consecutive commits |
| 2456 | do not belong to a linear branch. This option puts a barrier |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2457 | 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] | 2458 | is the string that will be shown instead of the default one. |
| 2459 | </p> |
| 2460 | </dd> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2461 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2462 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2463 | </div> |
| 2464 | </div> |
| 2465 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2466 | <h2 id="_pretty_formats">PRETTY FORMATS</h2> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2467 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2468 | <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] | 2469 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 2470 | inserted before the <em>Author:</em> line. This line begins with |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2471 | "Merge: " and the hashes of ancestral commits are printed, |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2472 | separated by spaces. Note that the listed commits may not |
| 2473 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 2474 | have limited your view of history: for example, if you are |
| 2475 | only interested in changes related to a certain directory or |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2476 | file.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2477 | <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] | 2478 | additional formats by setting a pretty.<name> |
| 2479 | config option to either another format name, or a |
| 2480 | <em>format:</em> string, as described below (see |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2481 | <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] | 2482 | built-in formats:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2483 | <div class="ulist"><ul> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2484 | <li> |
| 2485 | <p> |
| 2486 | <em>oneline</em> |
| 2487 | </p> |
| 2488 | <div class="literalblock"> |
| 2489 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2490 | <pre><code><hash> <title-line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2491 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2492 | <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] | 2493 | </li> |
| 2494 | <li> |
| 2495 | <p> |
| 2496 | <em>short</em> |
| 2497 | </p> |
| 2498 | <div class="literalblock"> |
| 2499 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2500 | <pre><code>commit <hash> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2501 | Author: <author></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2502 | </div></div> |
| 2503 | <div class="literalblock"> |
| 2504 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2505 | <pre><code><title-line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2506 | </div></div> |
| 2507 | </li> |
| 2508 | <li> |
| 2509 | <p> |
| 2510 | <em>medium</em> |
| 2511 | </p> |
| 2512 | <div class="literalblock"> |
| 2513 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2514 | <pre><code>commit <hash> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2515 | Author: <author> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2516 | Date: <author-date></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2517 | </div></div> |
| 2518 | <div class="literalblock"> |
| 2519 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2520 | <pre><code><title-line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2521 | </div></div> |
| 2522 | <div class="literalblock"> |
| 2523 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2524 | <pre><code><full-commit-message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2525 | </div></div> |
| 2526 | </li> |
| 2527 | <li> |
| 2528 | <p> |
| 2529 | <em>full</em> |
| 2530 | </p> |
| 2531 | <div class="literalblock"> |
| 2532 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2533 | <pre><code>commit <hash> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2534 | Author: <author> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2535 | Commit: <committer></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2536 | </div></div> |
| 2537 | <div class="literalblock"> |
| 2538 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2539 | <pre><code><title-line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2540 | </div></div> |
| 2541 | <div class="literalblock"> |
| 2542 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2543 | <pre><code><full-commit-message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2544 | </div></div> |
| 2545 | </li> |
| 2546 | <li> |
| 2547 | <p> |
| 2548 | <em>fuller</em> |
| 2549 | </p> |
| 2550 | <div class="literalblock"> |
| 2551 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2552 | <pre><code>commit <hash> |
| Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 2553 | Author: <author> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2554 | AuthorDate: <author-date> |
| Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 2555 | Commit: <committer> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2556 | CommitDate: <committer-date></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2557 | </div></div> |
| 2558 | <div class="literalblock"> |
| 2559 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2560 | <pre><code><title-line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2561 | </div></div> |
| 2562 | <div class="literalblock"> |
| 2563 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2564 | <pre><code><full-commit-message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2565 | </div></div> |
| 2566 | </li> |
| 2567 | <li> |
| 2568 | <p> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2569 | <em>reference</em> |
| 2570 | </p> |
| 2571 | <div class="literalblock"> |
| 2572 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2573 | <pre><code><abbrev-hash> (<title-line>, <short-author-date>)</code></pre> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2574 | </div></div> |
| 2575 | <div class="paragraph"><p>This format is used to refer to another commit in a commit message and |
| 2576 | is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default, |
| 2577 | the date is formatted with <code>--date=short</code> unless another <code>--date</code> option |
| 2578 | is explicitly specified. As with any <code>format:</code> with format |
| 2579 | placeholders, its output is not affected by other options like |
| 2580 | <code>--decorate</code> and <code>--walk-reflogs</code>.</p></div> |
| 2581 | </li> |
| 2582 | <li> |
| 2583 | <p> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2584 | <em>email</em> |
| 2585 | </p> |
| 2586 | <div class="literalblock"> |
| 2587 | <div class="content"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2588 | <pre><code>From <hash> <date> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2589 | From: <author> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2590 | Date: <author-date> |
| 2591 | Subject: [PATCH] <title-line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2592 | </div></div> |
| 2593 | <div class="literalblock"> |
| 2594 | <div class="content"> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2595 | <pre><code><full-commit-message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2596 | </div></div> |
| 2597 | </li> |
| 2598 | <li> |
| 2599 | <p> |
| Junio C Hamano | 0dd5094 | 2020-04-29 21:21:05 | [diff] [blame] | 2600 | <em>mboxrd</em> |
| 2601 | </p> |
| 2602 | <div class="paragraph"><p>Like <em>email</em>, but lines in the commit message starting with "From " |
| 2603 | (preceded by zero or more ">") are quoted with ">" so they aren’t |
| 2604 | confused as starting a new commit.</p></div> |
| 2605 | </li> |
| 2606 | <li> |
| 2607 | <p> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2608 | <em>raw</em> |
| 2609 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2610 | <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] | 2611 | stored in the commit object. Notably, the hashes are |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2612 | displayed in full, regardless of whether --abbrev or |
| 2613 | --no-abbrev are used, and <em>parents</em> information show the |
| Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 2614 | true parent commits, without taking grafts or history |
| Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 2615 | simplification into account. Note that this format affects the way |
| 2616 | commits are displayed, but not the way the diff is shown e.g. with |
| 2617 | <code>git log --raw</code>. To get full object names in a raw diff format, |
| 2618 | use <code>--no-abbrev</code>.</p></div> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2619 | </li> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2620 | <li> |
| 2621 | <p> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2622 | <em>format:<format-string></em> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2623 | </p> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 2624 | <div class="paragraph"><p>The <em>format:<format-string></em> format allows you to specify which information |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2625 | you want to show. It works a little bit like printf format, |
| 2626 | 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] | 2627 | instead of <em>\n</em>.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2628 | <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] | 2629 | would show something like this:</p></div> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2630 | <div class="listingblock"> |
| 2631 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2632 | <pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
| 2633 | 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] | 2634 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2635 | <div class="paragraph"><p>The placeholders are:</p></div> |
| 2636 | <div class="ulist"><ul> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2637 | <li> |
| 2638 | <p> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 2639 | Placeholders that expand to a single literal character: |
| 2640 | </p> |
| 2641 | <div class="dlist"><dl> |
| 2642 | <dt class="hdlist1"> |
| 2643 | <em>%n</em> |
| 2644 | </dt> |
| 2645 | <dd> |
| 2646 | <p> |
| 2647 | newline |
| 2648 | </p> |
| 2649 | </dd> |
| 2650 | <dt class="hdlist1"> |
| 2651 | <em>%%</em> |
| 2652 | </dt> |
| 2653 | <dd> |
| 2654 | <p> |
| 2655 | a raw <em>%</em> |
| 2656 | </p> |
| 2657 | </dd> |
| 2658 | <dt class="hdlist1"> |
| 2659 | <em>%x00</em> |
| 2660 | </dt> |
| 2661 | <dd> |
| 2662 | <p> |
| 2663 | print a byte from a hex code |
| 2664 | </p> |
| 2665 | </dd> |
| 2666 | </dl></div> |
| 2667 | </li> |
| 2668 | <li> |
| 2669 | <p> |
| 2670 | Placeholders that affect formatting of later placeholders: |
| 2671 | </p> |
| 2672 | <div class="dlist"><dl> |
| 2673 | <dt class="hdlist1"> |
| 2674 | <em>%Cred</em> |
| 2675 | </dt> |
| 2676 | <dd> |
| 2677 | <p> |
| 2678 | switch color to red |
| 2679 | </p> |
| 2680 | </dd> |
| 2681 | <dt class="hdlist1"> |
| 2682 | <em>%Cgreen</em> |
| 2683 | </dt> |
| 2684 | <dd> |
| 2685 | <p> |
| 2686 | switch color to green |
| 2687 | </p> |
| 2688 | </dd> |
| 2689 | <dt class="hdlist1"> |
| 2690 | <em>%Cblue</em> |
| 2691 | </dt> |
| 2692 | <dd> |
| 2693 | <p> |
| 2694 | switch color to blue |
| 2695 | </p> |
| 2696 | </dd> |
| 2697 | <dt class="hdlist1"> |
| 2698 | <em>%Creset</em> |
| 2699 | </dt> |
| 2700 | <dd> |
| 2701 | <p> |
| 2702 | reset color |
| 2703 | </p> |
| 2704 | </dd> |
| 2705 | <dt class="hdlist1"> |
| 2706 | <em>%C(…)</em> |
| 2707 | </dt> |
| 2708 | <dd> |
| 2709 | <p> |
| 2710 | color specification, as described under Values in the |
| 2711 | "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By |
| 2712 | default, colors are shown only when enabled for log output |
| 2713 | (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting |
| 2714 | the <code>auto</code> settings of the former if we are going to a |
| 2715 | terminal). <code>%C(auto,...)</code> is accepted as a historical |
| 2716 | synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying |
| 2717 | <code>%C(always,...)</code> will show the colors even when color is |
| 2718 | not otherwise enabled (though consider just using |
| 2719 | <code>--color=always</code> to enable color for the whole output, |
| 2720 | including this format and anything else git might color). |
| 2721 | <code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring |
| 2722 | on the next placeholders until the color is switched |
| 2723 | again. |
| 2724 | </p> |
| 2725 | </dd> |
| 2726 | <dt class="hdlist1"> |
| 2727 | <em>%m</em> |
| 2728 | </dt> |
| 2729 | <dd> |
| 2730 | <p> |
| 2731 | left (<code><</code>), right (<code>></code>) or boundary (<code>-</code>) mark |
| 2732 | </p> |
| 2733 | </dd> |
| 2734 | <dt class="hdlist1"> |
| 2735 | <em>%w([<w>[,<i1>[,<i2>]]])</em> |
| 2736 | </dt> |
| 2737 | <dd> |
| 2738 | <p> |
| 2739 | switch line wrapping, like the -w option of |
| 2740 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
| 2741 | </p> |
| 2742 | </dd> |
| 2743 | <dt class="hdlist1"> |
| 2744 | <em>%<(<N>[,trunc|ltrunc|mtrunc])</em> |
| 2745 | </dt> |
| 2746 | <dd> |
| 2747 | <p> |
| 2748 | make the next placeholder take at |
| 2749 | least N columns, padding spaces on |
| 2750 | the right if necessary. Optionally |
| 2751 | truncate at the beginning (ltrunc), |
| 2752 | the middle (mtrunc) or the end |
| 2753 | (trunc) if the output is longer than |
| 2754 | N columns. Note that truncating |
| 2755 | only works correctly with N >= 2. |
| 2756 | </p> |
| 2757 | </dd> |
| 2758 | <dt class="hdlist1"> |
| 2759 | <em>%<|(<N>)</em> |
| 2760 | </dt> |
| 2761 | <dd> |
| 2762 | <p> |
| 2763 | make the next placeholder take at least until Nth |
| 2764 | columns, padding spaces on the right if necessary |
| 2765 | </p> |
| 2766 | </dd> |
| 2767 | <dt class="hdlist1"> |
| 2768 | <em>%>(<N>)</em>, <em>%>|(<N>)</em> |
| 2769 | </dt> |
| 2770 | <dd> |
| 2771 | <p> |
| 2772 | similar to <em>%<(<N>)</em>, <em>%<|(<N>)</em> respectively, |
| 2773 | but padding spaces on the left |
| 2774 | </p> |
| 2775 | </dd> |
| 2776 | <dt class="hdlist1"> |
| 2777 | <em>%>>(<N>)</em>, <em>%>>|(<N>)</em> |
| 2778 | </dt> |
| 2779 | <dd> |
| 2780 | <p> |
| 2781 | similar to <em>%>(<N>)</em>, <em>%>|(<N>)</em> |
| 2782 | respectively, except that if the next |
| 2783 | placeholder takes more spaces than given and |
| 2784 | there are spaces on its left, use those |
| 2785 | spaces |
| 2786 | </p> |
| 2787 | </dd> |
| 2788 | <dt class="hdlist1"> |
| 2789 | <em>%><(<N>)</em>, <em>%><|(<N>)</em> |
| 2790 | </dt> |
| 2791 | <dd> |
| 2792 | <p> |
| 2793 | similar to <em>%<(<N>)</em>, <em>%<|(<N>)</em> |
| 2794 | respectively, but padding both sides |
| 2795 | (i.e. the text is centered) |
| 2796 | </p> |
| 2797 | </dd> |
| 2798 | </dl></div> |
| 2799 | </li> |
| 2800 | <li> |
| 2801 | <p> |
| 2802 | Placeholders that expand to information extracted from the commit: |
| 2803 | </p> |
| 2804 | <div class="dlist"><dl> |
| 2805 | <dt class="hdlist1"> |
| 2806 | <em>%H</em> |
| 2807 | </dt> |
| 2808 | <dd> |
| 2809 | <p> |
| 2810 | commit hash |
| 2811 | </p> |
| 2812 | </dd> |
| 2813 | <dt class="hdlist1"> |
| 2814 | <em>%h</em> |
| 2815 | </dt> |
| 2816 | <dd> |
| 2817 | <p> |
| 2818 | abbreviated commit hash |
| 2819 | </p> |
| 2820 | </dd> |
| 2821 | <dt class="hdlist1"> |
| 2822 | <em>%T</em> |
| 2823 | </dt> |
| 2824 | <dd> |
| 2825 | <p> |
| 2826 | tree hash |
| 2827 | </p> |
| 2828 | </dd> |
| 2829 | <dt class="hdlist1"> |
| 2830 | <em>%t</em> |
| 2831 | </dt> |
| 2832 | <dd> |
| 2833 | <p> |
| 2834 | abbreviated tree hash |
| 2835 | </p> |
| 2836 | </dd> |
| 2837 | <dt class="hdlist1"> |
| 2838 | <em>%P</em> |
| 2839 | </dt> |
| 2840 | <dd> |
| 2841 | <p> |
| 2842 | parent hashes |
| 2843 | </p> |
| 2844 | </dd> |
| 2845 | <dt class="hdlist1"> |
| 2846 | <em>%p</em> |
| 2847 | </dt> |
| 2848 | <dd> |
| 2849 | <p> |
| 2850 | abbreviated parent hashes |
| 2851 | </p> |
| 2852 | </dd> |
| 2853 | <dt class="hdlist1"> |
| 2854 | <em>%an</em> |
| 2855 | </dt> |
| 2856 | <dd> |
| 2857 | <p> |
| 2858 | author name |
| 2859 | </p> |
| 2860 | </dd> |
| 2861 | <dt class="hdlist1"> |
| 2862 | <em>%aN</em> |
| 2863 | </dt> |
| 2864 | <dd> |
| 2865 | <p> |
| 2866 | author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> |
| 2867 | or <a href="git-blame.html">git-blame(1)</a>) |
| 2868 | </p> |
| 2869 | </dd> |
| 2870 | <dt class="hdlist1"> |
| 2871 | <em>%ae</em> |
| 2872 | </dt> |
| 2873 | <dd> |
| 2874 | <p> |
| 2875 | author email |
| 2876 | </p> |
| 2877 | </dd> |
| 2878 | <dt class="hdlist1"> |
| 2879 | <em>%aE</em> |
| 2880 | </dt> |
| 2881 | <dd> |
| 2882 | <p> |
| 2883 | author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> |
| 2884 | or <a href="git-blame.html">git-blame(1)</a>) |
| 2885 | </p> |
| 2886 | </dd> |
| 2887 | <dt class="hdlist1"> |
| Junio C Hamano | 8ac8a3d | 2019-11-11 04:33:46 | [diff] [blame] | 2888 | <em>%al</em> |
| 2889 | </dt> |
| 2890 | <dd> |
| 2891 | <p> |
| 2892 | author email local-part (the part before the <em>@</em> sign) |
| 2893 | </p> |
| 2894 | </dd> |
| 2895 | <dt class="hdlist1"> |
| 2896 | <em>%aL</em> |
| 2897 | </dt> |
| 2898 | <dd> |
| 2899 | <p> |
| 2900 | author local-part (see <em>%al</em>) respecting .mailmap, see |
| 2901 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 2902 | </p> |
| 2903 | </dd> |
| 2904 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 2905 | <em>%ad</em> |
| 2906 | </dt> |
| 2907 | <dd> |
| 2908 | <p> |
| 2909 | author date (format respects --date= option) |
| 2910 | </p> |
| 2911 | </dd> |
| 2912 | <dt class="hdlist1"> |
| 2913 | <em>%aD</em> |
| 2914 | </dt> |
| 2915 | <dd> |
| 2916 | <p> |
| 2917 | author date, RFC2822 style |
| 2918 | </p> |
| 2919 | </dd> |
| 2920 | <dt class="hdlist1"> |
| 2921 | <em>%ar</em> |
| 2922 | </dt> |
| 2923 | <dd> |
| 2924 | <p> |
| 2925 | author date, relative |
| 2926 | </p> |
| 2927 | </dd> |
| 2928 | <dt class="hdlist1"> |
| 2929 | <em>%at</em> |
| 2930 | </dt> |
| 2931 | <dd> |
| 2932 | <p> |
| 2933 | author date, UNIX timestamp |
| 2934 | </p> |
| 2935 | </dd> |
| 2936 | <dt class="hdlist1"> |
| 2937 | <em>%ai</em> |
| 2938 | </dt> |
| 2939 | <dd> |
| 2940 | <p> |
| 2941 | author date, ISO 8601-like format |
| 2942 | </p> |
| 2943 | </dd> |
| 2944 | <dt class="hdlist1"> |
| 2945 | <em>%aI</em> |
| 2946 | </dt> |
| 2947 | <dd> |
| 2948 | <p> |
| 2949 | author date, strict ISO 8601 format |
| 2950 | </p> |
| 2951 | </dd> |
| 2952 | <dt class="hdlist1"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 2953 | <em>%as</em> |
| 2954 | </dt> |
| 2955 | <dd> |
| 2956 | <p> |
| 2957 | author date, short format (<code>YYYY-MM-DD</code>) |
| 2958 | </p> |
| 2959 | </dd> |
| 2960 | <dt class="hdlist1"> |
| Junio C Hamano | be601db | 2021-05-07 04:20:28 | [diff] [blame] | 2961 | <em>%ah</em> |
| 2962 | </dt> |
| 2963 | <dd> |
| 2964 | <p> |
| 2965 | author date, human style (like the <code>--date=human</code> option of |
| 2966 | <a href="git-rev-list.html">git-rev-list(1)</a>) |
| 2967 | </p> |
| 2968 | </dd> |
| 2969 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 2970 | <em>%cn</em> |
| 2971 | </dt> |
| 2972 | <dd> |
| 2973 | <p> |
| 2974 | committer name |
| 2975 | </p> |
| 2976 | </dd> |
| 2977 | <dt class="hdlist1"> |
| 2978 | <em>%cN</em> |
| 2979 | </dt> |
| 2980 | <dd> |
| 2981 | <p> |
| 2982 | committer name (respecting .mailmap, see |
| 2983 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 2984 | </p> |
| 2985 | </dd> |
| 2986 | <dt class="hdlist1"> |
| 2987 | <em>%ce</em> |
| 2988 | </dt> |
| 2989 | <dd> |
| 2990 | <p> |
| 2991 | committer email |
| 2992 | </p> |
| 2993 | </dd> |
| 2994 | <dt class="hdlist1"> |
| 2995 | <em>%cE</em> |
| 2996 | </dt> |
| 2997 | <dd> |
| 2998 | <p> |
| 2999 | committer email (respecting .mailmap, see |
| 3000 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 3001 | </p> |
| 3002 | </dd> |
| 3003 | <dt class="hdlist1"> |
| Junio C Hamano | 8ac8a3d | 2019-11-11 04:33:46 | [diff] [blame] | 3004 | <em>%cl</em> |
| 3005 | </dt> |
| 3006 | <dd> |
| 3007 | <p> |
| Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 3008 | committer email local-part (the part before the <em>@</em> sign) |
| Junio C Hamano | 8ac8a3d | 2019-11-11 04:33:46 | [diff] [blame] | 3009 | </p> |
| 3010 | </dd> |
| 3011 | <dt class="hdlist1"> |
| 3012 | <em>%cL</em> |
| 3013 | </dt> |
| 3014 | <dd> |
| 3015 | <p> |
| Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 3016 | committer local-part (see <em>%cl</em>) respecting .mailmap, see |
| Junio C Hamano | 8ac8a3d | 2019-11-11 04:33:46 | [diff] [blame] | 3017 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 3018 | </p> |
| 3019 | </dd> |
| 3020 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3021 | <em>%cd</em> |
| 3022 | </dt> |
| 3023 | <dd> |
| 3024 | <p> |
| 3025 | committer date (format respects --date= option) |
| 3026 | </p> |
| 3027 | </dd> |
| 3028 | <dt class="hdlist1"> |
| 3029 | <em>%cD</em> |
| 3030 | </dt> |
| 3031 | <dd> |
| 3032 | <p> |
| 3033 | committer date, RFC2822 style |
| 3034 | </p> |
| 3035 | </dd> |
| 3036 | <dt class="hdlist1"> |
| 3037 | <em>%cr</em> |
| 3038 | </dt> |
| 3039 | <dd> |
| 3040 | <p> |
| 3041 | committer date, relative |
| 3042 | </p> |
| 3043 | </dd> |
| 3044 | <dt class="hdlist1"> |
| 3045 | <em>%ct</em> |
| 3046 | </dt> |
| 3047 | <dd> |
| 3048 | <p> |
| 3049 | committer date, UNIX timestamp |
| 3050 | </p> |
| 3051 | </dd> |
| 3052 | <dt class="hdlist1"> |
| 3053 | <em>%ci</em> |
| 3054 | </dt> |
| 3055 | <dd> |
| 3056 | <p> |
| 3057 | committer date, ISO 8601-like format |
| 3058 | </p> |
| 3059 | </dd> |
| 3060 | <dt class="hdlist1"> |
| 3061 | <em>%cI</em> |
| 3062 | </dt> |
| 3063 | <dd> |
| 3064 | <p> |
| 3065 | committer date, strict ISO 8601 format |
| 3066 | </p> |
| 3067 | </dd> |
| 3068 | <dt class="hdlist1"> |
| Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 3069 | <em>%cs</em> |
| 3070 | </dt> |
| 3071 | <dd> |
| 3072 | <p> |
| 3073 | committer date, short format (<code>YYYY-MM-DD</code>) |
| 3074 | </p> |
| 3075 | </dd> |
| 3076 | <dt class="hdlist1"> |
| Junio C Hamano | be601db | 2021-05-07 04:20:28 | [diff] [blame] | 3077 | <em>%ch</em> |
| 3078 | </dt> |
| 3079 | <dd> |
| 3080 | <p> |
| Junio C Hamano | 608b11d | 2021-05-16 21:40:45 | [diff] [blame] | 3081 | committer date, human style (like the <code>--date=human</code> option of |
| Junio C Hamano | be601db | 2021-05-07 04:20:28 | [diff] [blame] | 3082 | <a href="git-rev-list.html">git-rev-list(1)</a>) |
| 3083 | </p> |
| 3084 | </dd> |
| 3085 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3086 | <em>%d</em> |
| 3087 | </dt> |
| 3088 | <dd> |
| 3089 | <p> |
| 3090 | ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a> |
| 3091 | </p> |
| 3092 | </dd> |
| 3093 | <dt class="hdlist1"> |
| 3094 | <em>%D</em> |
| 3095 | </dt> |
| 3096 | <dd> |
| 3097 | <p> |
| 3098 | ref names without the " (", ")" wrapping. |
| 3099 | </p> |
| 3100 | </dd> |
| 3101 | <dt class="hdlist1"> |
| Junio C Hamano | 458281a | 2021-03-22 21:20:26 | [diff] [blame] | 3102 | <em>%(describe[:options])</em> |
| 3103 | </dt> |
| 3104 | <dd> |
| 3105 | <p> |
| 3106 | human-readable name, like |
| 3107 | <a href="git-describe.html">git-describe(1)</a>; empty string for |
| 3108 | undescribable commits. The <code>describe</code> string |
| 3109 | may be followed by a colon and zero or more |
| 3110 | comma-separated options. Descriptions can be |
| 3111 | inconsistent when tags are added or removed at |
| 3112 | the same time. |
| 3113 | </p> |
| 3114 | <div class="ulist"><ul> |
| 3115 | <li> |
| 3116 | <p> |
| Junio C Hamano | 2b15318 | 2021-12-15 21:00:31 | [diff] [blame] | 3117 | <em>tags[=<bool-value>]</em>: Instead of only considering annotated tags, |
| 3118 | consider lightweight tags as well. |
| 3119 | </p> |
| 3120 | </li> |
| 3121 | <li> |
| 3122 | <p> |
| 3123 | <em>abbrev=<number></em>: Instead of using the default number of hexadecimal digits |
| 3124 | (which will vary according to the number of objects in the repository with a |
| 3125 | default of 7) of the abbreviated object name, use <number> digits, or as many |
| 3126 | digits as needed to form a unique object name. |
| 3127 | </p> |
| 3128 | </li> |
| 3129 | <li> |
| 3130 | <p> |
| Junio C Hamano | 458281a | 2021-03-22 21:20:26 | [diff] [blame] | 3131 | <em>match=<pattern></em>: Only consider tags matching the given |
| 3132 | <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix. |
| 3133 | </p> |
| 3134 | </li> |
| 3135 | <li> |
| 3136 | <p> |
| 3137 | <em>exclude=<pattern></em>: Do not consider tags matching the given |
| 3138 | <code>glob(7)</code> pattern, excluding the "refs/tags/" prefix. |
| 3139 | </p> |
| 3140 | </li> |
| 3141 | </ul></div> |
| 3142 | </dd> |
| 3143 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3144 | <em>%S</em> |
| 3145 | </dt> |
| 3146 | <dd> |
| 3147 | <p> |
| 3148 | ref name given on the command line by which the commit was reached |
| 3149 | (like <code>git log --source</code>), only works with <code>git log</code> |
| 3150 | </p> |
| 3151 | </dd> |
| 3152 | <dt class="hdlist1"> |
| 3153 | <em>%e</em> |
| 3154 | </dt> |
| 3155 | <dd> |
| 3156 | <p> |
| 3157 | encoding |
| 3158 | </p> |
| 3159 | </dd> |
| 3160 | <dt class="hdlist1"> |
| 3161 | <em>%s</em> |
| 3162 | </dt> |
| 3163 | <dd> |
| 3164 | <p> |
| 3165 | subject |
| 3166 | </p> |
| 3167 | </dd> |
| 3168 | <dt class="hdlist1"> |
| 3169 | <em>%f</em> |
| 3170 | </dt> |
| 3171 | <dd> |
| 3172 | <p> |
| 3173 | sanitized subject line, suitable for a filename |
| 3174 | </p> |
| 3175 | </dd> |
| 3176 | <dt class="hdlist1"> |
| 3177 | <em>%b</em> |
| 3178 | </dt> |
| 3179 | <dd> |
| 3180 | <p> |
| 3181 | body |
| 3182 | </p> |
| 3183 | </dd> |
| 3184 | <dt class="hdlist1"> |
| 3185 | <em>%B</em> |
| 3186 | </dt> |
| 3187 | <dd> |
| 3188 | <p> |
| 3189 | raw body (unwrapped subject and body) |
| 3190 | </p> |
| 3191 | </dd> |
| 3192 | <dt class="hdlist1"> |
| 3193 | <em>%N</em> |
| 3194 | </dt> |
| 3195 | <dd> |
| 3196 | <p> |
| 3197 | commit notes |
| 3198 | </p> |
| 3199 | </dd> |
| 3200 | <dt class="hdlist1"> |
| 3201 | <em>%GG</em> |
| 3202 | </dt> |
| 3203 | <dd> |
| 3204 | <p> |
| 3205 | raw verification message from GPG for a signed commit |
| 3206 | </p> |
| 3207 | </dd> |
| 3208 | <dt class="hdlist1"> |
| 3209 | <em>%G?</em> |
| 3210 | </dt> |
| 3211 | <dd> |
| 3212 | <p> |
| 3213 | show "G" for a good (valid) signature, |
| 3214 | "B" for a bad signature, |
| 3215 | "U" for a good signature with unknown validity, |
| 3216 | "X" for a good signature that has expired, |
| 3217 | "Y" for a good signature made by an expired key, |
| 3218 | "R" for a good signature made by a revoked key, |
| 3219 | "E" if the signature cannot be checked (e.g. missing key) |
| 3220 | and "N" for no signature |
| 3221 | </p> |
| 3222 | </dd> |
| 3223 | <dt class="hdlist1"> |
| 3224 | <em>%GS</em> |
| 3225 | </dt> |
| 3226 | <dd> |
| 3227 | <p> |
| 3228 | show the name of the signer for a signed commit |
| 3229 | </p> |
| 3230 | </dd> |
| 3231 | <dt class="hdlist1"> |
| 3232 | <em>%GK</em> |
| 3233 | </dt> |
| 3234 | <dd> |
| 3235 | <p> |
| 3236 | show the key used to sign a signed commit |
| 3237 | </p> |
| 3238 | </dd> |
| 3239 | <dt class="hdlist1"> |
| 3240 | <em>%GF</em> |
| 3241 | </dt> |
| 3242 | <dd> |
| 3243 | <p> |
| 3244 | show the fingerprint of the key used to sign a signed commit |
| 3245 | </p> |
| 3246 | </dd> |
| 3247 | <dt class="hdlist1"> |
| 3248 | <em>%GP</em> |
| 3249 | </dt> |
| 3250 | <dd> |
| 3251 | <p> |
| 3252 | show the fingerprint of the primary key whose subkey was used |
| 3253 | to sign a signed commit |
| 3254 | </p> |
| 3255 | </dd> |
| 3256 | <dt class="hdlist1"> |
| Junio C Hamano | bee061d | 2020-01-30 23:21:18 | [diff] [blame] | 3257 | <em>%GT</em> |
| 3258 | </dt> |
| 3259 | <dd> |
| 3260 | <p> |
| 3261 | show the trust level for the key used to sign a signed commit |
| 3262 | </p> |
| 3263 | </dd> |
| 3264 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3265 | <em>%gD</em> |
| 3266 | </dt> |
| 3267 | <dd> |
| 3268 | <p> |
| 3269 | 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] | 3270 | minutes ago}</code>; the format follows the rules described for the |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3271 | <code>-g</code> option. The portion before the <code>@</code> is the refname as |
| 3272 | given on the command line (so <code>git log -g refs/heads/master</code> |
| 3273 | would yield <code>refs/heads/master@{0}</code>). |
| 3274 | </p> |
| 3275 | </dd> |
| 3276 | <dt class="hdlist1"> |
| 3277 | <em>%gd</em> |
| 3278 | </dt> |
| 3279 | <dd> |
| 3280 | <p> |
| 3281 | shortened reflog selector; same as <code>%gD</code>, but the refname |
| 3282 | portion is shortened for human readability (so |
| 3283 | <code>refs/heads/master</code> becomes just <code>master</code>). |
| 3284 | </p> |
| 3285 | </dd> |
| 3286 | <dt class="hdlist1"> |
| 3287 | <em>%gn</em> |
| 3288 | </dt> |
| 3289 | <dd> |
| 3290 | <p> |
| 3291 | reflog identity name |
| 3292 | </p> |
| 3293 | </dd> |
| 3294 | <dt class="hdlist1"> |
| 3295 | <em>%gN</em> |
| 3296 | </dt> |
| 3297 | <dd> |
| 3298 | <p> |
| 3299 | reflog identity name (respecting .mailmap, see |
| 3300 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 3301 | </p> |
| 3302 | </dd> |
| 3303 | <dt class="hdlist1"> |
| 3304 | <em>%ge</em> |
| 3305 | </dt> |
| 3306 | <dd> |
| 3307 | <p> |
| 3308 | reflog identity email |
| 3309 | </p> |
| 3310 | </dd> |
| 3311 | <dt class="hdlist1"> |
| 3312 | <em>%gE</em> |
| 3313 | </dt> |
| 3314 | <dd> |
| 3315 | <p> |
| 3316 | reflog identity email (respecting .mailmap, see |
| 3317 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 3318 | </p> |
| 3319 | </dd> |
| 3320 | <dt class="hdlist1"> |
| 3321 | <em>%gs</em> |
| 3322 | </dt> |
| 3323 | <dd> |
| 3324 | <p> |
| 3325 | reflog subject |
| 3326 | </p> |
| 3327 | </dd> |
| 3328 | <dt class="hdlist1"> |
| 3329 | <em>%(trailers[:options])</em> |
| 3330 | </dt> |
| 3331 | <dd> |
| 3332 | <p> |
| 3333 | display the trailers of the body as |
| 3334 | interpreted by |
| 3335 | <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The |
| 3336 | <code>trailers</code> string may be followed by a colon |
| Junio C Hamano | 674f3e1 | 2021-01-07 08:42:49 | [diff] [blame] | 3337 | and zero or more comma-separated options. |
| 3338 | If any option is provided multiple times the |
| Junio C Hamano | 608b11d | 2021-05-16 21:40:45 | [diff] [blame] | 3339 | last occurrence wins. |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3340 | </p> |
| 3341 | <div class="ulist"><ul> |
| 3342 | <li> |
| 3343 | <p> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 3344 | <em>key=<key></em>: only show trailers with specified <key>. Matching is done |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3345 | case-insensitively and trailing colon is optional. If option is |
| 3346 | given multiple times trailer lines matching any of the keys are |
| 3347 | shown. This option automatically enables the <code>only</code> option so that |
| 3348 | non-trailer lines in the trailer block are hidden. If that is not |
| 3349 | desired it can be disabled with <code>only=false</code>. E.g., |
| 3350 | <code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key |
| 3351 | <code>Reviewed-by</code>. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3352 | </p> |
| 3353 | </li> |
| 3354 | <li> |
| 3355 | <p> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 3356 | <em>only[=<bool>]</em>: select whether non-trailer lines from the trailer |
| Junio C Hamano | 674f3e1 | 2021-01-07 08:42:49 | [diff] [blame] | 3357 | block should be included. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3358 | </p> |
| 3359 | </li> |
| 3360 | <li> |
| 3361 | <p> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 3362 | <em>separator=<sep></em>: specify a separator inserted between trailer |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3363 | lines. When this option is not given each trailer line is |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 3364 | terminated with a line feed character. The string <sep> may contain |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3365 | the literal formatting codes described above. To use comma as |
| 3366 | separator one must use <code>%x2C</code> as it would otherwise be parsed as |
| Junio C Hamano | 674f3e1 | 2021-01-07 08:42:49 | [diff] [blame] | 3367 | next option. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3368 | shows all trailer lines whose key is "Ticket" separated by a comma |
| 3369 | and a space. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3370 | </p> |
| 3371 | </li> |
| 3372 | <li> |
| 3373 | <p> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 3374 | <em>unfold[=<bool>]</em>: make it behave as if interpret-trailer’s <code>--unfold</code> |
| Junio C Hamano | 674f3e1 | 2021-01-07 08:42:49 | [diff] [blame] | 3375 | option was given. E.g., |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3376 | <code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3377 | </p> |
| 3378 | </li> |
| 3379 | <li> |
| 3380 | <p> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 3381 | <em>keyonly[=<bool>]</em>: only show the key part of the trailer. |
| Junio C Hamano | 674f3e1 | 2021-01-07 08:42:49 | [diff] [blame] | 3382 | </p> |
| 3383 | </li> |
| 3384 | <li> |
| 3385 | <p> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 3386 | <em>valueonly[=<bool>]</em>: only show the value part of the trailer. |
| Junio C Hamano | 674f3e1 | 2021-01-07 08:42:49 | [diff] [blame] | 3387 | </p> |
| 3388 | </li> |
| 3389 | <li> |
| 3390 | <p> |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 3391 | <em>key_value_separator=<sep></em>: specify a separator inserted between |
| Junio C Hamano | 674f3e1 | 2021-01-07 08:42:49 | [diff] [blame] | 3392 | trailer lines. When this option is not given each trailer key-value |
| 3393 | pair is separated by ": ". Otherwise it shares the same semantics |
| Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 3394 | as <em>separator=<sep></em> above. |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3395 | </p> |
| 3396 | </li> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3397 | </ul></div> |
| 3398 | </dd> |
| 3399 | </dl></div> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 3400 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3401 | </ul></div> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 3402 | </li> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 3403 | </ul></div> |
| 3404 | <div class="admonitionblock"> |
| 3405 | <table><tr> |
| 3406 | <td class="icon"> |
| 3407 | <div class="title">Note</div> |
| 3408 | </td> |
| 3409 | <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] | 3410 | revision traversal engine. For example, the <code>%g*</code> reflog options will |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 3411 | 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] | 3412 | <code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short" |
| 3413 | decoration format if <code>--decorate</code> was not already provided on the command |
| 3414 | line.</td> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 3415 | </tr></table> |
| 3416 | </div> |
| Junio C Hamano | 2b15318 | 2021-12-15 21:00:31 | [diff] [blame] | 3417 | <div class="paragraph"><p>The boolean options accept an optional value <code>[=<bool-value>]</code>. The values |
| 3418 | <code>true</code>, <code>false</code>, <code>on</code>, <code>off</code> etc. are all accepted. See the "boolean" |
| 3419 | sub-section in "EXAMPLES" in <a href="git-config.html">git-config(1)</a>. If a boolean |
| 3420 | option is given with no value, it’s enabled.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3421 | <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] | 3422 | is inserted immediately before the expansion if and only if the |
| 3423 | placeholder expands to a non-empty string.</p></div> |
| Junio C Hamano | 535c65c | 2017-06-24 22:51:58 | [diff] [blame] | 3424 | <div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive |
| 3425 | 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] | 3426 | placeholder expands to an empty string.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3427 | <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] | 3428 | is inserted immediately before the expansion if and only if the |
| 3429 | placeholder expands to a non-empty string.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3430 | <div class="ulist"><ul> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3431 | <li> |
| 3432 | <p> |
| 3433 | <em>tformat:</em> |
| 3434 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3435 | <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] | 3436 | provides "terminator" semantics instead of "separator" semantics. In |
| 3437 | other words, each commit has the message terminator character (usually a |
| 3438 | newline) appended, rather than a separator placed between entries. |
| 3439 | This means that the final entry of a single-line format will be properly |
| 3440 | terminated with a new line, just as the "oneline" format does. |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3441 | For example:</p></div> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3442 | <div class="listingblock"> |
| 3443 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3444 | <pre><code>$ git log -2 --pretty=format:%h 4da45bef \ |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3445 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 3446 | 4da45be |
| 3447 | 7134973 -- NO NEWLINE |
| 3448 | |
| 3449 | $ git log -2 --pretty=tformat:%h 4da45bef \ |
| 3450 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 3451 | 4da45be |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3452 | 7134973</code></pre> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3453 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3454 | <div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted |
| 3455 | 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] | 3456 | equivalent:</p></div> |
| 3457 | <div class="listingblock"> |
| 3458 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3459 | <pre><code>$ git log -2 --pretty=tformat:%h 4da45bef |
| 3460 | $ git log -2 --pretty=%h 4da45bef</code></pre> |
| Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 3461 | </div></div> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 3462 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3463 | </ul></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3464 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3465 | </div> |
| 3466 | <div class="sect1"> |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 3467 | <h2 id="_diff_formatting">DIFF FORMATTING</h2> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3468 | <div class="sectionbody"> |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 3469 | <div class="paragraph"><p>By default, <code>git log</code> does not generate any diff output. The options |
| 3470 | below can be used to show the changes made by each commit.</p></div> |
| Junio C Hamano | 8c860d6 | 2021-02-06 01:37:47 | [diff] [blame] | 3471 | <div class="paragraph"><p>Note that unless one of <code>--diff-merges</code> variants (including short |
| 3472 | <code>-m</code>, <code>-c</code>, and <code>--cc</code> options) is explicitly given, merge commits |
| 3473 | will not show a diff, even if a diff format like <code>--patch</code> is |
| 3474 | selected, nor will they match search options like <code>-S</code>. The exception |
| 3475 | is when <code>--first-parent</code> is in use, in which case <code>first-parent</code> is |
| 3476 | the default format.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3477 | <div class="dlist"><dl> |
| 3478 | <dt class="hdlist1"> |
| 3479 | -p |
| 3480 | </dt> |
| 3481 | <dt class="hdlist1"> |
| 3482 | -u |
| 3483 | </dt> |
| 3484 | <dt class="hdlist1"> |
| 3485 | --patch |
| 3486 | </dt> |
| 3487 | <dd> |
| 3488 | <p> |
| 3489 | Generate patch (see section on generating patches). |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3490 | </p> |
| 3491 | </dd> |
| 3492 | <dt class="hdlist1"> |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 3493 | -s |
| 3494 | </dt> |
| 3495 | <dt class="hdlist1"> |
| 3496 | --no-patch |
| 3497 | </dt> |
| 3498 | <dd> |
| 3499 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3500 | Suppress diff output. Useful for commands like <code>git show</code> that |
| 3501 | 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] | 3502 | </p> |
| 3503 | </dd> |
| 3504 | <dt class="hdlist1"> |
| Junio C Hamano | f1fc6ca | 2022-02-17 01:32:33 | [diff] [blame] | 3505 | --diff-merges=(off|none|on|first-parent|1|separate|m|combined|c|dense-combined|cc|remerge|r) |
| Junio C Hamano | 8c860d6 | 2021-02-06 01:37:47 | [diff] [blame] | 3506 | </dt> |
| 3507 | <dt class="hdlist1"> |
| 3508 | --no-diff-merges |
| 3509 | </dt> |
| 3510 | <dd> |
| 3511 | <p> |
| 3512 | Specify diff format to be used for merge commits. Default is |
| 3513 | <code>off</code> unless <code>--first-parent</code> is in use, in which case |
| 3514 | <code>first-parent</code> is the default. |
| 3515 | </p> |
| 3516 | <div class="dlist"><dl> |
| 3517 | <dt class="hdlist1"> |
| 3518 | --diff-merges=(off|none) |
| 3519 | </dt> |
| 3520 | <dt class="hdlist1"> |
| 3521 | --no-diff-merges |
| 3522 | </dt> |
| 3523 | <dd> |
| 3524 | <p> |
| 3525 | Disable output of diffs for merge commits. Useful to override |
| 3526 | implied value. |
| 3527 | </p> |
| 3528 | </dd> |
| 3529 | <dt class="hdlist1"> |
| Junio C Hamano | 4078a55 | 2021-04-30 06:08:10 | [diff] [blame] | 3530 | --diff-merges=on |
| 3531 | </dt> |
| 3532 | <dt class="hdlist1"> |
| 3533 | --diff-merges=m |
| 3534 | </dt> |
| 3535 | <dt class="hdlist1"> |
| 3536 | -m |
| 3537 | </dt> |
| 3538 | <dd> |
| 3539 | <p> |
| 3540 | This option makes diff output for merge commits to be shown in |
| Junio C Hamano | 8650543 | 2021-08-11 20:13:58 | [diff] [blame] | 3541 | the default format. <code>-m</code> will produce the output only if <code>-p</code> |
| 3542 | is given as well. The default format could be changed using |
| Junio C Hamano | 4078a55 | 2021-04-30 06:08:10 | [diff] [blame] | 3543 | <code>log.diffMerges</code> configuration parameter, which default value |
| Junio C Hamano | 8650543 | 2021-08-11 20:13:58 | [diff] [blame] | 3544 | is <code>separate</code>. |
| Junio C Hamano | 4078a55 | 2021-04-30 06:08:10 | [diff] [blame] | 3545 | </p> |
| 3546 | </dd> |
| 3547 | <dt class="hdlist1"> |
| Junio C Hamano | 8c860d6 | 2021-02-06 01:37:47 | [diff] [blame] | 3548 | --diff-merges=first-parent |
| 3549 | </dt> |
| 3550 | <dt class="hdlist1"> |
| 3551 | --diff-merges=1 |
| 3552 | </dt> |
| 3553 | <dd> |
| 3554 | <p> |
| 3555 | This option makes merge commits show the full diff with |
| 3556 | respect to the first parent only. |
| 3557 | </p> |
| 3558 | </dd> |
| 3559 | <dt class="hdlist1"> |
| 3560 | --diff-merges=separate |
| 3561 | </dt> |
| Junio C Hamano | 8c860d6 | 2021-02-06 01:37:47 | [diff] [blame] | 3562 | <dd> |
| 3563 | <p> |
| 3564 | This makes merge commits show the full diff with respect to |
| 3565 | each of the parents. Separate log entry and diff is generated |
| Junio C Hamano | 8650543 | 2021-08-11 20:13:58 | [diff] [blame] | 3566 | for each parent. |
| Junio C Hamano | 8c860d6 | 2021-02-06 01:37:47 | [diff] [blame] | 3567 | </p> |
| 3568 | </dd> |
| 3569 | <dt class="hdlist1"> |
| Junio C Hamano | f1fc6ca | 2022-02-17 01:32:33 | [diff] [blame] | 3570 | --diff-merges=remerge |
| 3571 | </dt> |
| 3572 | <dt class="hdlist1"> |
| 3573 | --diff-merges=r |
| 3574 | </dt> |
| 3575 | <dt class="hdlist1"> |
| 3576 | --remerge-diff |
| 3577 | </dt> |
| 3578 | <dd> |
| 3579 | <p> |
| 3580 | With this option, two-parent merge commits are remerged to |
| 3581 | create a temporary tree object — potentially containing files |
| 3582 | with conflict markers and such. A diff is then shown between |
| 3583 | that temporary tree and the actual merge commit. |
| 3584 | </p> |
| 3585 | <div class="paragraph"><p>The output emitted when this option is used is subject to change, and |
| 3586 | so is its interaction with other options (unless explicitly |
| 3587 | documented).</p></div> |
| 3588 | </dd> |
| 3589 | <dt class="hdlist1"> |
| Junio C Hamano | 8c860d6 | 2021-02-06 01:37:47 | [diff] [blame] | 3590 | --diff-merges=combined |
| 3591 | </dt> |
| 3592 | <dt class="hdlist1"> |
| 3593 | --diff-merges=c |
| 3594 | </dt> |
| 3595 | <dt class="hdlist1"> |
| 3596 | -c |
| 3597 | </dt> |
| 3598 | <dd> |
| 3599 | <p> |
| 3600 | With this option, diff output for a merge commit shows the |
| 3601 | differences from each of the parents to the merge result |
| 3602 | simultaneously instead of showing pairwise diff between a |
| 3603 | parent and the result one at a time. Furthermore, it lists |
| 3604 | only files which were modified from all parents. <code>-c</code> implies |
| 3605 | <code>-p</code>. |
| 3606 | </p> |
| 3607 | </dd> |
| 3608 | <dt class="hdlist1"> |
| 3609 | --diff-merges=dense-combined |
| 3610 | </dt> |
| 3611 | <dt class="hdlist1"> |
| 3612 | --diff-merges=cc |
| 3613 | </dt> |
| 3614 | <dt class="hdlist1"> |
| 3615 | --cc |
| 3616 | </dt> |
| 3617 | <dd> |
| 3618 | <p> |
| 3619 | With this option the output produced by |
| 3620 | <code>--diff-merges=combined</code> is further compressed by omitting |
| 3621 | uninteresting hunks whose contents in the parents have only |
| 3622 | two variants and the merge result picks one of them without |
| 3623 | modification. <code>--cc</code> implies <code>-p</code>. |
| 3624 | </p> |
| 3625 | </dd> |
| 3626 | </dl></div> |
| 3627 | </dd> |
| 3628 | <dt class="hdlist1"> |
| 3629 | --combined-all-paths |
| 3630 | </dt> |
| 3631 | <dd> |
| 3632 | <p> |
| 3633 | This flag causes combined diffs (used for merge commits) to |
| 3634 | list the name of the file from all parents. It thus only has |
| 3635 | effect when <code>--diff-merges=[dense-]combined</code> is in use, and |
| 3636 | is likely only useful if filename changes are detected (i.e. |
| 3637 | when either rename or copy detection have been requested). |
| 3638 | </p> |
| 3639 | </dd> |
| 3640 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3641 | -U<n> |
| 3642 | </dt> |
| 3643 | <dt class="hdlist1"> |
| 3644 | --unified=<n> |
| 3645 | </dt> |
| 3646 | <dd> |
| 3647 | <p> |
| 3648 | Generate diffs with <n> lines of context instead of |
| Junio C Hamano | ee43d18 | 2020-11-11 22:10:41 | [diff] [blame] | 3649 | the usual three. |
| 3650 | Implies <code>--patch</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3651 | </p> |
| 3652 | </dd> |
| 3653 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3654 | --output=<file> |
| 3655 | </dt> |
| 3656 | <dd> |
| 3657 | <p> |
| 3658 | Output to a specific file instead of stdout. |
| 3659 | </p> |
| 3660 | </dd> |
| 3661 | <dt class="hdlist1"> |
| 3662 | --output-indicator-new=<char> |
| 3663 | </dt> |
| 3664 | <dt class="hdlist1"> |
| 3665 | --output-indicator-old=<char> |
| 3666 | </dt> |
| 3667 | <dt class="hdlist1"> |
| 3668 | --output-indicator-context=<char> |
| 3669 | </dt> |
| 3670 | <dd> |
| 3671 | <p> |
| 3672 | Specify the character used to indicate new, old or context |
| 3673 | lines in the generated patch. Normally they are <em>+</em>, <em>-</em> and |
| 3674 | ' ' respectively. |
| 3675 | </p> |
| 3676 | </dd> |
| 3677 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3678 | --raw |
| 3679 | </dt> |
| 3680 | <dd> |
| 3681 | <p> |
| Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 3682 | For each commit, show a summary of changes using the raw diff |
| 3683 | format. See the "RAW OUTPUT FORMAT" section of |
| 3684 | <a href="git-diff.html">git-diff(1)</a>. This is different from showing the log |
| 3685 | itself in raw format, which you can achieve with |
| 3686 | <code>--format=raw</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3687 | </p> |
| 3688 | </dd> |
| 3689 | <dt class="hdlist1"> |
| 3690 | --patch-with-raw |
| 3691 | </dt> |
| 3692 | <dd> |
| 3693 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3694 | Synonym for <code>-p --raw</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3695 | </p> |
| 3696 | </dd> |
| 3697 | <dt class="hdlist1"> |
| Junio C Hamano | 255163d | 2020-08-18 00:37:23 | [diff] [blame] | 3698 | -t |
| 3699 | </dt> |
| 3700 | <dd> |
| 3701 | <p> |
| 3702 | Show the tree objects in the diff output. |
| 3703 | </p> |
| 3704 | </dd> |
| 3705 | <dt class="hdlist1"> |
| Junio C Hamano | ad70bf0 | 2016-09-26 23:44:27 | [diff] [blame] | 3706 | --indent-heuristic |
| 3707 | </dt> |
| Junio C Hamano | a65b676 | 2017-11-06 04:45:42 | [diff] [blame] | 3708 | <dd> |
| 3709 | <p> |
| Junio C Hamano | 14e6683 | 2018-06-18 18:32:19 | [diff] [blame] | 3710 | Enable the heuristic that shifts diff hunk boundaries to make patches |
| Junio C Hamano | a65b676 | 2017-11-06 04:45:42 | [diff] [blame] | 3711 | easier to read. This is the default. |
| 3712 | </p> |
| 3713 | </dd> |
| Junio C Hamano | ad70bf0 | 2016-09-26 23:44:27 | [diff] [blame] | 3714 | <dt class="hdlist1"> |
| 3715 | --no-indent-heuristic |
| 3716 | </dt> |
| Junio C Hamano | 5f88833 | 2016-06-13 19:28:31 | [diff] [blame] | 3717 | <dd> |
| 3718 | <p> |
| Junio C Hamano | a65b676 | 2017-11-06 04:45:42 | [diff] [blame] | 3719 | Disable the indent heuristic. |
| Junio C Hamano | 5f88833 | 2016-06-13 19:28:31 | [diff] [blame] | 3720 | </p> |
| 3721 | </dd> |
| 3722 | <dt class="hdlist1"> |
| Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame] | 3723 | --minimal |
| 3724 | </dt> |
| 3725 | <dd> |
| 3726 | <p> |
| 3727 | Spend extra time to make sure the smallest possible |
| 3728 | diff is produced. |
| 3729 | </p> |
| 3730 | </dd> |
| 3731 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3732 | --patience |
| 3733 | </dt> |
| 3734 | <dd> |
| 3735 | <p> |
| 3736 | Generate a diff using the "patience diff" algorithm. |
| 3737 | </p> |
| 3738 | </dd> |
| 3739 | <dt class="hdlist1"> |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 3740 | --histogram |
| 3741 | </dt> |
| 3742 | <dd> |
| 3743 | <p> |
| 3744 | Generate a diff using the "histogram diff" algorithm. |
| 3745 | </p> |
| 3746 | </dd> |
| 3747 | <dt class="hdlist1"> |
| Junio C Hamano | 047135e | 2017-12-19 21:57:54 | [diff] [blame] | 3748 | --anchored=<text> |
| 3749 | </dt> |
| 3750 | <dd> |
| 3751 | <p> |
| 3752 | Generate a diff using the "anchored diff" algorithm. |
| 3753 | </p> |
| 3754 | <div class="paragraph"><p>This option may be specified more than once.</p></div> |
| 3755 | <div class="paragraph"><p>If a line exists in both the source and destination, exists only once, |
| 3756 | and starts with this text, this algorithm attempts to prevent it from |
| 3757 | appearing as a deletion or addition in the output. It uses the "patience |
| 3758 | diff" algorithm internally.</p></div> |
| 3759 | </dd> |
| 3760 | <dt class="hdlist1"> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3761 | --diff-algorithm={patience|minimal|histogram|myers} |
| 3762 | </dt> |
| 3763 | <dd> |
| 3764 | <p> |
| 3765 | Choose a diff algorithm. The variants are as follows: |
| 3766 | </p> |
| 3767 | <div class="openblock"> |
| 3768 | <div class="content"> |
| 3769 | <div class="dlist"><dl> |
| 3770 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3771 | <code>default</code>, <code>myers</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3772 | </dt> |
| 3773 | <dd> |
| 3774 | <p> |
| 3775 | The basic greedy diff algorithm. Currently, this is the default. |
| 3776 | </p> |
| 3777 | </dd> |
| 3778 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3779 | <code>minimal</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3780 | </dt> |
| 3781 | <dd> |
| 3782 | <p> |
| 3783 | Spend extra time to make sure the smallest possible diff is |
| 3784 | produced. |
| 3785 | </p> |
| 3786 | </dd> |
| 3787 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3788 | <code>patience</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3789 | </dt> |
| 3790 | <dd> |
| 3791 | <p> |
| 3792 | Use "patience diff" algorithm when generating patches. |
| 3793 | </p> |
| 3794 | </dd> |
| 3795 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3796 | <code>histogram</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3797 | </dt> |
| 3798 | <dd> |
| 3799 | <p> |
| 3800 | This algorithm extends the patience algorithm to "support |
| 3801 | low-occurrence common elements". |
| 3802 | </p> |
| 3803 | </dd> |
| 3804 | </dl></div> |
| 3805 | </div></div> |
| Junio C Hamano | 14e6683 | 2018-06-18 18:32:19 | [diff] [blame] | 3806 | <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] | 3807 | non-default value and want to use the default one, then you |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3808 | have to use <code>--diff-algorithm=default</code> option.</p></div> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 3809 | </dd> |
| 3810 | <dt class="hdlist1"> |
| Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 3811 | --stat[=<width>[,<name-width>[,<count>]]] |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3812 | </dt> |
| 3813 | <dd> |
| 3814 | <p> |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 3815 | Generate a diffstat. By default, as much space as necessary |
| 3816 | will be used for the filename part, and the rest for the graph |
| 3817 | part. Maximum width defaults to terminal width, or 80 columns |
| Junio C Hamano | 7f2b3cb | 2012-06-22 22:42:39 | [diff] [blame] | 3818 | if not connected to a terminal, and can be overridden by |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3819 | <code><width></code>. The width of the filename part can be limited by |
| 3820 | giving another width <code><name-width></code> after a comma. The width |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 3821 | of the graph part can be limited by using |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3822 | <code>--stat-graph-width=<width></code> (affects all commands generating |
| 3823 | a stat graph) or by setting <code>diff.statGraphWidth=<width></code> |
| 3824 | (does not affect <code>git format-patch</code>). |
| 3825 | By giving a third parameter <code><count></code>, you can limit the |
| 3826 | 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] | 3827 | there are more. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3828 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3829 | <div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=<width></code>, |
| 3830 | <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] | 3831 | </dd> |
| 3832 | <dt class="hdlist1"> |
| Junio C Hamano | 45badf0 | 2018-03-14 21:56:41 | [diff] [blame] | 3833 | --compact-summary |
| 3834 | </dt> |
| 3835 | <dd> |
| 3836 | <p> |
| 3837 | Output a condensed summary of extended header information such |
| 3838 | as file creations or deletions ("new" or "gone", optionally "+l" |
| 3839 | if it’s a symlink) and mode changes ("+x" or "-x" for adding |
| 3840 | or removing executable bit respectively) in diffstat. The |
| Junio C Hamano | fa2915c | 2018-06-19 19:50:18 | [diff] [blame] | 3841 | information is put between the filename part and the graph |
| Junio C Hamano | 45badf0 | 2018-03-14 21:56:41 | [diff] [blame] | 3842 | part. Implies <code>--stat</code>. |
| 3843 | </p> |
| 3844 | </dd> |
| 3845 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3846 | --numstat |
| 3847 | </dt> |
| 3848 | <dd> |
| 3849 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3850 | Similar to <code>--stat</code>, but shows number of added and |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3851 | deleted lines in decimal notation and pathname without |
| 3852 | abbreviation, to make it more machine friendly. For |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3853 | binary files, outputs two <code>-</code> instead of saying |
| 3854 | <code>0 0</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3855 | </p> |
| 3856 | </dd> |
| 3857 | <dt class="hdlist1"> |
| 3858 | --shortstat |
| 3859 | </dt> |
| 3860 | <dd> |
| 3861 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3862 | 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] | 3863 | number of modified files, as well as number of added and deleted |
| 3864 | lines. |
| 3865 | </p> |
| 3866 | </dd> |
| 3867 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3868 | -X[<param1,param2,…>] |
| 3869 | </dt> |
| 3870 | <dt class="hdlist1"> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3871 | --dirstat[=<param1,param2,…>] |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3872 | </dt> |
| 3873 | <dd> |
| 3874 | <p> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3875 | Output the distribution of relative amount of changes for each |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3876 | sub-directory. The behavior of <code>--dirstat</code> can be customized by |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3877 | passing it a comma separated list of parameters. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3878 | The defaults are controlled by the <code>diff.dirstat</code> configuration |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 3879 | variable (see <a href="git-config.html">git-config(1)</a>). |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3880 | The following parameters are available: |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3881 | </p> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3882 | <div class="openblock"> |
| 3883 | <div class="content"> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3884 | <div class="dlist"><dl> |
| 3885 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3886 | <code>changes</code> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3887 | </dt> |
| 3888 | <dd> |
| 3889 | <p> |
| 3890 | Compute the dirstat numbers by counting the lines that have been |
| 3891 | removed from the source, or added to the destination. This ignores |
| 3892 | the amount of pure code movements within a file. In other words, |
| 3893 | rearranging lines in a file is not counted as much as other changes. |
| 3894 | This is the default behavior when no parameter is given. |
| 3895 | </p> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3896 | </dd> |
| 3897 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3898 | <code>lines</code> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3899 | </dt> |
| 3900 | <dd> |
| 3901 | <p> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3902 | Compute the dirstat numbers by doing the regular line-based diff |
| 3903 | analysis, and summing the removed/added line counts. (For binary |
| 3904 | files, count 64-byte chunks instead, since binary files have no |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3905 | natural concept of lines). This is a more expensive <code>--dirstat</code> |
| 3906 | behavior than the <code>changes</code> behavior, but it does count rearranged |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3907 | lines within a file as much as other changes. The resulting output |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3908 | 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] | 3909 | </p> |
| 3910 | </dd> |
| 3911 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3912 | <code>files</code> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3913 | </dt> |
| 3914 | <dd> |
| 3915 | <p> |
| 3916 | Compute the dirstat numbers by counting the number of files changed. |
| 3917 | Each changed file counts equally in the dirstat analysis. This is |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3918 | the computationally cheapest <code>--dirstat</code> behavior, since it does |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3919 | not have to look at the file contents at all. |
| 3920 | </p> |
| 3921 | </dd> |
| 3922 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3923 | <code>cumulative</code> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3924 | </dt> |
| 3925 | <dd> |
| 3926 | <p> |
| 3927 | Count changes in a child directory for the parent directory as well. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3928 | Note that when using <code>cumulative</code>, the sum of the percentages |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3929 | reported may exceed 100%. The default (non-cumulative) behavior can |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3930 | be specified with the <code>noncumulative</code> parameter. |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3931 | </p> |
| 3932 | </dd> |
| 3933 | <dt class="hdlist1"> |
| 3934 | <limit> |
| 3935 | </dt> |
| 3936 | <dd> |
| 3937 | <p> |
| 3938 | An integer parameter specifies a cut-off percent (3% by default). |
| 3939 | Directories contributing less than this percentage of the changes |
| 3940 | are not shown in the output. |
| 3941 | </p> |
| 3942 | </dd> |
| 3943 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3944 | </div></div> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3945 | <div class="paragraph"><p>Example: The following will count changed files, while ignoring |
| 3946 | directories with less than 10% of the total amount of changed files, |
| 3947 | and accumulating child directory counts in the parent directories: |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3948 | <code>--dirstat=files,10,cumulative</code>.</p></div> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 3949 | </dd> |
| 3950 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 3951 | --cumulative |
| 3952 | </dt> |
| 3953 | <dd> |
| 3954 | <p> |
| 3955 | Synonym for --dirstat=cumulative |
| 3956 | </p> |
| 3957 | </dd> |
| 3958 | <dt class="hdlist1"> |
| 3959 | --dirstat-by-file[=<param1,param2>…] |
| 3960 | </dt> |
| 3961 | <dd> |
| 3962 | <p> |
| 3963 | Synonym for --dirstat=files,param1,param2… |
| 3964 | </p> |
| 3965 | </dd> |
| 3966 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3967 | --summary |
| 3968 | </dt> |
| 3969 | <dd> |
| 3970 | <p> |
| 3971 | Output a condensed summary of extended header information |
| 3972 | such as creations, renames and mode changes. |
| 3973 | </p> |
| 3974 | </dd> |
| 3975 | <dt class="hdlist1"> |
| 3976 | --patch-with-stat |
| 3977 | </dt> |
| 3978 | <dd> |
| 3979 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3980 | Synonym for <code>-p --stat</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3981 | </p> |
| 3982 | </dd> |
| 3983 | <dt class="hdlist1"> |
| 3984 | -z |
| 3985 | </dt> |
| 3986 | <dd> |
| 3987 | <p> |
| 3988 | Separate the commits with NULs instead of with new newlines. |
| 3989 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3990 | <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] | 3991 | pathnames and use NULs as output field terminators.</p></div> |
| Junio C Hamano | 0f6f3bf | 2017-03-13 07:01:53 | [diff] [blame] | 3992 | <div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as |
| 3993 | explained for the configuration variable <code>core.quotePath</code> (see |
| 3994 | <a href="git-config.html">git-config(1)</a>).</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3995 | </dd> |
| 3996 | <dt class="hdlist1"> |
| 3997 | --name-only |
| 3998 | </dt> |
| 3999 | <dd> |
| 4000 | <p> |
| Junio C Hamano | 4078a55 | 2021-04-30 06:08:10 | [diff] [blame] | 4001 | Show only names of changed files. The file names are often encoded in UTF-8. |
| 4002 | For more information see the discussion about encoding in the <a href="git-log.html">git-log(1)</a> |
| 4003 | manual page. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4004 | </p> |
| 4005 | </dd> |
| 4006 | <dt class="hdlist1"> |
| 4007 | --name-status |
| 4008 | </dt> |
| 4009 | <dd> |
| 4010 | <p> |
| 4011 | Show only names and status of changed files. See the description |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4012 | of the <code>--diff-filter</code> option on what the status letters mean. |
| Junio C Hamano | 4078a55 | 2021-04-30 06:08:10 | [diff] [blame] | 4013 | Just like <code>--name-only</code> the file names are often encoded in UTF-8. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4014 | </p> |
| 4015 | </dd> |
| 4016 | <dt class="hdlist1"> |
| 4017 | --submodule[=<format>] |
| 4018 | </dt> |
| 4019 | <dd> |
| 4020 | <p> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 4021 | Specify how differences in submodules are shown. When specifying |
| 4022 | <code>--submodule=short</code> the <em>short</em> format is used. This format just |
| 4023 | shows the names of the commits at the beginning and end of the range. |
| 4024 | When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em> |
| 4025 | format is used. This format lists the commits in the range like |
| 4026 | <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code> |
| 4027 | is specified, the <em>diff</em> format is used. This format shows an |
| 4028 | inline diff of the changes in the submodule contents between the |
| 4029 | commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format |
| 4030 | if the config option is unset. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4031 | </p> |
| 4032 | </dd> |
| 4033 | <dt class="hdlist1"> |
| 4034 | --color[=<when>] |
| 4035 | </dt> |
| 4036 | <dd> |
| 4037 | <p> |
| 4038 | Show colored diff. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4039 | <code>--color</code> (i.e. without <em>=<when></em>) is the same as <code>--color=always</code>. |
| 4040 | <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] | 4041 | </p> |
| 4042 | </dd> |
| 4043 | <dt class="hdlist1"> |
| 4044 | --no-color |
| 4045 | </dt> |
| 4046 | <dd> |
| 4047 | <p> |
| Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 4048 | Turn off colored diff. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4049 | It is the same as <code>--color=never</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4050 | </p> |
| 4051 | </dd> |
| 4052 | <dt class="hdlist1"> |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 4053 | --color-moved[=<mode>] |
| 4054 | </dt> |
| 4055 | <dd> |
| 4056 | <p> |
| 4057 | Moved lines of code are colored differently. |
| 4058 | The <mode> defaults to <em>no</em> if the option is not given |
| 4059 | and to <em>zebra</em> if the option with no mode is given. |
| 4060 | The mode must be one of: |
| 4061 | </p> |
| 4062 | <div class="openblock"> |
| 4063 | <div class="content"> |
| 4064 | <div class="dlist"><dl> |
| 4065 | <dt class="hdlist1"> |
| 4066 | no |
| 4067 | </dt> |
| 4068 | <dd> |
| 4069 | <p> |
| 4070 | Moved lines are not highlighted. |
| 4071 | </p> |
| 4072 | </dd> |
| 4073 | <dt class="hdlist1"> |
| 4074 | default |
| 4075 | </dt> |
| 4076 | <dd> |
| 4077 | <p> |
| 4078 | Is a synonym for <code>zebra</code>. This may change to a more sensible mode |
| 4079 | in the future. |
| 4080 | </p> |
| 4081 | </dd> |
| 4082 | <dt class="hdlist1"> |
| 4083 | plain |
| 4084 | </dt> |
| 4085 | <dd> |
| 4086 | <p> |
| 4087 | Any line that is added in one location and was removed |
| 4088 | in another location will be colored with <em>color.diff.newMoved</em>. |
| 4089 | Similarly <em>color.diff.oldMoved</em> will be used for removed lines |
| 4090 | that are added somewhere else in the diff. This mode picks up any |
| 4091 | moved line, but it is not very useful in a review to determine |
| 4092 | if a block of code was moved without permutation. |
| 4093 | </p> |
| 4094 | </dd> |
| 4095 | <dt class="hdlist1"> |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 4096 | blocks |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 4097 | </dt> |
| 4098 | <dd> |
| 4099 | <p> |
| 4100 | Blocks of moved text of at least 20 alphanumeric characters |
| 4101 | are detected greedily. The detected blocks are |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 4102 | painted using either the <em>color.diff.{old,new}Moved</em> color. |
| 4103 | Adjacent blocks cannot be told apart. |
| 4104 | </p> |
| 4105 | </dd> |
| 4106 | <dt class="hdlist1"> |
| 4107 | zebra |
| 4108 | </dt> |
| 4109 | <dd> |
| 4110 | <p> |
| 4111 | Blocks of moved text are detected as in <em>blocks</em> mode. The blocks |
| 4112 | 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] | 4113 | <em>color.diff.{old,new}MovedAlternative</em>. The change between |
| 4114 | the two colors indicates that a new block was detected. |
| 4115 | </p> |
| 4116 | </dd> |
| 4117 | <dt class="hdlist1"> |
| Junio C Hamano | bfd91f4 | 2018-08-17 22:21:16 | [diff] [blame] | 4118 | dimmed-zebra |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 4119 | </dt> |
| 4120 | <dd> |
| 4121 | <p> |
| 4122 | Similar to <em>zebra</em>, but additional dimming of uninteresting parts |
| 4123 | of moved code is performed. The bordering lines of two adjacent |
| 4124 | blocks are considered interesting, the rest is uninteresting. |
| Junio C Hamano | bfd91f4 | 2018-08-17 22:21:16 | [diff] [blame] | 4125 | <code>dimmed_zebra</code> is a deprecated synonym. |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 4126 | </p> |
| 4127 | </dd> |
| 4128 | </dl></div> |
| 4129 | </div></div> |
| 4130 | </dd> |
| 4131 | <dt class="hdlist1"> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 4132 | --no-color-moved |
| 4133 | </dt> |
| 4134 | <dd> |
| 4135 | <p> |
| 4136 | Turn off move detection. This can be used to override configuration |
| 4137 | settings. It is the same as <code>--color-moved=no</code>. |
| 4138 | </p> |
| 4139 | </dd> |
| 4140 | <dt class="hdlist1"> |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 4141 | --color-moved-ws=<modes> |
| 4142 | </dt> |
| 4143 | <dd> |
| 4144 | <p> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 4145 | This configures how whitespace is ignored when performing the |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 4146 | move detection for <code>--color-moved</code>. |
| 4147 | These modes can be given as a comma separated list: |
| 4148 | </p> |
| 4149 | <div class="openblock"> |
| 4150 | <div class="content"> |
| 4151 | <div class="dlist"><dl> |
| 4152 | <dt class="hdlist1"> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 4153 | no |
| 4154 | </dt> |
| 4155 | <dd> |
| 4156 | <p> |
| 4157 | Do not ignore whitespace when performing move detection. |
| 4158 | </p> |
| 4159 | </dd> |
| 4160 | <dt class="hdlist1"> |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 4161 | ignore-space-at-eol |
| 4162 | </dt> |
| 4163 | <dd> |
| 4164 | <p> |
| 4165 | Ignore changes in whitespace at EOL. |
| 4166 | </p> |
| 4167 | </dd> |
| 4168 | <dt class="hdlist1"> |
| 4169 | ignore-space-change |
| 4170 | </dt> |
| 4171 | <dd> |
| 4172 | <p> |
| 4173 | Ignore changes in amount of whitespace. This ignores whitespace |
| 4174 | at line end, and considers all other sequences of one or |
| 4175 | more whitespace characters to be equivalent. |
| 4176 | </p> |
| 4177 | </dd> |
| 4178 | <dt class="hdlist1"> |
| 4179 | ignore-all-space |
| 4180 | </dt> |
| 4181 | <dd> |
| 4182 | <p> |
| 4183 | Ignore whitespace when comparing lines. This ignores differences |
| 4184 | even if one line has whitespace where the other line has none. |
| 4185 | </p> |
| 4186 | </dd> |
| 4187 | <dt class="hdlist1"> |
| 4188 | allow-indentation-change |
| 4189 | </dt> |
| 4190 | <dd> |
| 4191 | <p> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 4192 | Initially ignore any whitespace in the move detection, then |
| Junio C Hamano | f09b7cd | 2018-08-02 23:01:45 | [diff] [blame] | 4193 | group the moved code blocks only into a block if the change in |
| 4194 | whitespace is the same per line. This is incompatible with the |
| 4195 | other modes. |
| 4196 | </p> |
| 4197 | </dd> |
| 4198 | </dl></div> |
| 4199 | </div></div> |
| 4200 | </dd> |
| 4201 | <dt class="hdlist1"> |
| Junio C Hamano | a90214f | 2019-01-28 22:05:25 | [diff] [blame] | 4202 | --no-color-moved-ws |
| 4203 | </dt> |
| 4204 | <dd> |
| 4205 | <p> |
| 4206 | Do not ignore whitespace when performing move detection. This can be |
| 4207 | used to override configuration settings. It is the same as |
| 4208 | <code>--color-moved-ws=no</code>. |
| 4209 | </p> |
| 4210 | </dd> |
| 4211 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4212 | --word-diff[=<mode>] |
| 4213 | </dt> |
| 4214 | <dd> |
| 4215 | <p> |
| 4216 | Show a word diff, using the <mode> to delimit changed words. |
| 4217 | By default, words are delimited by whitespace; see |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4218 | <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] | 4219 | must be one of: |
| 4220 | </p> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4221 | <div class="openblock"> |
| 4222 | <div class="content"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4223 | <div class="dlist"><dl> |
| 4224 | <dt class="hdlist1"> |
| 4225 | color |
| 4226 | </dt> |
| 4227 | <dd> |
| 4228 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4229 | Highlight changed words using only colors. Implies <code>--color</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4230 | </p> |
| 4231 | </dd> |
| 4232 | <dt class="hdlist1"> |
| 4233 | plain |
| 4234 | </dt> |
| 4235 | <dd> |
| 4236 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4237 | Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4238 | attempts to escape the delimiters if they appear in the input, |
| 4239 | so the output may be ambiguous. |
| 4240 | </p> |
| 4241 | </dd> |
| 4242 | <dt class="hdlist1"> |
| 4243 | porcelain |
| 4244 | </dt> |
| 4245 | <dd> |
| 4246 | <p> |
| 4247 | Use a special line-based format intended for script |
| 4248 | consumption. Added/removed/unchanged runs are printed in the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4249 | usual unified diff format, starting with a <code>+</code>/<code>-</code>/` ` |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4250 | character at the beginning of the line and extending to the |
| 4251 | end of the line. Newlines in the input are represented by a |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4252 | tilde <code>~</code> on a line of its own. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4253 | </p> |
| 4254 | </dd> |
| 4255 | <dt class="hdlist1"> |
| 4256 | none |
| 4257 | </dt> |
| 4258 | <dd> |
| 4259 | <p> |
| 4260 | Disable word diff again. |
| 4261 | </p> |
| 4262 | </dd> |
| 4263 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4264 | </div></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4265 | <div class="paragraph"><p>Note that despite the name of the first mode, color is used to |
| 4266 | highlight the changed parts in all modes if enabled.</p></div> |
| 4267 | </dd> |
| 4268 | <dt class="hdlist1"> |
| 4269 | --word-diff-regex=<regex> |
| 4270 | </dt> |
| 4271 | <dd> |
| 4272 | <p> |
| 4273 | Use <regex> to decide what a word is, instead of considering |
| 4274 | runs of non-whitespace to be a word. Also implies |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4275 | <code>--word-diff</code> unless it was already enabled. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4276 | </p> |
| 4277 | <div class="paragraph"><p>Every non-overlapping match of the |
| 4278 | <regex> is considered a word. Anything between these matches is |
| 4279 | considered whitespace and ignored(!) for the purposes of finding |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4280 | differences. You may want to append <code>|[^[:space:]]</code> to your regular |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4281 | expression to make sure that it matches all non-whitespace characters. |
| 4282 | A match that contains a newline is silently truncated(!) at the |
| 4283 | newline.</p></div> |
| Junio C Hamano | 713eded | 2015-12-03 00:24:02 | [diff] [blame] | 4284 | <div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word |
| 4285 | and, correspondingly, show differences character by character.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4286 | <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] | 4287 | <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] | 4288 | overrides any diff driver or configuration setting. Diff drivers |
| 4289 | override configuration settings.</p></div> |
| 4290 | </dd> |
| 4291 | <dt class="hdlist1"> |
| 4292 | --color-words[=<regex>] |
| 4293 | </dt> |
| 4294 | <dd> |
| 4295 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4296 | Equivalent to <code>--word-diff=color</code> plus (if a regex was |
| 4297 | specified) <code>--word-diff-regex=<regex></code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4298 | </p> |
| 4299 | </dd> |
| 4300 | <dt class="hdlist1"> |
| 4301 | --no-renames |
| 4302 | </dt> |
| 4303 | <dd> |
| 4304 | <p> |
| 4305 | Turn off rename detection, even when the configuration |
| 4306 | file gives the default to do so. |
| 4307 | </p> |
| 4308 | </dd> |
| 4309 | <dt class="hdlist1"> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 4310 | --[no-]rename-empty |
| 4311 | </dt> |
| 4312 | <dd> |
| 4313 | <p> |
| 4314 | Whether to use empty blobs as rename source. |
| 4315 | </p> |
| 4316 | </dd> |
| 4317 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4318 | --check |
| 4319 | </dt> |
| 4320 | <dd> |
| 4321 | <p> |
| Junio C Hamano | 84ea1e4 | 2016-04-08 21:53:48 | [diff] [blame] | 4322 | Warn if changes introduce conflict markers or whitespace errors. |
| 4323 | What are considered whitespace errors is controlled by <code>core.whitespace</code> |
| Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 4324 | configuration. By default, trailing whitespaces (including |
| Junio C Hamano | 14e6683 | 2018-06-18 18:32:19 | [diff] [blame] | 4325 | lines that consist solely of whitespaces) and a space character |
| Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 4326 | that is immediately followed by a tab character inside the |
| 4327 | initial indent of the line are considered whitespace errors. |
| 4328 | Exits with non-zero status if problems are found. Not compatible |
| 4329 | with --exit-code. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4330 | </p> |
| 4331 | </dd> |
| 4332 | <dt class="hdlist1"> |
| Junio C Hamano | 8c5d594 | 2015-06-11 19:37:48 | [diff] [blame] | 4333 | --ws-error-highlight=<kind> |
| 4334 | </dt> |
| 4335 | <dd> |
| 4336 | <p> |
| Junio C Hamano | 4b2a6c1 | 2017-08-22 18:32:37 | [diff] [blame] | 4337 | Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code> |
| 4338 | lines of the diff. Multiple values are separated by comma, |
| 4339 | <code>none</code> resets previous values, <code>default</code> reset the list to |
| 4340 | <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When |
| 4341 | this option is not given, and the configuration variable |
| 4342 | <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in |
| 4343 | <code>new</code> lines are highlighted. The whitespace errors are colored |
| Junio C Hamano | 14e6683 | 2018-06-18 18:32:19 | [diff] [blame] | 4344 | with <code>color.diff.whitespace</code>. |
| Junio C Hamano | 8c5d594 | 2015-06-11 19:37:48 | [diff] [blame] | 4345 | </p> |
| 4346 | </dd> |
| 4347 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4348 | --full-index |
| 4349 | </dt> |
| 4350 | <dd> |
| 4351 | <p> |
| 4352 | Instead of the first handful of characters, show the full |
| 4353 | pre- and post-image blob object names on the "index" |
| 4354 | line when generating patch format output. |
| 4355 | </p> |
| 4356 | </dd> |
| 4357 | <dt class="hdlist1"> |
| 4358 | --binary |
| 4359 | </dt> |
| 4360 | <dd> |
| 4361 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4362 | In addition to <code>--full-index</code>, output a binary diff that |
| Junio C Hamano | ee43d18 | 2020-11-11 22:10:41 | [diff] [blame] | 4363 | can be applied with <code>git-apply</code>. |
| 4364 | Implies <code>--patch</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4365 | </p> |
| 4366 | </dd> |
| 4367 | <dt class="hdlist1"> |
| 4368 | --abbrev[=<n>] |
| 4369 | </dt> |
| 4370 | <dd> |
| 4371 | <p> |
| 4372 | Instead of showing the full 40-byte hexadecimal object |
| 4373 | name in diff-raw format output and diff-tree header |
| Junio C Hamano | ee43d18 | 2020-11-11 22:10:41 | [diff] [blame] | 4374 | lines, show the shortest prefix that is at least <em><n></em> |
| 4375 | hexdigits long that uniquely refers the object. |
| Junio C Hamano | cf8aeaf | 2020-08-31 23:16:35 | [diff] [blame] | 4376 | In diff-patch output format, <code>--full-index</code> takes higher |
| 4377 | precedence, i.e. if <code>--full-index</code> is specified, full blob |
| 4378 | names will be shown regardless of <code>--abbrev</code>. |
| 4379 | 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] | 4380 | </p> |
| 4381 | </dd> |
| 4382 | <dt class="hdlist1"> |
| 4383 | -B[<n>][/<m>] |
| 4384 | </dt> |
| 4385 | <dt class="hdlist1"> |
| 4386 | --break-rewrites[=[<n>][/<m>]] |
| 4387 | </dt> |
| 4388 | <dd> |
| 4389 | <p> |
| 4390 | Break complete rewrite changes into pairs of delete and |
| 4391 | create. This serves two purposes: |
| 4392 | </p> |
| 4393 | <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file |
| 4394 | not as a series of deletion and insertion mixed together with a very |
| 4395 | few lines that happen to match textually as the context, but as a |
| 4396 | single deletion of everything old followed by a single insertion of |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4397 | everything new, and the number <code>m</code> controls this aspect of the -B |
| 4398 | 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] | 4399 | 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] | 4400 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 4401 | deletion and insertion mixed together with context lines).</p></div> |
| 4402 | <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the |
| 4403 | source of a rename (usually -M only considers a file that disappeared |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4404 | as the source of a rename), and the number <code>n</code> controls this aspect of |
| 4405 | 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] | 4406 | addition and deletion compared to 20% or more of the file’s size are |
| 4407 | eligible for being picked up as a possible source of a rename to |
| 4408 | another file.</p></div> |
| 4409 | </dd> |
| 4410 | <dt class="hdlist1"> |
| 4411 | -M[<n>] |
| 4412 | </dt> |
| 4413 | <dt class="hdlist1"> |
| 4414 | --find-renames[=<n>] |
| 4415 | </dt> |
| 4416 | <dd> |
| 4417 | <p> |
| 4418 | If generating diffs, detect and report renames for each commit. |
| 4419 | For following files across renames while traversing history, see |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4420 | <code>--follow</code>. |
| 4421 | 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] | 4422 | index (i.e. amount of addition/deletions compared to the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4423 | 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] | 4424 | 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] | 4425 | hasn’t changed. Without a <code>%</code> sign, the number is to be read as |
| 4426 | a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes |
| 4427 | 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is |
| 4428 | the same as <code>-M5%</code>. To limit detection to exact renames, use |
| 4429 | <code>-M100%</code>. The default similarity index is 50%. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4430 | </p> |
| 4431 | </dd> |
| 4432 | <dt class="hdlist1"> |
| 4433 | -C[<n>] |
| 4434 | </dt> |
| 4435 | <dt class="hdlist1"> |
| 4436 | --find-copies[=<n>] |
| 4437 | </dt> |
| 4438 | <dd> |
| 4439 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4440 | Detect copies as well as renames. See also <code>--find-copies-harder</code>. |
| 4441 | 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] | 4442 | </p> |
| 4443 | </dd> |
| 4444 | <dt class="hdlist1"> |
| 4445 | --find-copies-harder |
| 4446 | </dt> |
| 4447 | <dd> |
| 4448 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4449 | For performance reasons, by default, <code>-C</code> option finds copies only |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4450 | if the original file of the copy was modified in the same |
| 4451 | changeset. This flag makes the command |
| 4452 | inspect unmodified files as candidates for the source of |
| 4453 | copy. This is a very expensive operation for large |
| 4454 | projects, so use it with caution. Giving more than one |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4455 | <code>-C</code> option has the same effect. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4456 | </p> |
| 4457 | </dd> |
| 4458 | <dt class="hdlist1"> |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 4459 | -D |
| 4460 | </dt> |
| 4461 | <dt class="hdlist1"> |
| 4462 | --irreversible-delete |
| 4463 | </dt> |
| 4464 | <dd> |
| 4465 | <p> |
| 4466 | 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] | 4467 | the diff between the preimage and <code>/dev/null</code>. The resulting patch |
| 4468 | 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] | 4469 | solely for people who want to just concentrate on reviewing the |
| Junio C Hamano | d16fd1b | 2017-08-04 16:41:51 | [diff] [blame] | 4470 | text after the change. In addition, the output obviously lacks |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 4471 | enough information to apply such a patch in reverse, even manually, |
| 4472 | hence the name of the option. |
| 4473 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4474 | <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] | 4475 | of a delete/create pair.</p></div> |
| 4476 | </dd> |
| 4477 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4478 | -l<num> |
| 4479 | </dt> |
| 4480 | <dd> |
| 4481 | <p> |
| Junio C Hamano | 20cf493 | 2021-07-28 21:02:52 | [diff] [blame] | 4482 | The <code>-M</code> and <code>-C</code> options involve some preliminary steps that |
| 4483 | can detect subsets of renames/copies cheaply, followed by an |
| 4484 | exhaustive fallback portion that compares all remaining |
| 4485 | unpaired destinations to all relevant sources. (For renames, |
| 4486 | only remaining unpaired sources are relevant; for copies, all |
| 4487 | original sources are relevant.) For N sources and |
| 4488 | destinations, this exhaustive check is O(N^2). This option |
| 4489 | prevents the exhaustive portion of rename/copy detection from |
| 4490 | running if the number of source/destination files involved |
| 4491 | exceeds the specified number. Defaults to diff.renameLimit. |
| 4492 | Note that a value of 0 is treated as unlimited. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4493 | </p> |
| 4494 | </dd> |
| 4495 | <dt class="hdlist1"> |
| 4496 | --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] |
| 4497 | </dt> |
| 4498 | <dd> |
| 4499 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4500 | Select only files that are Added (<code>A</code>), Copied (<code>C</code>), |
| 4501 | Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their |
| 4502 | type (i.e. regular file, symlink, submodule, …) changed (<code>T</code>), |
| 4503 | are Unmerged (<code>U</code>), are |
| 4504 | 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] | 4505 | Any combination of the filter characters (including none) can be used. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4506 | When <code>*</code> (All-or-none) is added to the combination, all |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4507 | paths are selected if there is any file that matches |
| 4508 | other criteria in the comparison; if there is no file |
| 4509 | that matches other criteria, nothing is selected. |
| 4510 | </p> |
| Junio C Hamano | eed15af | 2016-07-25 22:49:42 | [diff] [blame] | 4511 | <div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g. |
| 4512 | <code>--diff-filter=ad</code> excludes added and deleted paths.</p></div> |
| Junio C Hamano | f1fc6ca | 2022-02-17 01:32:33 | [diff] [blame] | 4513 | <div class="paragraph"><p>Note that not all diffs can feature all types. For instance, copied and |
| 4514 | renamed entries cannot appear if detection for those types is disabled.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4515 | </dd> |
| 4516 | <dt class="hdlist1"> |
| 4517 | -S<string> |
| 4518 | </dt> |
| 4519 | <dd> |
| 4520 | <p> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4521 | Look for differences that change the number of occurrences of |
| 4522 | the specified string (i.e. addition/deletion) in a file. |
| 4523 | Intended for the scripter’s use. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4524 | </p> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4525 | <div class="paragraph"><p>It is useful when you’re looking for an exact block of code (like a |
| 4526 | struct), and want to know the history of that block since it first |
| 4527 | came into being: use the feature iteratively to feed the interesting |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4528 | 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] | 4529 | very first version of the block.</p></div> |
| Junio C Hamano | ace33e4 | 2019-01-18 23:16:05 | [diff] [blame] | 4530 | <div class="paragraph"><p>Binary files are searched as well.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4531 | </dd> |
| 4532 | <dt class="hdlist1"> |
| 4533 | -G<regex> |
| 4534 | </dt> |
| 4535 | <dd> |
| 4536 | <p> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4537 | Look for differences whose patch text contains added/removed |
| 4538 | lines that match <regex>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4539 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4540 | <div class="paragraph"><p>To illustrate the difference between <code>-S<regex> --pickaxe-regex</code> and |
| 4541 | <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] | 4542 | file:</p></div> |
| 4543 | <div class="listingblock"> |
| 4544 | <div class="content"> |
| Junio C Hamano | b7e497f | 2020-02-12 21:41:37 | [diff] [blame] | 4545 | <pre><code>+ return frotz(nitfol, two->ptr, 1, 0); |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4546 | ... |
| Junio C Hamano | b7e497f | 2020-02-12 21:41:37 | [diff] [blame] | 4547 | - hit = frotz(nitfol, mf2.ptr, 1, 0);</code></pre> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4548 | </div></div> |
| Junio C Hamano | b7e497f | 2020-02-12 21:41:37 | [diff] [blame] | 4549 | <div class="paragraph"><p>While <code>git log -G"frotz\(nitfol"</code> will show this commit, <code>git log |
| 4550 | -S"frotz\(nitfol" --pickaxe-regex</code> will not (because the number of |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4551 | occurrences of that string did not change).</p></div> |
| Junio C Hamano | ace33e4 | 2019-01-18 23:16:05 | [diff] [blame] | 4552 | <div class="paragraph"><p>Unless <code>--text</code> is supplied patches of binary files without a textconv |
| 4553 | filter will be ignored.</p></div> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 4554 | <div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more |
| 4555 | information.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4556 | </dd> |
| 4557 | <dt class="hdlist1"> |
| Junio C Hamano | 7b9cce9 | 2018-01-23 22:34:27 | [diff] [blame] | 4558 | --find-object=<object-id> |
| 4559 | </dt> |
| 4560 | <dd> |
| 4561 | <p> |
| 4562 | Look for differences that change the number of occurrences of |
| 4563 | the specified object. Similar to <code>-S</code>, just the argument is different |
| 4564 | in that it doesn’t search for a specific string but for a specific |
| 4565 | object id. |
| 4566 | </p> |
| 4567 | <div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in |
| 4568 | <code>git-log</code> to also find trees.</p></div> |
| 4569 | </dd> |
| 4570 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4571 | --pickaxe-all |
| 4572 | </dt> |
| 4573 | <dd> |
| 4574 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4575 | 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] | 4576 | changeset, not just the files that contain the change |
| 4577 | in <string>. |
| 4578 | </p> |
| 4579 | </dd> |
| 4580 | <dt class="hdlist1"> |
| 4581 | --pickaxe-regex |
| 4582 | </dt> |
| 4583 | <dd> |
| 4584 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4585 | 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] | 4586 | expression to match. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4587 | </p> |
| 4588 | </dd> |
| 4589 | <dt class="hdlist1"> |
| 4590 | -O<orderfile> |
| 4591 | </dt> |
| 4592 | <dd> |
| 4593 | <p> |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 4594 | Control the order in which files appear in the output. |
| Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 4595 | This overrides the <code>diff.orderFile</code> configuration variable |
| 4596 | (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] | 4597 | use <code>-O/dev/null</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4598 | </p> |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 4599 | <div class="paragraph"><p>The output order is determined by the order of glob patterns in |
| 4600 | <orderfile>. |
| 4601 | All files with pathnames that match the first pattern are output |
| 4602 | first, all files with pathnames that match the second pattern (but not |
| 4603 | the first) are output next, and so on. |
| 4604 | All files with pathnames that do not match any pattern are output |
| 4605 | last, as if there was an implicit match-all pattern at the end of the |
| 4606 | file. |
| 4607 | If multiple pathnames have the same rank (they match the same pattern |
| 4608 | but no earlier patterns), their output order relative to each other is |
| 4609 | the normal order.</p></div> |
| 4610 | <div class="paragraph"><p><orderfile> is parsed as follows:</p></div> |
| 4611 | <div class="openblock"> |
| 4612 | <div class="content"> |
| 4613 | <div class="ulist"><ul> |
| 4614 | <li> |
| 4615 | <p> |
| 4616 | Blank lines are ignored, so they can be used as separators for |
| 4617 | readability. |
| 4618 | </p> |
| 4619 | </li> |
| 4620 | <li> |
| 4621 | <p> |
| 4622 | Lines starting with a hash ("<code>#</code>") are ignored, so they can be used |
| 4623 | for comments. Add a backslash ("<code>\</code>") to the beginning of the |
| 4624 | pattern if it starts with a hash. |
| 4625 | </p> |
| 4626 | </li> |
| 4627 | <li> |
| 4628 | <p> |
| 4629 | Each other line contains a single pattern. |
| 4630 | </p> |
| 4631 | </li> |
| 4632 | </ul></div> |
| 4633 | </div></div> |
| 4634 | <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] | 4635 | fnmatch(3) without the FNM_PATHNAME flag, except a pathname also |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 4636 | matches a pattern if removing any number of the final pathname |
| 4637 | components matches the pattern. For example, the pattern "<code>foo*bar</code>" |
| 4638 | 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] | 4639 | </dd> |
| 4640 | <dt class="hdlist1"> |
| Junio C Hamano | a372d5b | 2021-02-26 01:34:37 | [diff] [blame] | 4641 | --skip-to=<file> |
| 4642 | </dt> |
| 4643 | <dt class="hdlist1"> |
| 4644 | --rotate-to=<file> |
| 4645 | </dt> |
| 4646 | <dd> |
| 4647 | <p> |
| 4648 | Discard the files before the named <file> from the output |
| 4649 | (i.e. <em>skip to</em>), or move them to the end of the output |
| 4650 | (i.e. <em>rotate to</em>). These were invented primarily for use |
| 4651 | of the <code>git difftool</code> command, and may not be very useful |
| 4652 | otherwise. |
| 4653 | </p> |
| 4654 | </dd> |
| 4655 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4656 | -R |
| 4657 | </dt> |
| 4658 | <dd> |
| 4659 | <p> |
| 4660 | Swap two inputs; that is, show differences from index or |
| 4661 | on-disk file to tree contents. |
| 4662 | </p> |
| 4663 | </dd> |
| 4664 | <dt class="hdlist1"> |
| 4665 | --relative[=<path>] |
| 4666 | </dt> |
| Junio C Hamano | 3ef9e67 | 2020-06-02 21:51:31 | [diff] [blame] | 4667 | <dt class="hdlist1"> |
| 4668 | --no-relative |
| 4669 | </dt> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4670 | <dd> |
| 4671 | <p> |
| 4672 | When run from a subdirectory of the project, it can be |
| 4673 | told to exclude changes outside the directory and show |
| 4674 | pathnames relative to it with this option. When you are |
| 4675 | not in a subdirectory (e.g. in a bare repository), you |
| 4676 | can name which subdirectory to make the output relative |
| 4677 | to by giving a <path> as an argument. |
| Junio C Hamano | 3ef9e67 | 2020-06-02 21:51:31 | [diff] [blame] | 4678 | <code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config |
| 4679 | option and previous <code>--relative</code>. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4680 | </p> |
| 4681 | </dd> |
| 4682 | <dt class="hdlist1"> |
| 4683 | -a |
| 4684 | </dt> |
| 4685 | <dt class="hdlist1"> |
| 4686 | --text |
| 4687 | </dt> |
| 4688 | <dd> |
| 4689 | <p> |
| 4690 | Treat all files as text. |
| 4691 | </p> |
| 4692 | </dd> |
| 4693 | <dt class="hdlist1"> |
| Junio C Hamano | 4886c77 | 2017-11-27 03:33:28 | [diff] [blame] | 4694 | --ignore-cr-at-eol |
| 4695 | </dt> |
| 4696 | <dd> |
| 4697 | <p> |
| Junio C Hamano | 96153bf | 2018-04-25 08:25:34 | [diff] [blame] | 4698 | Ignore carriage-return at the end of line when doing a comparison. |
| Junio C Hamano | 4886c77 | 2017-11-27 03:33:28 | [diff] [blame] | 4699 | </p> |
| 4700 | </dd> |
| 4701 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4702 | --ignore-space-at-eol |
| 4703 | </dt> |
| 4704 | <dd> |
| 4705 | <p> |
| 4706 | Ignore changes in whitespace at EOL. |
| 4707 | </p> |
| 4708 | </dd> |
| 4709 | <dt class="hdlist1"> |
| 4710 | -b |
| 4711 | </dt> |
| 4712 | <dt class="hdlist1"> |
| 4713 | --ignore-space-change |
| 4714 | </dt> |
| 4715 | <dd> |
| 4716 | <p> |
| 4717 | Ignore changes in amount of whitespace. This ignores whitespace |
| 4718 | at line end, and considers all other sequences of one or |
| 4719 | more whitespace characters to be equivalent. |
| 4720 | </p> |
| 4721 | </dd> |
| 4722 | <dt class="hdlist1"> |
| 4723 | -w |
| 4724 | </dt> |
| 4725 | <dt class="hdlist1"> |
| 4726 | --ignore-all-space |
| 4727 | </dt> |
| 4728 | <dd> |
| 4729 | <p> |
| 4730 | Ignore whitespace when comparing lines. This ignores |
| 4731 | differences even if one line has whitespace where the other |
| 4732 | line has none. |
| 4733 | </p> |
| 4734 | </dd> |
| 4735 | <dt class="hdlist1"> |
| Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 4736 | --ignore-blank-lines |
| 4737 | </dt> |
| 4738 | <dd> |
| 4739 | <p> |
| 4740 | Ignore changes whose lines are all blank. |
| 4741 | </p> |
| 4742 | </dd> |
| 4743 | <dt class="hdlist1"> |
| Junio C Hamano | df3d3cd | 2020-11-02 22:05:05 | [diff] [blame] | 4744 | -I<regex> |
| 4745 | </dt> |
| 4746 | <dt class="hdlist1"> |
| 4747 | --ignore-matching-lines=<regex> |
| 4748 | </dt> |
| 4749 | <dd> |
| 4750 | <p> |
| 4751 | Ignore changes whose all lines match <regex>. This option may |
| 4752 | be specified more than once. |
| 4753 | </p> |
| 4754 | </dd> |
| 4755 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4756 | --inter-hunk-context=<lines> |
| 4757 | </dt> |
| 4758 | <dd> |
| 4759 | <p> |
| 4760 | Show the context between diff hunks, up to the specified number |
| 4761 | of lines, thereby fusing hunks that are close to each other. |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 4762 | Defaults to <code>diff.interHunkContext</code> or 0 if the config option |
| 4763 | is unset. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4764 | </p> |
| 4765 | </dd> |
| 4766 | <dt class="hdlist1"> |
| Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 4767 | -W |
| 4768 | </dt> |
| 4769 | <dt class="hdlist1"> |
| 4770 | --function-context |
| 4771 | </dt> |
| 4772 | <dd> |
| 4773 | <p> |
| Junio C Hamano | b7676d5 | 2020-11-18 22:15:08 | [diff] [blame] | 4774 | Show whole function as context lines for each change. |
| 4775 | The function names are determined in the same way as |
| 4776 | <code>git diff</code> works out patch hunk headers (see <em>Defining a |
| 4777 | custom hunk-header</em> in <a href="gitattributes.html">gitattributes(5)</a>). |
| Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 4778 | </p> |
| 4779 | </dd> |
| 4780 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4781 | --ext-diff |
| 4782 | </dt> |
| 4783 | <dd> |
| 4784 | <p> |
| 4785 | Allow an external diff helper to be executed. If you set an |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4786 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 4787 | 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] | 4788 | </p> |
| 4789 | </dd> |
| 4790 | <dt class="hdlist1"> |
| 4791 | --no-ext-diff |
| 4792 | </dt> |
| 4793 | <dd> |
| 4794 | <p> |
| 4795 | Disallow external diff drivers. |
| 4796 | </p> |
| 4797 | </dd> |
| 4798 | <dt class="hdlist1"> |
| Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 4799 | --textconv |
| 4800 | </dt> |
| 4801 | <dt class="hdlist1"> |
| 4802 | --no-textconv |
| 4803 | </dt> |
| 4804 | <dd> |
| 4805 | <p> |
| 4806 | Allow (or disallow) external text conversion filters to be run |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4807 | 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] | 4808 | details. Because textconv filters are typically a one-way |
| 4809 | conversion, the resulting diff is suitable for human |
| 4810 | consumption, but cannot be applied. For this reason, textconv |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4811 | filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and |
| 4812 | <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] | 4813 | diff plumbing commands. |
| 4814 | </p> |
| 4815 | </dd> |
| 4816 | <dt class="hdlist1"> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4817 | --ignore-submodules[=<when>] |
| 4818 | </dt> |
| 4819 | <dd> |
| 4820 | <p> |
| 4821 | Ignore changes to submodules in the diff generation. <when> can be |
| Junio C Hamano | c710296 | 2013-05-29 23:57:17 | [diff] [blame] | 4822 | either "none", "untracked", "dirty" or "all", which is the default. |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4823 | Using "none" will consider the submodule modified when it either contains |
| 4824 | untracked or modified files or its HEAD differs from the commit recorded |
| 4825 | 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] | 4826 | <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] | 4827 | "untracked" is used submodules are not considered dirty when they only |
| 4828 | contain untracked content (but they are still scanned for modified |
| 4829 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 4830 | only changes to the commits stored in the superproject are shown (this was |
| 4831 | the behavior until 1.7.0). Using "all" hides all changes to submodules. |
| 4832 | </p> |
| 4833 | </dd> |
| 4834 | <dt class="hdlist1"> |
| 4835 | --src-prefix=<prefix> |
| 4836 | </dt> |
| 4837 | <dd> |
| 4838 | <p> |
| 4839 | Show the given source prefix instead of "a/". |
| 4840 | </p> |
| 4841 | </dd> |
| 4842 | <dt class="hdlist1"> |
| 4843 | --dst-prefix=<prefix> |
| 4844 | </dt> |
| 4845 | <dd> |
| 4846 | <p> |
| 4847 | Show the given destination prefix instead of "b/". |
| 4848 | </p> |
| 4849 | </dd> |
| 4850 | <dt class="hdlist1"> |
| 4851 | --no-prefix |
| 4852 | </dt> |
| 4853 | <dd> |
| 4854 | <p> |
| 4855 | Do not show any source or destination prefix. |
| 4856 | </p> |
| 4857 | </dd> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 4858 | <dt class="hdlist1"> |
| 4859 | --line-prefix=<prefix> |
| 4860 | </dt> |
| 4861 | <dd> |
| 4862 | <p> |
| 4863 | Prepend an additional prefix to every line of output. |
| 4864 | </p> |
| 4865 | </dd> |
| Junio C Hamano | f7017f1 | 2016-10-27 23:31:34 | [diff] [blame] | 4866 | <dt class="hdlist1"> |
| 4867 | --ita-invisible-in-index |
| 4868 | </dt> |
| 4869 | <dd> |
| 4870 | <p> |
| 4871 | By default entries added by "git add -N" appear as an existing |
| 4872 | empty file in "git diff" and a new file in "git diff --cached". |
| 4873 | This option makes the entry appear as a new file in "git diff" |
| 4874 | and non-existent in "git diff --cached". This option could be |
| 4875 | reverted with <code>--ita-visible-in-index</code>. Both options are |
| 4876 | experimental and could be removed in future. |
| 4877 | </p> |
| 4878 | </dd> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4879 | </dl></div> |
| 4880 | <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] | 4881 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
| Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 4882 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4883 | </div> |
| 4884 | <div class="sect1"> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4885 | <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] | 4886 | <div class="sectionbody"> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4887 | <div class="paragraph"><p>Running |
| 4888 | <a href="git-diff.html">git-diff(1)</a>, |
| 4889 | <a href="git-log.html">git-log(1)</a>, |
| 4890 | <a href="git-show.html">git-show(1)</a>, |
| 4891 | <a href="git-diff-index.html">git-diff-index(1)</a>, |
| 4892 | <a href="git-diff-tree.html">git-diff-tree(1)</a>, or |
| 4893 | <a href="git-diff-files.html">git-diff-files(1)</a> |
| 4894 | with the <code>-p</code> option produces patch text. |
| 4895 | You can customize the creation of patch text via the |
| Junio C Hamano | 558abd2 | 2020-09-03 20:22:34 | [diff] [blame] | 4896 | <code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables |
| Junio C Hamano | be601db | 2021-05-07 04:20:28 | [diff] [blame] | 4897 | (see <a href="git.html">git(1)</a>), and the <code>diff</code> attribute (see <a href="gitattributes.html">gitattributes(5)</a>).</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4898 | <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] | 4899 | diff format:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4900 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4901 | <li> |
| 4902 | <p> |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4903 | It is preceded with a "git diff" header that looks like this: |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4904 | </p> |
| 4905 | <div class="literalblock"> |
| 4906 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4907 | <pre><code>diff --git a/file1 b/file2</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4908 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4909 | <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] | 4910 | involved. Especially, even for a creation or a deletion, |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4911 | <code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div> |
| 4912 | <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] | 4913 | 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] | 4914 | the file that rename/copy produces, respectively.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4915 | </li> |
| 4916 | <li> |
| 4917 | <p> |
| 4918 | It is followed by one or more extended header lines: |
| 4919 | </p> |
| 4920 | <div class="literalblock"> |
| 4921 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4922 | <pre><code>old mode <mode> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4923 | new mode <mode> |
| 4924 | deleted file mode <mode> |
| 4925 | new file mode <mode> |
| 4926 | copy from <path> |
| 4927 | copy to <path> |
| 4928 | rename from <path> |
| 4929 | rename to <path> |
| 4930 | similarity index <number> |
| 4931 | dissimilarity index <number> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4932 | index <hash>..<hash> <mode></code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4933 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4934 | <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] | 4935 | and file permission bits.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4936 | <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] | 4937 | <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] | 4938 | the dissimilarity index is the percentage of changed lines. It |
| 4939 | is a rounded down integer, followed by a percent sign. The |
| 4940 | similarity index value of 100% is thus reserved for two equal |
| 4941 | files, while 100% dissimilarity means that no line from the old |
| 4942 | file made it into the new one.</p></div> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4943 | <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] | 4944 | The <mode> is included if the file mode does not change; otherwise, |
| 4945 | separate lines indicate the old and the new mode.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4946 | </li> |
| 4947 | <li> |
| 4948 | <p> |
| Junio C Hamano | 0f6f3bf | 2017-03-13 07:01:53 | [diff] [blame] | 4949 | Pathnames with "unusual" characters are quoted as explained for |
| 4950 | the configuration variable <code>core.quotePath</code> (see |
| 4951 | <a href="git-config.html">git-config(1)</a>). |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4952 | </p> |
| 4953 | </li> |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4954 | <li> |
| 4955 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4956 | All the <code>file1</code> files in the output refer to files before the |
| 4957 | 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] | 4958 | It is incorrect to apply each change to each file sequentially. For |
| 4959 | example, this patch will swap a and b: |
| 4960 | </p> |
| 4961 | <div class="literalblock"> |
| 4962 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4963 | <pre><code>diff --git a/a b/b |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4964 | rename from a |
| 4965 | rename to b |
| 4966 | diff --git a/b b/a |
| 4967 | rename from b |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4968 | rename to a</code></pre> |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 4969 | </div></div> |
| 4970 | </li> |
| Junio C Hamano | be601db | 2021-05-07 04:20:28 | [diff] [blame] | 4971 | <li> |
| 4972 | <p> |
| 4973 | Hunk headers mention the name of the function to which the hunk |
| 4974 | applies. See "Defining a custom hunk-header" in |
| 4975 | <a href="gitattributes.html">gitattributes(5)</a> for details of how to tailor to this to |
| 4976 | specific languages. |
| 4977 | </p> |
| 4978 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4979 | </ol></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4980 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4981 | </div> |
| 4982 | <div class="sect1"> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4983 | <h2 id="_combined_diff_format">Combined diff format</h2> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4984 | <div class="sectionbody"> |
| Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 4985 | <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] | 4986 | 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] | 4987 | format when showing merges with <a href="git-diff.html">git-diff(1)</a> or |
| Junio C Hamano | 8c860d6 | 2021-02-06 01:37:47 | [diff] [blame] | 4988 | <a href="git-show.html">git-show(1)</a>. Note also that you can give suitable |
| 4989 | <code>--diff-merges</code> option to any of these commands to force generation of |
| 4990 | diffs in specific format.</p></div> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 4991 | <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] | 4992 | <div class="listingblock"> |
| 4993 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4994 | <pre><code>diff --combined describe.c |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 4995 | index fabadb8,cc95eb0..4866510 |
| 4996 | --- a/describe.c |
| 4997 | +++ b/describe.c |
| 4998 | @@@ -98,20 -98,12 +98,20 @@@ |
| 4999 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
| 5000 | } |
| 5001 | |
| 5002 | - static void describe(char *arg) |
| 5003 | -static void describe(struct commit *cmit, int last_one) |
| 5004 | ++static void describe(char *arg, int last_one) |
| 5005 | { |
| 5006 | + unsigned char sha1[20]; |
| 5007 | + struct commit *cmit; |
| 5008 | struct commit_list *list; |
| 5009 | static int initialized = 0; |
| 5010 | struct commit_name *n; |
| 5011 | |
| 5012 | + if (get_sha1(arg, sha1) < 0) |
| 5013 | + usage(describe_usage); |
| 5014 | + cmit = lookup_commit_reference(sha1); |
| 5015 | + if (!cmit) |
| 5016 | + usage(describe_usage); |
| 5017 | + |
| 5018 | if (!initialized) { |
| 5019 | initialized = 1; |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5020 | for_each_ref(get_name);</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5021 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5022 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5023 | <li> |
| 5024 | <p> |
| 5025 | It is preceded with a "git diff" header, that looks like |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 5026 | this (when the <code>-c</code> option is used): |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5027 | </p> |
| 5028 | <div class="literalblock"> |
| 5029 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5030 | <pre><code>diff --combined file</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5031 | </div></div> |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 5032 | <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] | 5033 | <div class="literalblock"> |
| 5034 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5035 | <pre><code>diff --cc file</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5036 | </div></div> |
| 5037 | </li> |
| 5038 | <li> |
| 5039 | <p> |
| 5040 | It is followed by one or more extended header lines |
| 5041 | (this example shows a merge with two parents): |
| 5042 | </p> |
| 5043 | <div class="literalblock"> |
| 5044 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5045 | <pre><code>index <hash>,<hash>..<hash> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5046 | mode <mode>,<mode>..<mode> |
| 5047 | new file mode <mode> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5048 | deleted file mode <mode>,<mode></code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5049 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5050 | <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] | 5051 | the <mode> is different from the rest. Extended headers with |
| 5052 | information about detected contents movement (renames and |
| 5053 | copying detection) are designed to work with diff of two |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5054 | <tree-ish> and are not used by combined diff format.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5055 | </li> |
| 5056 | <li> |
| 5057 | <p> |
| 5058 | It is followed by two-line from-file/to-file header |
| 5059 | </p> |
| 5060 | <div class="literalblock"> |
| 5061 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5062 | <pre><code>--- a/file |
| 5063 | +++ b/file</code></pre> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5064 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5065 | <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] | 5066 | format, <code>/dev/null</code> is used to signal created or deleted |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5067 | files.</p></div> |
| Junio C Hamano | 11f1537 | 2019-03-07 03:17:00 | [diff] [blame] | 5068 | <div class="paragraph"><p>However, if the --combined-all-paths option is provided, instead of a |
| 5069 | two-line from-file/to-file you get a N+1 line from-file/to-file header, |
| 5070 | where N is the number of parents in the merge commit</p></div> |
| 5071 | <div class="literalblock"> |
| 5072 | <div class="content"> |
| 5073 | <pre><code>--- a/file |
| 5074 | --- a/file |
| 5075 | --- a/file |
| 5076 | +++ b/file</code></pre> |
| 5077 | </div></div> |
| 5078 | <div class="paragraph"><p>This extended format can be useful if rename or copy detection is |
| 5079 | active, to allow you to see the original name of the file in different |
| 5080 | parents.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5081 | </li> |
| 5082 | <li> |
| 5083 | <p> |
| 5084 | Chunk header format is modified to prevent people from |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5085 | accidentally feeding it to <code>patch -p1</code>. Combined diff format |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5086 | was created for review of merge commit changes, and was not |
| Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 5087 | 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] | 5088 | extended <em>index</em> header: |
| 5089 | </p> |
| 5090 | <div class="literalblock"> |
| 5091 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5092 | <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] | 5093 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5094 | <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] | 5095 | header for combined diff format.</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5096 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5097 | </ol></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5098 | <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] | 5099 | 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 |
| 5100 | added to B), or <code>" "</code> (space — unchanged) prefix, this format |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5101 | compares two or more files file1, file2,… with one file X, and |
| 5102 | 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] | 5103 | 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] | 5104 | different from it.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5105 | <div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in |
| 5106 | 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] | 5107 | in the column N means that the line appears in the result, |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5108 | 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] | 5109 | added, from the point of view of that parent).</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5110 | <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] | 5111 | from both files (hence two <code>-</code> removals from both file1 and |
| 5112 | 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] | 5113 | in either file1 or file2). Also eight other lines are the same |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5114 | from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div> |
| 5115 | <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] | 5116 | merge commit with the merge result (i.e. file1..fileN are the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5117 | 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] | 5118 | two unresolved merge parents with the working tree file |
| 5119 | (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] | 5120 | "their version").</p></div> |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 5121 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5122 | </div> |
| 5123 | <div class="sect1"> |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 5124 | <h2 id="_examples">EXAMPLES</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5125 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5126 | <div class="dlist"><dl> |
| 5127 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5128 | <code>git log --no-merges</code> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5129 | </dt> |
| 5130 | <dd> |
| 5131 | <p> |
| 5132 | Show the whole commit history, but skip any merges |
| 5133 | </p> |
| 5134 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5135 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5136 | <code>git log v2.6.12.. include/scsi drivers/scsi</code> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5137 | </dt> |
| 5138 | <dd> |
| 5139 | <p> |
| 5140 | 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] | 5141 | in the <code>include/scsi</code> or <code>drivers/scsi</code> subdirectories |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5142 | </p> |
| 5143 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5144 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5145 | <code>git log --since="2 weeks ago" -- gitk</code> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5146 | </dt> |
| 5147 | <dd> |
| 5148 | <p> |
| 5149 | 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] | 5150 | 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] | 5151 | <em>gitk</em> |
| 5152 | </p> |
| 5153 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5154 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5155 | <code>git log --name-status release..test</code> |
| Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 5156 | </dt> |
| 5157 | <dd> |
| 5158 | <p> |
| 5159 | Show the commits that are in the "test" branch but not yet |
| 5160 | in the "release" branch, along with the list of paths |
| 5161 | each commit modifies. |
| 5162 | </p> |
| 5163 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5164 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5165 | <code>git log --follow builtin/rev-list.c</code> |
| Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 5166 | </dt> |
| 5167 | <dd> |
| 5168 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5169 | Shows the commits that changed <code>builtin/rev-list.c</code>, including |
| Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 5170 | those commits that occurred before the file was given its |
| 5171 | present name. |
| 5172 | </p> |
| 5173 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5174 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5175 | <code>git log --branches --not --remotes=origin</code> |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 5176 | </dt> |
| 5177 | <dd> |
| 5178 | <p> |
| 5179 | 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] | 5180 | 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] | 5181 | origin doesn’t). |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 5182 | </p> |
| 5183 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5184 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5185 | <code>git log master --not --remotes=*/master</code> |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 5186 | </dt> |
| 5187 | <dd> |
| 5188 | <p> |
| 5189 | Shows all commits that are in local master but not in any remote |
| 5190 | repository master branches. |
| 5191 | </p> |
| 5192 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5193 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5194 | <code>git log -p -m --first-parent</code> |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 5195 | </dt> |
| 5196 | <dd> |
| 5197 | <p> |
| 5198 | Shows the history including change diffs, but only from the |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 5199 | “main branch” perspective, skipping commits that come from merged |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 5200 | branches, and showing full diffs of changes introduced by the merges. |
| 5201 | This makes sense only when following a strict policy of merging all |
| 5202 | topic branches when staying on a single integration branch. |
| 5203 | </p> |
| 5204 | </dd> |
| Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 5205 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5206 | <code>git log -L '/int main/',/^}/:main.c</code> |
| Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 5207 | </dt> |
| 5208 | <dd> |
| 5209 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5210 | 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] | 5211 | over time. |
| 5212 | </p> |
| 5213 | </dd> |
| 5214 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5215 | <code>git log -3</code> |
| Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 5216 | </dt> |
| 5217 | <dd> |
| 5218 | <p> |
| 5219 | Limits the number of commits to show to 3. |
| 5220 | </p> |
| 5221 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5222 | </dl></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5223 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5224 | </div> |
| 5225 | <div class="sect1"> |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 5226 | <h2 id="_discussion">DISCUSSION</h2> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5227 | <div class="sectionbody"> |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 5228 | <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] | 5229 | <div class="ulist"><ul> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5230 | <li> |
| 5231 | <p> |
| Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 5232 | The contents of the blob objects are uninterpreted sequences |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5233 | of bytes. There is no encoding translation at the core |
| 5234 | level. |
| 5235 | </p> |
| 5236 | </li> |
| 5237 | <li> |
| 5238 | <p> |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 5239 | Path names are encoded in UTF-8 normalization form C. This |
| 5240 | applies to tree objects, the index file, ref names, as well as |
| 5241 | path names in command line arguments, environment variables |
| 5242 | and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>), |
| 5243 | <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and |
| 5244 | <a href="gitmodules.html">gitmodules(5)</a>). |
| 5245 | </p> |
| 5246 | <div class="paragraph"><p>Note that Git at the core level treats path names simply as |
| 5247 | sequences of non-NUL bytes, there are no path name encoding |
| 5248 | conversions (except on Mac and Windows). Therefore, using |
| 5249 | non-ASCII path names will mostly work even on platforms and file |
| 5250 | systems that use legacy extended ASCII encodings. However, |
| 5251 | repositories created on such systems will not work properly on |
| 5252 | UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa. |
| 5253 | Additionally, many Git-based tools simply assume path names to |
| 5254 | be UTF-8 and will fail to display other encodings correctly.</p></div> |
| 5255 | </li> |
| 5256 | <li> |
| 5257 | <p> |
| 5258 | Commit log messages are typically encoded in UTF-8, but other |
| 5259 | extended ASCII encodings are also supported. This includes |
| 5260 | ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32, |
| 5261 | EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5, |
| 5262 | EUC-x, CP9xx etc.). |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5263 | </p> |
| 5264 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5265 | </ul></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5266 | <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] | 5267 | 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] | 5268 | force UTF-8 on projects. If all participants of a particular |
| Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 5269 | project find it more convenient to use legacy encodings, Git |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5270 | 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] | 5271 | mind.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5272 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5273 | <li> |
| 5274 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 5275 | <em>git commit</em> and <em>git commit-tree</em> issues |
| Junio C Hamano | 14b7648 | 2008-01-05 10:32:26 | [diff] [blame] | 5276 | 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] | 5277 | like a valid UTF-8 string, unless you explicitly say your |
| 5278 | project uses a legacy encoding. The way to say this is to |
| Junio C Hamano | a372d5b | 2021-02-26 01:34:37 | [diff] [blame] | 5279 | have <code>i18n.commitEncoding</code> in <code>.git/config</code> file, like this: |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5280 | </p> |
| 5281 | <div class="listingblock"> |
| 5282 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5283 | <pre><code>[i18n] |
| Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 5284 | commitEncoding = ISO-8859-1</code></pre> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5285 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5286 | <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] | 5287 | 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] | 5288 | help other people who look at them later. Lack of this header |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5289 | 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] | 5290 | </li> |
| 5291 | <li> |
| 5292 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 5293 | <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] | 5294 | <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] | 5295 | log message into UTF-8 unless otherwise specified. You can |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5296 | specify the desired output encoding with |
| Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 5297 | <code>i18n.logOutputEncoding</code> in <code>.git/config</code> file, like this: |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5298 | </p> |
| 5299 | <div class="listingblock"> |
| 5300 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5301 | <pre><code>[i18n] |
| Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 5302 | logOutputEncoding = ISO-8859-1</code></pre> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5303 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5304 | <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] | 5305 | <code>i18n.commitEncoding</code> is used instead.</p></div> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5306 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5307 | </ol></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5308 | <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] | 5309 | message when a commit is made to force UTF-8 at the commit |
| 5310 | object level, because re-coding to UTF-8 is not necessarily a |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5311 | reversible operation.</p></div> |
| Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 5312 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5313 | </div> |
| 5314 | <div class="sect1"> |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 5315 | <h2 id="_configuration">CONFIGURATION</h2> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5316 | <div class="sectionbody"> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 5317 | <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] | 5318 | for settings related to diff generation.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5319 | <div class="dlist"><dl> |
| 5320 | <dt class="hdlist1"> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5321 | format.pretty |
| 5322 | </dt> |
| 5323 | <dd> |
| 5324 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5325 | Default for the <code>--format</code> option. (See <em>Pretty Formats</em> above.) |
| 5326 | Defaults to <code>medium</code>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5327 | </p> |
| 5328 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5329 | <dt class="hdlist1"> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5330 | i18n.logOutputEncoding |
| 5331 | </dt> |
| 5332 | <dd> |
| 5333 | <p> |
| Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 5334 | Encoding to use when displaying logs. (See <em>Discussion</em> above.) |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5335 | 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] | 5336 | otherwise. |
| 5337 | </p> |
| 5338 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5339 | <dt class="hdlist1"> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5340 | log.date |
| 5341 | </dt> |
| 5342 | <dd> |
| 5343 | <p> |
| 5344 | Default format for human-readable dates. (Compare the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5345 | <code>--date</code> option.) Defaults to "default", which means to write |
| 5346 | dates like <code>Sat May 8 19:35:34 2010 -0500</code>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5347 | </p> |
| Junio C Hamano | 23168ef | 2019-02-07 07:20:47 | [diff] [blame] | 5348 | <div class="paragraph"><p>If the format is set to "auto:foo" and the pager is in use, format |
| 5349 | "foo" will be the used for the date format. Otherwise "default" will |
| 5350 | be used.</p></div> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5351 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5352 | <dt class="hdlist1"> |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 5353 | log.follow |
| 5354 | </dt> |
| 5355 | <dd> |
| 5356 | <p> |
| Junio C Hamano | b0a1e83 | 2015-10-15 23:08:31 | [diff] [blame] | 5357 | If <code>true</code>, <code>git log</code> will act as if the <code>--follow</code> option was used when |
| 5358 | a single <path> is given. This has the same limitations as <code>--follow</code>, |
| 5359 | i.e. it cannot be used to follow multiple files and does not work well |
| 5360 | on non-linear history. |
| Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 5361 | </p> |
| 5362 | </dd> |
| 5363 | <dt class="hdlist1"> |
| Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 5364 | log.showRoot |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5365 | </dt> |
| 5366 | <dd> |
| 5367 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5368 | 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] | 5369 | initial commit as a big creation event. Any root commits in |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5370 | <code>git log -p</code> output would be shown without a diff attached. |
| 5371 | The default is <code>true</code>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5372 | </p> |
| 5373 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5374 | <dt class="hdlist1"> |
| Junio C Hamano | 48931e2 | 2016-07-11 20:08:47 | [diff] [blame] | 5375 | log.showSignature |
| 5376 | </dt> |
| 5377 | <dd> |
| 5378 | <p> |
| 5379 | If <code>true</code>, <code>git log</code> and related commands will act as if the |
| 5380 | <code>--show-signature</code> option was passed to them. |
| 5381 | </p> |
| 5382 | </dd> |
| 5383 | <dt class="hdlist1"> |
| Junio C Hamano | abad6da | 2013-01-06 09:06:32 | [diff] [blame] | 5384 | mailmap.* |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5385 | </dt> |
| 5386 | <dd> |
| 5387 | <p> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 5388 | See <a href="git-shortlog.html">git-shortlog(1)</a>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5389 | </p> |
| 5390 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5391 | <dt class="hdlist1"> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5392 | notes.displayRef |
| 5393 | </dt> |
| 5394 | <dd> |
| 5395 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5396 | 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] | 5397 | 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] | 5398 | messages with the <code>log</code> family of commands. See |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 5399 | <a href="git-notes.html">git-notes(1)</a>. |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5400 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 5401 | <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] | 5402 | multiple times. A warning will be issued for refs that do not exist, |
| 5403 | 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] | 5404 | <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] | 5405 | overridden by the <code>GIT_NOTES_DISPLAY_REF</code> environment variable, |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 5406 | and overridden by the <code>--notes=<ref></code> option.</p></div> |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 5407 | </dd> |
| 5408 | </dl></div> |
| 5409 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5410 | </div> |
| 5411 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 5412 | <h2 id="_git">GIT</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5413 | <div class="sectionbody"> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 5414 | <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] | 5415 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 5416 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5417 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 5418 | <div id="footnotes"><hr /></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5419 | <div id="footer"> |
| 5420 | <div id="footer-text"> |
| Junio C Hamano | 2ef0ba3 | 2018-01-26 23:13:53 | [diff] [blame] | 5421 | Last updated |
| Junio C Hamano | 594d2d4 | 2022-08-30 17:58:50 | [diff] [blame^] | 5422 | 2022-08-30 10:56:31 PDT |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 5423 | </div> |
| 5424 | </div> |
| 5425 | </body> |
| 5426 | </html> |