Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | 9d97115 | 2012-12-19 00:43:11 | [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-fast-import(1)</title> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 9 | <style type="text/css"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 47 | } |
| 48 | |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 49 | h1, h2, h3, h4, h5, h6 { |
| 50 | color: #527bbd; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 57 | border-bottom: 2px solid silver; |
| 58 | } |
| 59 | h2 { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 68 | h5 { |
| 69 | font-size: 1.0em; |
| 70 | } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 71 | |
| 72 | div.sectionbody { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 88 | ul > li { color: #aaa; } |
| 89 | ul > li > * { color: black; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 90 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 91 | .monospaced, code, pre { |
| 92 | font-family: "Courier New", Courier, monospace; |
| 93 | font-size: inherit; |
| 94 | color: navy; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 95 | padding: 0; |
| 96 | margin: 0; |
| 97 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 98 | pre { |
| 99 | white-space: pre-wrap; |
| 100 | } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 101 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 102 | #author { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 103 | color: #527bbd; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 106 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 107 | #email { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 108 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 109 | #revnumber, #revdate, #revremark { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 110 | } |
| 111 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 112 | #footer { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 118 | #footer-text { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 119 | float: left; |
| 120 | padding-bottom: 0.5em; |
| 121 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 122 | #footer-badges { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 123 | float: right; |
| 124 | padding-bottom: 0.5em; |
| 125 | } |
| 126 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 131 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 172 | border: 1px solid #dddddd; |
| 173 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 174 | padding: 0.5em; |
| 175 | } |
| 176 | |
| 177 | div.listingblock > div.content { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 178 | border: 1px solid #dddddd; |
| 179 | border-left: 5px solid #f0f0f0; |
| 180 | background: #f8f8f8; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 188 | border-left: 5px solid #f0f0f0; |
| 189 | color: #888; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 194 | text-align: right; |
| 195 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 196 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 226 | } |
| 227 | |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 228 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 229 | span.image img { border-style: none; vertical-align: text-bottom; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 230 | a.image:visited { color: white; } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 271 | |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 294 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 295 | td.hdlist2 { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | 9d97115 | 2012-12-19 00:43:11 | [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 | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 341 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 342 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 351 | #toctitle { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 352 | color: #527bbd; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 353 | font-size: 1.1em; |
| 354 | font-weight: bold; |
| 355 | margin-top: 1.0em; |
| 356 | margin-bottom: 0.1em; |
| 357 | } |
| 358 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 359 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 360 | margin-top: 0; |
| 361 | margin-bottom: 0; |
| 362 | } |
| 363 | div.toclevel2 { |
| 364 | margin-left: 2em; |
| 365 | font-size: 0.9em; |
| 366 | } |
| 367 | div.toclevel3 { |
| 368 | margin-left: 4em; |
| 369 | font-size: 0.9em; |
| 370 | } |
| 371 | div.toclevel4 { |
| 372 | margin-left: 6em; |
| 373 | font-size: 0.9em; |
| 374 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 375 | |
| 376 | span.aqua { color: aqua; } |
| 377 | span.black { color: black; } |
| 378 | span.blue { color: blue; } |
| 379 | span.fuchsia { color: fuchsia; } |
| 380 | span.gray { color: gray; } |
| 381 | span.green { color: green; } |
| 382 | span.lime { color: lime; } |
| 383 | span.maroon { color: maroon; } |
| 384 | span.navy { color: navy; } |
| 385 | span.olive { color: olive; } |
| 386 | span.purple { color: purple; } |
| 387 | span.red { color: red; } |
| 388 | span.silver { color: silver; } |
| 389 | span.teal { color: teal; } |
| 390 | span.white { color: white; } |
| 391 | span.yellow { color: yellow; } |
| 392 | |
| 393 | span.aqua-background { background: aqua; } |
| 394 | span.black-background { background: black; } |
| 395 | span.blue-background { background: blue; } |
| 396 | span.fuchsia-background { background: fuchsia; } |
| 397 | span.gray-background { background: gray; } |
| 398 | span.green-background { background: green; } |
| 399 | span.lime-background { background: lime; } |
| 400 | span.maroon-background { background: maroon; } |
| 401 | span.navy-background { background: navy; } |
| 402 | span.olive-background { background: olive; } |
| 403 | span.purple-background { background: purple; } |
| 404 | span.red-background { background: red; } |
| 405 | span.silver-background { background: silver; } |
| 406 | span.teal-background { background: teal; } |
| 407 | span.white-background { background: white; } |
| 408 | span.yellow-background { background: yellow; } |
| 409 | |
| 410 | span.big { font-size: 2em; } |
| 411 | span.small { font-size: 0.6em; } |
| 412 | |
| 413 | span.underline { text-decoration: underline; } |
| 414 | span.overline { text-decoration: overline; } |
| 415 | span.line-through { text-decoration: line-through; } |
| 416 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 417 | div.unbreakable { page-break-inside: avoid; } |
| 418 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [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 | 9d97115 | 2012-12-19 00:43:11 | [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 | 9d97115 | 2012-12-19 00:43:11 | [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 | 9d97115 | 2012-12-19 00:43:11 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 535 | body.manpage div#toc { display: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 536 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 537 | |
| 538 | |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 731 | asciidoc.install(); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 732 | /*]]>*/ |
| 733 | </script> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 734 | </head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 735 | <body class="manpage"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 736 | <div id="header"> |
| 737 | <h1> |
| 738 | git-fast-import(1) Manual Page |
| 739 | </h1> |
| 740 | <h2>NAME</h2> |
| 741 | <div class="sectionbody"> |
| 742 | <p>git-fast-import - |
Junio C Hamano | 053827f | 2007-02-14 07:23:58 | [diff] [blame] | 743 | Backend for fast Git data importers |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 744 | </p> |
| 745 | </div> |
| 746 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 747 | <div id="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [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 | df60f44 | 2007-02-07 05:52:37 | [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 | c9cb517 | 2018-06-01 07:13:44 | [diff] [blame] | 752 | <pre class="content">frontend | <em>git fast-import</em> [<options>]</pre> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 753 | <div class="attribution"> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 754 | </div></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 755 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [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 | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 759 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 760 | <div class="paragraph"><p>This program is usually not what the end user wants to run directly. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 761 | Most end users want to use one of the existing frontend programs, |
| 762 | which parses a specific type of foreign source and feeds the contents |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 763 | stored there to <em>git fast-import</em>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 764 | <div class="paragraph"><p>fast-import reads a mixed command/data stream from standard input and |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 765 | writes one or more packfiles directly into the current repository. |
| 766 | When EOF is received on standard input, fast import writes out |
| 767 | updated branch and tag refs, fully updating the current repository |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 768 | with the newly imported data.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 769 | <div class="paragraph"><p>The fast-import backend itself can import into an empty repository (one that |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 770 | has already been initialized by <em>git init</em>) or incrementally |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 771 | update an existing populated repository. Whether or not incremental |
| 772 | imports are supported from a particular foreign source depends on |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 773 | the frontend program in use.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 774 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 775 | </div> |
| 776 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 777 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 778 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 779 | <div class="dlist"><dl> |
| 780 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 781 | --force |
| 782 | </dt> |
| 783 | <dd> |
| 784 | <p> |
| 785 | Force updating modified existing branches, even if doing |
| 786 | so would cause commits to be lost (as the new commit does |
| 787 | not contain the old commit). |
| 788 | </p> |
| 789 | </dd> |
| 790 | <dt class="hdlist1"> |
| 791 | --quiet |
| 792 | </dt> |
| 793 | <dd> |
| 794 | <p> |
Junio C Hamano | de48f45 | 2019-01-04 22:31:57 | [diff] [blame] | 795 | Disable the output shown by --stats, making fast-import usually |
| 796 | be silent when it is successful. However, if the import stream |
| 797 | has directives intended to show user output (e.g. <code>progress</code> |
| 798 | directives), the corresponding messages will still be shown. |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 799 | </p> |
| 800 | </dd> |
| 801 | <dt class="hdlist1"> |
| 802 | --stats |
| 803 | </dt> |
| 804 | <dd> |
| 805 | <p> |
| 806 | Display some basic statistics about the objects fast-import has |
| 807 | created, the packfiles they were stored into, and the |
| 808 | memory used by fast-import during this run. Showing this output |
| 809 | is currently the default, but can be disabled with --quiet. |
| 810 | </p> |
| 811 | </dd> |
Junio C Hamano | 59e8824 | 2019-12-10 14:09:04 | [diff] [blame] | 812 | <dt class="hdlist1"> |
| 813 | --allow-unsafe-features |
| 814 | </dt> |
| 815 | <dd> |
| 816 | <p> |
| 817 | Many command-line options can be provided as part of the |
| 818 | fast-import stream itself by using the <code>feature</code> or <code>option</code> |
| 819 | commands. However, some of these options are unsafe (e.g., |
| 820 | allowing fast-import to access the filesystem outside of the |
| 821 | repository). These options are disabled by default, but can be |
| 822 | allowed by providing this option on the command line. This |
| 823 | currently impacts only the <code>export-marks</code>, <code>import-marks</code>, and |
| 824 | <code>import-marks-if-exists</code> feature commands. |
| 825 | </p> |
| 826 | <div class="literalblock"> |
| 827 | <div class="content"> |
| 828 | <pre><code>Only enable this option if you trust the program generating the |
| 829 | fast-import stream! This option is enabled automatically for |
| 830 | remote-helpers that use the `import` capability, as they are |
| 831 | already trusted to run their own code.</code></pre> |
| 832 | </div></div> |
| 833 | </dd> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 834 | </dl></div> |
| 835 | <div class="sect2"> |
| 836 | <h3 id="_options_for_frontends">Options for Frontends</h3> |
| 837 | <div class="dlist"><dl> |
| 838 | <dt class="hdlist1"> |
| 839 | --cat-blob-fd=<fd> |
| 840 | </dt> |
| 841 | <dd> |
| 842 | <p> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 843 | Write responses to <code>get-mark</code>, <code>cat-blob</code>, and <code>ls</code> queries to the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 844 | file descriptor <fd> instead of <code>stdout</code>. Allows <code>progress</code> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 845 | output intended for the end-user to be separated from other |
| 846 | output. |
| 847 | </p> |
| 848 | </dd> |
| 849 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 850 | --date-format=<fmt> |
| 851 | </dt> |
| 852 | <dd> |
| 853 | <p> |
| 854 | Specify the type of dates the frontend will supply to |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 855 | fast-import within <code>author</code>, <code>committer</code> and <code>tagger</code> commands. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 856 | See “Date Formats” below for details about which formats |
| 857 | are supported, and their syntax. |
| 858 | </p> |
| 859 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 860 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 861 | --done |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 862 | </dt> |
| 863 | <dd> |
| 864 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 865 | Terminate with error if there is no <code>done</code> command at the end of |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 866 | the stream. This option might be useful for detecting errors |
| 867 | that cause the frontend to terminate before it has started to |
| 868 | write a stream. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 869 | </p> |
| 870 | </dd> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 871 | </dl></div> |
| 872 | </div> |
| 873 | <div class="sect2"> |
| 874 | <h3 id="_locations_of_marks_files">Locations of Marks Files</h3> |
| 875 | <div class="dlist"><dl> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 876 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 877 | --export-marks=<file> |
| 878 | </dt> |
| 879 | <dd> |
| 880 | <p> |
| 881 | Dumps the internal marks table to <file> when complete. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 882 | Marks are written one per line as <code>:markid SHA-1</code>. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 883 | Frontends can use this file to validate imports after they |
Junio C Hamano | d15328a | 2007-03-09 09:06:40 | [diff] [blame] | 884 | have been completed, or to save the marks table across |
| 885 | incremental runs. As <file> is only opened and truncated |
| 886 | at checkpoint (or completion) the same path can also be |
| 887 | safely given to --import-marks. |
| 888 | </p> |
| 889 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 890 | <dt class="hdlist1"> |
Junio C Hamano | d15328a | 2007-03-09 09:06:40 | [diff] [blame] | 891 | --import-marks=<file> |
| 892 | </dt> |
| 893 | <dd> |
| 894 | <p> |
| 895 | Before processing any input, load the marks specified in |
| 896 | <file>. The input file must exist, must be readable, and |
| 897 | must use the same format as produced by --export-marks. |
| 898 | Multiple options may be supplied to import more than one |
| 899 | set of marks. If a mark is defined to different values, |
| 900 | the last file wins. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 901 | </p> |
| 902 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 903 | <dt class="hdlist1"> |
Junio C Hamano | 23e3f53 | 2011-02-10 02:05:29 | [diff] [blame] | 904 | --import-marks-if-exists=<file> |
| 905 | </dt> |
| 906 | <dd> |
| 907 | <p> |
| 908 | Like --import-marks but instead of erroring out, silently |
| 909 | skips the file if it does not exist. |
| 910 | </p> |
| 911 | </dd> |
| 912 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 913 | --[no-]relative-marks |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 914 | </dt> |
| 915 | <dd> |
| 916 | <p> |
Junio C Hamano | a0dac24 | 2011-05-06 05:10:29 | [diff] [blame] | 917 | After specifying --relative-marks the paths specified |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 918 | with --import-marks= and --export-marks= are relative |
| 919 | to an internal directory in the current repository. |
| 920 | In git-fast-import this means that the paths are relative |
| 921 | to the .git/info/fast-import directory. However, other |
| 922 | importers may use a different location. |
| 923 | </p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 924 | <div class="paragraph"><p>Relative and non-relative marks may be combined by interweaving |
| 925 | --(no-)-relative-marks with the --(import|export)-marks= options.</p></div> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 926 | </dd> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 927 | </dl></div> |
| 928 | </div> |
| 929 | <div class="sect2"> |
Junio C Hamano | 1291d1a | 2020-03-27 01:15:03 | [diff] [blame] | 930 | <h3 id="_submodule_rewriting">Submodule Rewriting</h3> |
| 931 | <div class="dlist"><dl> |
| 932 | <dt class="hdlist1"> |
| 933 | --rewrite-submodules-from=<name>:<file> |
| 934 | </dt> |
| 935 | <dt class="hdlist1"> |
| 936 | --rewrite-submodules-to=<name>:<file> |
| 937 | </dt> |
| 938 | <dd> |
| 939 | <p> |
| 940 | Rewrite the object IDs for the submodule specified by <name> from the values |
| 941 | used in the from <file> to those used in the to <file>. The from marks should |
| 942 | have been created by <code>git fast-export</code>, and the to marks should have been |
| 943 | created by <code>git fast-import</code> when importing that same submodule. |
| 944 | </p> |
| 945 | <div class="paragraph"><p><name> may be any arbitrary string not containing a colon character, but the |
| 946 | same value must be used with both options when specifying corresponding marks. |
| 947 | Multiple submodules may be specified with different values for <name>. It is an |
| 948 | error not to use these options in corresponding pairs.</p></div> |
| 949 | <div class="paragraph"><p>These options are primarily useful when converting a repository from one hash |
| 950 | algorithm to another; without them, fast-import will fail if it encounters a |
| 951 | submodule because it has no way of writing the object ID into the new hash |
| 952 | algorithm.</p></div> |
| 953 | </dd> |
| 954 | </dl></div> |
| 955 | </div> |
| 956 | <div class="sect2"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 957 | <h3 id="_performance_and_compression_tuning">Performance and Compression Tuning</h3> |
| 958 | <div class="dlist"><dl> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 959 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 960 | --active-branches=<n> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 961 | </dt> |
| 962 | <dd> |
| 963 | <p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 964 | Maximum number of branches to maintain active at once. |
| 965 | See “Memory Utilization” below for details. Default is 5. |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 966 | </p> |
| 967 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 968 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 969 | --big-file-threshold=<n> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 970 | </dt> |
| 971 | <dd> |
| 972 | <p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 973 | Maximum size of a blob that fast-import will attempt to |
| 974 | create a delta for, expressed in bytes. The default is 512m |
| 975 | (512 MiB). Some importers may wish to lower this on systems |
| 976 | with constrained memory. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 977 | </p> |
| 978 | </dd> |
| 979 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 980 | --depth=<n> |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 981 | </dt> |
| 982 | <dd> |
| 983 | <p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 984 | Maximum delta depth, for blob and tree deltification. |
Junio C Hamano | 55d9191 | 2017-06-22 22:32:46 | [diff] [blame] | 985 | Default is 50. |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 986 | </p> |
| 987 | </dd> |
| 988 | <dt class="hdlist1"> |
Junio C Hamano | 9dd8bb0 | 2007-02-12 07:15:35 | [diff] [blame] | 989 | --export-pack-edges=<file> |
| 990 | </dt> |
| 991 | <dd> |
| 992 | <p> |
| 993 | After creating a packfile, print a line of data to |
| 994 | <file> listing the filename of the packfile and the last |
| 995 | commit on each branch that was written to that packfile. |
| 996 | This information may be useful after importing projects |
| 997 | whose total object set exceeds the 4 GiB packfile limit, |
| 998 | as these commits can be used as edge points during calls |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 999 | to <em>git pack-objects</em>. |
Junio C Hamano | 9dd8bb0 | 2007-02-12 07:15:35 | [diff] [blame] | 1000 | </p> |
| 1001 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1002 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 1003 | --max-pack-size=<n> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1004 | </dt> |
| 1005 | <dd> |
| 1006 | <p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 1007 | Maximum size of each output packfile. |
| 1008 | The default is unlimited. |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1009 | </p> |
| 1010 | </dd> |
Junio C Hamano | fedb1b4 | 2016-06-20 21:23:40 | [diff] [blame] | 1011 | <dt class="hdlist1"> |
| 1012 | fastimport.unpackLimit |
| 1013 | </dt> |
| 1014 | <dd> |
| 1015 | <p> |
| 1016 | See <a href="git-config.html">git-config(1)</a> |
| 1017 | </p> |
| 1018 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1019 | </dl></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1020 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1021 | </div> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 1022 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1023 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 1024 | <h2 id="_performance">PERFORMANCE</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1025 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1026 | <div class="paragraph"><p>The design of fast-import allows it to import large projects in a minimum |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1027 | amount of memory usage and processing time. Assuming the frontend |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1028 | is able to keep up with fast-import and feed it a constant stream of data, |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1029 | import times for projects holding 10+ years of history and containing |
| 1030 | 100,000+ individual commits are generally completed in just 1-2 |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1031 | hours on quite modest (~$2,000 USD) hardware.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1032 | <div class="paragraph"><p>Most bottlenecks appear to be in foreign source data access (the |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1033 | source just cannot extract revisions fast enough) or disk IO (fast-import |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1034 | writes as fast as the disk will take the data). Imports will run |
| 1035 | faster if the source data is stored on a different drive than the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1036 | destination Git repository (due to less IO contention).</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1037 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1038 | </div> |
| 1039 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 1040 | <h2 id="_development_cost">DEVELOPMENT COST</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1041 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1042 | <div class="paragraph"><p>A typical frontend for fast-import tends to weigh in at approximately 200 |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1043 | lines of Perl/Python/Ruby code. Most developers have been able to |
| 1044 | create working importers in just a couple of hours, even though it |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1045 | is their first exposure to fast-import, and sometimes even to Git. This is |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1046 | an ideal situation, given that most conversion tools are throw-away |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1047 | (use once, and never look back).</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1048 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1049 | </div> |
| 1050 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 1051 | <h2 id="_parallel_operation">PARALLEL OPERATION</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1052 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1053 | <div class="paragraph"><p>Like <em>git push</em> or <em>git fetch</em>, imports handled by fast-import are safe to |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1054 | run alongside parallel <code>git repack -a -d</code> or <code>git gc</code> invocations, |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1055 | or any other Git operation (including <em>git prune</em>, as loose objects |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1056 | are never used by fast-import).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1057 | <div class="paragraph"><p>fast-import does not lock the branch or tag refs it is actively importing. |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1058 | After the import, during its ref update phase, fast-import tests each |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1059 | existing branch ref to verify the update will be a fast-forward |
| 1060 | update (the commit stored in the ref is contained in the new |
| 1061 | history of the commit to be written). If the update is not a |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1062 | fast-forward update, fast-import will skip updating that ref and instead |
| 1063 | prints a warning message. fast-import will always attempt to update all |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1064 | branch refs, and does not stop on the first failure.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1065 | <div class="paragraph"><p>Branch updates can be forced with --force, but it’s recommended that |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1066 | this only be used on an otherwise quiet repository. Using --force |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1067 | is not necessary for an initial import into an empty repository.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1068 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1069 | </div> |
| 1070 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 1071 | <h2 id="_technical_discussion">TECHNICAL DISCUSSION</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1072 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1073 | <div class="paragraph"><p>fast-import tracks a set of branches in memory. Any branch can be created |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1074 | or modified at any point during the import process by sending a |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1075 | <code>commit</code> command on the input stream. This design allows a frontend |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1076 | program to process an unlimited number of branches simultaneously, |
| 1077 | generating commits in the order they are available from the source |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1078 | data. It also simplifies the frontend programs considerably.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1079 | <div class="paragraph"><p>fast-import does not use or alter the current working directory, or any |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1080 | file within it. (It does however update the current Git repository, |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1081 | as referenced by <code>GIT_DIR</code>.) Therefore an import frontend may use |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1082 | the working directory for its own purposes, such as extracting file |
| 1083 | revisions from the foreign source. This ignorance of the working |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1084 | directory also allows fast-import to run very quickly, as it does not |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1085 | need to perform any costly file update operations when switching |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1086 | between branches.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1087 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1088 | </div> |
| 1089 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 1090 | <h2 id="_input_format">INPUT FORMAT</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1091 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1092 | <div class="paragraph"><p>With the exception of raw file data (which Git does not interpret) |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1093 | the fast-import input format is text (ASCII) based. This text based |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1094 | format simplifies development and debugging of frontend programs, |
| 1095 | especially when a higher level language such as Perl, Python or |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1096 | Ruby is being used.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1097 | <div class="paragraph"><p>fast-import is very strict about its input. Where we say SP below we mean |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1098 | <strong>exactly</strong> one space. Likewise LF means one (and only one) linefeed |
| 1099 | and HT one (and only one) horizontal tab. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1100 | Supplying additional whitespace characters will cause unexpected |
| 1101 | results, such as branch names or file names with leading or trailing |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1102 | spaces in their name, or early termination of fast-import when it encounters |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1103 | unexpected input.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1104 | <div class="sect2"> |
| 1105 | <h3 id="_stream_comments">Stream Comments</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1106 | <div class="paragraph"><p>To aid in debugging frontends fast-import ignores any line that |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1107 | begins with <code>#</code> (ASCII pound/hash) up to and including the line |
| 1108 | ending <code>LF</code>. A comment line may contain any sequence of bytes |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1109 | that does not contain an LF and therefore may be used to include |
| 1110 | any detailed debugging information that might be specific to the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1111 | frontend and useful when inspecting a fast-import data stream.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1112 | </div> |
| 1113 | <div class="sect2"> |
| 1114 | <h3 id="_date_formats">Date Formats</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1115 | <div class="paragraph"><p>The following date formats are supported. A frontend should select |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1116 | the format it will use for this import by passing the format name |
Junio C Hamano | e1aeb5e | 2014-06-06 19:16:29 | [diff] [blame] | 1117 | in the --date-format=<fmt> command-line option.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1118 | <div class="dlist"><dl> |
| 1119 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1120 | <code>raw</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1121 | </dt> |
| 1122 | <dd> |
| 1123 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1124 | This is the Git native format and is <code><time> SP <offutc></code>. |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1125 | It is also fast-import’s default format, if --date-format was |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1126 | not specified. |
| 1127 | </p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1128 | <div class="paragraph"><p>The time of the event is specified by <code><time></code> as the number of |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1129 | seconds since the UNIX epoch (midnight, Jan 1, 1970, UTC) and is |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1130 | written as an ASCII decimal integer.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1131 | <div class="paragraph"><p>The local offset is specified by <code><offutc></code> as a positive or negative |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1132 | offset from UTC. For example EST (which is 5 hours behind UTC) |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1133 | would be expressed in <code><tz></code> by “-0500” while UTC is “+0000”. |
| 1134 | The local offset does not affect <code><time></code>; it is used only as an |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1135 | advisement to help formatting routines display the timestamp.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1136 | <div class="paragraph"><p>If the local offset is not available in the source material, use |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1137 | “+0000”, or the most common local offset. For example many |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1138 | organizations have a CVS repository which has only ever been accessed |
Junio C Hamano | e3acfb8 | 2013-11-12 23:22:57 | [diff] [blame] | 1139 | by users who are located in the same location and time zone. In this |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1140 | case a reasonable offset from UTC could be assumed.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1141 | <div class="paragraph"><p>Unlike the <code>rfc2822</code> format, this format is very strict. Any |
Junio C Hamano | 3ef9e67 | 2020-06-02 21:51:31 | [diff] [blame] | 1142 | variation in formatting will cause fast-import to reject the value, |
| 1143 | and some sanity checks on the numeric values may also be performed.</p></div> |
| 1144 | </dd> |
| 1145 | <dt class="hdlist1"> |
| 1146 | <code>raw-permissive</code> |
| 1147 | </dt> |
| 1148 | <dd> |
| 1149 | <p> |
| 1150 | This is the same as <code>raw</code> except that no sanity checks on |
| 1151 | the numeric epoch and local offset are performed. This can |
| 1152 | be useful when trying to filter or import an existing history |
| 1153 | with e.g. bogus timezone values. |
| 1154 | </p> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1155 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1156 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1157 | <code>rfc2822</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1158 | </dt> |
| 1159 | <dd> |
| 1160 | <p> |
| 1161 | This is the standard email format as described by RFC 2822. |
| 1162 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1163 | <div class="paragraph"><p>An example value is “Tue Feb 6 11:22:18 2007 -0500”. The Git |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1164 | parser is accurate, but a little on the lenient side. It is the |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1165 | same parser used by <em>git am</em> when applying patches |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1166 | received from email.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1167 | <div class="paragraph"><p>Some malformed strings may be accepted as valid dates. In some of |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1168 | these cases Git will still be able to obtain the correct date from |
| 1169 | the malformed string. There are also some types of malformed |
| 1170 | strings which Git will parse wrong, and yet consider valid. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1171 | Seriously malformed strings will be rejected.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1172 | <div class="paragraph"><p>Unlike the <code>raw</code> format above, the time zone/UTC offset information |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1173 | contained in an RFC 2822 date string is used to adjust the date |
| 1174 | value to UTC prior to storage. Therefore it is important that |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1175 | this information be as accurate as possible.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1176 | <div class="paragraph"><p>If the source material uses RFC 2822 style dates, |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1177 | the frontend should let fast-import handle the parsing and conversion |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1178 | (rather than attempting to do it itself) as the Git parser has |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1179 | been well tested in the wild.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1180 | <div class="paragraph"><p>Frontends should prefer the <code>raw</code> format if the source material |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1181 | already uses UNIX-epoch format, can be coaxed to give dates in that |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 1182 | format, or its format is easily convertible to it, as there is no |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1183 | ambiguity in parsing.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1184 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1185 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1186 | <code>now</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1187 | </dt> |
| 1188 | <dd> |
| 1189 | <p> |
Junio C Hamano | e3acfb8 | 2013-11-12 23:22:57 | [diff] [blame] | 1190 | Always use the current time and time zone. The literal |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1191 | <code>now</code> must always be supplied for <code><when></code>. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1192 | </p> |
Junio C Hamano | e3acfb8 | 2013-11-12 23:22:57 | [diff] [blame] | 1193 | <div class="paragraph"><p>This is a toy format. The current time and time zone of this system |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1194 | is always copied into the identity string at the time it is being |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1195 | created by fast-import. There is no way to specify a different time or |
Junio C Hamano | e3acfb8 | 2013-11-12 23:22:57 | [diff] [blame] | 1196 | time zone.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1197 | <div class="paragraph"><p>This particular format is supplied as it’s short to implement and |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1198 | may be useful to a process that wants to create a new commit |
| 1199 | right now, without needing to use a working directory or |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1200 | <em>git update-index</em>.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1201 | <div class="paragraph"><p>If separate <code>author</code> and <code>committer</code> commands are used in a <code>commit</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1202 | the timestamps may not match, as the system clock will be polled |
| 1203 | twice (once for each command). The only way to ensure that both |
| 1204 | author and committer identity information has the same timestamp |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1205 | is to omit <code>author</code> (thus copying from <code>committer</code>) or to use a |
| 1206 | date format other than <code>now</code>.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1207 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1208 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1209 | </div> |
| 1210 | <div class="sect2"> |
| 1211 | <h3 id="_commands">Commands</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1212 | <div class="paragraph"><p>fast-import accepts several commands to update the current repository |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1213 | and control the current import process. More detailed discussion |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1214 | (with examples) of each command follows later.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1215 | <div class="dlist"><dl> |
| 1216 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1217 | <code>commit</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1218 | </dt> |
| 1219 | <dd> |
| 1220 | <p> |
| 1221 | Creates a new branch or updates an existing branch by |
| 1222 | creating a new commit and updating the branch to point at |
| 1223 | the newly created commit. |
| 1224 | </p> |
| 1225 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1226 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1227 | <code>tag</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1228 | </dt> |
| 1229 | <dd> |
| 1230 | <p> |
| 1231 | Creates an annotated tag object from an existing commit or |
| 1232 | branch. Lightweight tags are not supported by this command, |
| 1233 | as they are not recommended for recording meaningful points |
| 1234 | in time. |
| 1235 | </p> |
| 1236 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1237 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1238 | <code>reset</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1239 | </dt> |
| 1240 | <dd> |
| 1241 | <p> |
| 1242 | Reset an existing branch (or a new branch) to a specific |
| 1243 | revision. This command must be used to change a branch to |
| 1244 | a specific revision without making a commit on it. |
| 1245 | </p> |
| 1246 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1247 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1248 | <code>blob</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1249 | </dt> |
| 1250 | <dd> |
| 1251 | <p> |
| 1252 | Convert raw file data into a blob, for future use in a |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1253 | <code>commit</code> command. This command is optional and is not |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1254 | needed to perform an import. |
| 1255 | </p> |
| 1256 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1257 | <dt class="hdlist1"> |
Junio C Hamano | fa2a48b | 2019-10-15 05:24:40 | [diff] [blame] | 1258 | <code>alias</code> |
| 1259 | </dt> |
| 1260 | <dd> |
| 1261 | <p> |
| 1262 | Record that a mark refers to a given object without first |
| 1263 | creating any new object. Using --import-marks and referring |
| 1264 | to missing marks will cause fast-import to fail, so aliases |
| 1265 | can provide a way to set otherwise pruned commits to a valid |
| 1266 | value (e.g. the nearest non-pruned ancestor). |
| 1267 | </p> |
| 1268 | </dd> |
| 1269 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1270 | <code>checkpoint</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1271 | </dt> |
| 1272 | <dd> |
| 1273 | <p> |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1274 | Forces fast-import to close the current packfile, generate its |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1275 | unique SHA-1 checksum and index, and start a new packfile. |
| 1276 | This command is optional and is not needed to perform |
| 1277 | an import. |
| 1278 | </p> |
| 1279 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1280 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1281 | <code>progress</code> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1282 | </dt> |
| 1283 | <dd> |
| 1284 | <p> |
| 1285 | Causes fast-import to echo the entire line to its own |
| 1286 | standard output. This command is optional and is not needed |
| 1287 | to perform an import. |
| 1288 | </p> |
| 1289 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1290 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1291 | <code>done</code> |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 1292 | </dt> |
| 1293 | <dd> |
| 1294 | <p> |
| 1295 | Marks the end of the stream. This command is optional |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1296 | unless the <code>done</code> feature was requested using the |
| 1297 | <code>--done</code> command-line option or <code>feature done</code> command. |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 1298 | </p> |
| 1299 | </dd> |
| 1300 | <dt class="hdlist1"> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 1301 | <code>get-mark</code> |
| 1302 | </dt> |
| 1303 | <dd> |
| 1304 | <p> |
| 1305 | Causes fast-import to print the SHA-1 corresponding to a mark |
| 1306 | to the file descriptor set with <code>--cat-blob-fd</code>, or <code>stdout</code> if |
| 1307 | unspecified. |
| 1308 | </p> |
| 1309 | </dd> |
| 1310 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1311 | <code>cat-blob</code> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1312 | </dt> |
| 1313 | <dd> |
| 1314 | <p> |
| 1315 | Causes fast-import to print a blob in <em>cat-file --batch</em> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1316 | format to the file descriptor set with <code>--cat-blob-fd</code> or |
| 1317 | <code>stdout</code> if unspecified. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1318 | </p> |
| 1319 | </dd> |
| 1320 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1321 | <code>ls</code> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1322 | </dt> |
| 1323 | <dd> |
| 1324 | <p> |
| 1325 | Causes fast-import to print a line describing a directory |
| 1326 | entry in <em>ls-tree</em> format to the file descriptor set with |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1327 | <code>--cat-blob-fd</code> or <code>stdout</code> if unspecified. |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1328 | </p> |
| 1329 | </dd> |
| 1330 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1331 | <code>feature</code> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1332 | </dt> |
| 1333 | <dd> |
| 1334 | <p> |
Junio C Hamano | 0e0e0d2 | 2013-09-12 23:25:03 | [diff] [blame] | 1335 | Enable the specified feature. This requires that fast-import |
| 1336 | supports the specified feature, and aborts if it does not. |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1337 | </p> |
| 1338 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1339 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1340 | <code>option</code> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1341 | </dt> |
| 1342 | <dd> |
| 1343 | <p> |
| 1344 | Specify any of the options listed under OPTIONS that do not |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1345 | change stream semantic to suit the frontend’s needs. This |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1346 | command is optional and is not needed to perform an import. |
| 1347 | </p> |
| 1348 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1349 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1350 | </div> |
| 1351 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1352 | <h3 id="_code_commit_code"><code>commit</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1353 | <div class="paragraph"><p>Create or update a branch with a new commit, recording one logical |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1354 | change to the project.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1355 | <div class="literalblock"> |
| 1356 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1357 | <pre><code> 'commit' SP <ref> LF |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1358 | mark? |
Junio C Hamano | de48f45 | 2019-01-04 22:31:57 | [diff] [blame] | 1359 | original-oid? |
Junio C Hamano | 6d325df | 2010-01-01 00:02:47 | [diff] [blame] | 1360 | ('author' (SP <name>)? SP LT <email> GT SP <when> LF)? |
| 1361 | 'committer' (SP <name>)? SP LT <email> GT SP <when> LF |
Junio C Hamano | 5193787 | 2019-06-13 22:09:30 | [diff] [blame] | 1362 | ('encoding' SP <encoding>)? |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1363 | data |
Junio C Hamano | e6f28d0 | 2013-09-17 21:34:00 | [diff] [blame] | 1364 | ('from' SP <commit-ish> LF)? |
Junio C Hamano | 926cc05 | 2019-08-22 20:37:21 | [diff] [blame] | 1365 | ('merge' SP <commit-ish> LF)* |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1366 | (filemodify | filedelete | filecopy | filerename | filedeleteall | notemodify)* |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1367 | LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1368 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1369 | <div class="paragraph"><p>where <code><ref></code> is the name of the branch to make the commit on. |
| 1370 | Typically branch names are prefixed with <code>refs/heads/</code> in |
| 1371 | Git, so importing the CVS branch symbol <code>RELENG-1_0</code> would use |
| 1372 | <code>refs/heads/RELENG-1_0</code> for the value of <code><ref></code>. The value of |
| 1373 | <code><ref></code> must be a valid refname in Git. As <code>LF</code> is not valid in |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1374 | a Git refname, no quoting or escaping syntax is supported here.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1375 | <div class="paragraph"><p>A <code>mark</code> command may optionally appear, requesting fast-import to save a |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1376 | reference to the newly created commit for future use by the frontend |
| 1377 | (see below for format). It is very common for frontends to mark |
| 1378 | every commit they create, thereby allowing future branch creation |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1379 | from any imported commit.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1380 | <div class="paragraph"><p>The <code>data</code> command following <code>committer</code> must supply the commit |
| 1381 | message (see below for <code>data</code> command syntax). To import an empty |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1382 | commit message use a 0 length data. Commit messages are free-form |
| 1383 | and are not interpreted by Git. Currently they must be encoded in |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1384 | UTF-8, as fast-import does not permit other encodings to be specified.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1385 | <div class="paragraph"><p>Zero or more <code>filemodify</code>, <code>filedelete</code>, <code>filecopy</code>, <code>filerename</code>, |
| 1386 | <code>filedeleteall</code> and <code>notemodify</code> commands |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1387 | may be included to update the contents of the branch prior to |
| 1388 | creating the commit. These commands may be supplied in any order. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1389 | However it is recommended that a <code>filedeleteall</code> command precede |
| 1390 | all <code>filemodify</code>, <code>filecopy</code>, <code>filerename</code> and <code>notemodify</code> commands in |
| 1391 | the same commit, as <code>filedeleteall</code> wipes the branch clean (see below).</p></div> |
Junio C Hamano | 2ba1471 | 2019-04-25 10:12:27 | [diff] [blame] | 1392 | <div class="paragraph"><p>The <code>LF</code> after the command is optional (it used to be required). Note |
| 1393 | that for reasons of backward compatibility, if the commit ends with a |
Junio C Hamano | 556b57e | 2019-08-12 17:46:38 | [diff] [blame] | 1394 | <code>data</code> command (i.e. it has no <code>from</code>, <code>merge</code>, <code>filemodify</code>, |
Junio C Hamano | 2ba1471 | 2019-04-25 10:12:27 | [diff] [blame] | 1395 | <code>filedelete</code>, <code>filecopy</code>, <code>filerename</code>, <code>filedeleteall</code> or |
| 1396 | <code>notemodify</code> commands) then two <code>LF</code> commands may appear at the end of |
| 1397 | the command instead of just one.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1398 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1399 | <h4 id="_code_author_code"><code>author</code></h4> |
| 1400 | <div class="paragraph"><p>An <code>author</code> command may optionally appear, if the author information |
| 1401 | might differ from the committer information. If <code>author</code> is omitted |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1402 | then fast-import will automatically use the committer’s information for |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1403 | the author portion of the commit. See below for a description of |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1404 | the fields in <code>author</code>, as they are identical to <code>committer</code>.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1405 | </div> |
| 1406 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1407 | <h4 id="_code_committer_code"><code>committer</code></h4> |
| 1408 | <div class="paragraph"><p>The <code>committer</code> command indicates who made this commit, and when |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1409 | they made it.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1410 | <div class="paragraph"><p>Here <code><name></code> is the person’s display name (for example |
| 1411 | “Com M Itter”) and <code><email></code> is the person’s email address |
| 1412 | (“cm@example.com”). <code>LT</code> and <code>GT</code> are the literal less-than (\x3c) |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1413 | and greater-than (\x3e) symbols. These are required to delimit |
| 1414 | the email address from the other fields in the line. Note that |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1415 | <code><name></code> and <code><email></code> are free-form and may contain any sequence |
| 1416 | of bytes, except <code>LT</code>, <code>GT</code> and <code>LF</code>. <code><name></code> is typically UTF-8 encoded.</p></div> |
| 1417 | <div class="paragraph"><p>The time of the change is specified by <code><when></code> using the date format |
Junio C Hamano | e1aeb5e | 2014-06-06 19:16:29 | [diff] [blame] | 1418 | that was selected by the --date-format=<fmt> command-line option. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1419 | See “Date Formats” above for the set of supported formats, and |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1420 | their syntax.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1421 | </div> |
| 1422 | <div class="sect3"> |
Junio C Hamano | 5193787 | 2019-06-13 22:09:30 | [diff] [blame] | 1423 | <h4 id="_code_encoding_code"><code>encoding</code></h4> |
| 1424 | <div class="paragraph"><p>The optional <code>encoding</code> command indicates the encoding of the commit |
| 1425 | message. Most commits are UTF-8 and the encoding is omitted, but this |
| 1426 | allows importing commit messages into git without first reencoding them.</p></div> |
| 1427 | </div> |
| 1428 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1429 | <h4 id="_code_from_code"><code>from</code></h4> |
| 1430 | <div class="paragraph"><p>The <code>from</code> command is used to specify the commit to initialize |
Junio C Hamano | 5dad083 | 2007-02-13 05:16:23 | [diff] [blame] | 1431 | this branch from. This revision will be the first ancestor of the |
Junio C Hamano | ac28f43 | 2012-11-21 21:58:58 | [diff] [blame] | 1432 | new commit. The state of the tree built at this commit will begin |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1433 | with the state at the <code>from</code> commit, and be altered by the content |
Junio C Hamano | ac28f43 | 2012-11-21 21:58:58 | [diff] [blame] | 1434 | modifications in this commit.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1435 | <div class="paragraph"><p>Omitting the <code>from</code> command in the first commit of a new branch |
Junio C Hamano | 5dad083 | 2007-02-13 05:16:23 | [diff] [blame] | 1436 | will cause fast-import to create that commit with no ancestor. This |
| 1437 | tends to be desired only for the initial commit of a project. |
Junio C Hamano | 25c0b70 | 2008-03-23 09:41:37 | [diff] [blame] | 1438 | If the frontend creates all files from scratch when making a new |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1439 | branch, a <code>merge</code> command may be used instead of <code>from</code> to start |
Junio C Hamano | 25c0b70 | 2008-03-23 09:41:37 | [diff] [blame] | 1440 | the commit with an empty tree. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1441 | Omitting the <code>from</code> command on existing branches is usually desired, |
Junio C Hamano | 5dad083 | 2007-02-13 05:16:23 | [diff] [blame] | 1442 | as the current commit on that branch is automatically assumed to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1443 | be the first ancestor of the new commit.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1444 | <div class="paragraph"><p>As <code>LF</code> is not valid in a Git refname or SHA-1 expression, no |
| 1445 | quoting or escaping syntax is supported within <code><commit-ish></code>.</p></div> |
| 1446 | <div class="paragraph"><p>Here <code><commit-ish></code> is any of the following:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1447 | <div class="ulist"><ul> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1448 | <li> |
| 1449 | <p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1450 | The name of an existing branch already in fast-import’s internal branch |
| 1451 | table. If fast-import doesn’t know the name, it’s treated as a SHA-1 |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1452 | expression. |
| 1453 | </p> |
| 1454 | </li> |
| 1455 | <li> |
| 1456 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1457 | A mark reference, <code>:<idnum></code>, where <code><idnum></code> is the mark number. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1458 | </p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1459 | <div class="paragraph"><p>The reason fast-import uses <code>:</code> to denote a mark reference is this character |
| 1460 | is not legal in a Git branch name. The leading <code>:</code> makes it easy |
| 1461 | to distinguish between the mark 42 (<code>:42</code>) and the branch 42 (<code>42</code> |
| 1462 | or <code>refs/heads/42</code>), or an abbreviated SHA-1 which happened to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1463 | consist only of base-10 digits.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1464 | <div class="paragraph"><p>Marks must be declared (via <code>mark</code>) before they can be used.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1465 | </li> |
| 1466 | <li> |
| 1467 | <p> |
| 1468 | A complete 40 byte or abbreviated commit SHA-1 in hex. |
| 1469 | </p> |
| 1470 | </li> |
| 1471 | <li> |
| 1472 | <p> |
| 1473 | Any valid Git SHA-1 expression that resolves to a commit. See |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1474 | “SPECIFYING REVISIONS” in <a href="gitrevisions.html">gitrevisions(7)</a> for details. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1475 | </p> |
| 1476 | </li> |
Junio C Hamano | c8c398a | 2014-06-16 21:14:05 | [diff] [blame] | 1477 | <li> |
| 1478 | <p> |
| 1479 | The special null SHA-1 (40 zeros) specifies that the branch is to be |
| 1480 | removed. |
| 1481 | </p> |
| 1482 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1483 | </ul></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1484 | <div class="paragraph"><p>The special case of restarting an incremental import from the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1485 | current branch value should be written as:</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1486 | <div class="listingblock"> |
| 1487 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1488 | <pre><code> from refs/heads/branch^0</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1489 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1490 | <div class="paragraph"><p>The <code>^0</code> suffix is necessary as fast-import does not permit a branch to |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1491 | start from itself, and the branch is created in memory before the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1492 | <code>from</code> command is even read from the input. Adding <code>^0</code> will force |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1493 | fast-import to resolve the commit through Git’s revision parsing library, |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1494 | rather than its internal branch table, thereby loading in the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1495 | existing value of the branch.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1496 | </div> |
| 1497 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1498 | <h4 id="_code_merge_code"><code>merge</code></h4> |
Junio C Hamano | ac28f43 | 2012-11-21 21:58:58 | [diff] [blame] | 1499 | <div class="paragraph"><p>Includes one additional ancestor commit. The additional ancestry |
| 1500 | link does not change the way the tree state is built at this commit. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1501 | If the <code>from</code> command is |
| 1502 | omitted when creating a new branch, the first <code>merge</code> commit will be |
Junio C Hamano | 25c0b70 | 2008-03-23 09:41:37 | [diff] [blame] | 1503 | the first ancestor of the current commit, and the branch will start |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1504 | out with no files. An unlimited number of <code>merge</code> commands per |
Junio C Hamano | e35ff42 | 2015-04-14 21:45:21 | [diff] [blame] | 1505 | commit are permitted by fast-import, thereby establishing an n-way merge.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1506 | <div class="paragraph"><p>Here <code><commit-ish></code> is any of the commit specification expressions |
| 1507 | also accepted by <code>from</code> (see above).</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1508 | </div> |
| 1509 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1510 | <h4 id="_code_filemodify_code"><code>filemodify</code></h4> |
| 1511 | <div class="paragraph"><p>Included in a <code>commit</code> command to add a new file or change the |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1512 | content of an existing file. This command has two different means |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1513 | of specifying the content of the file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1514 | <div class="dlist"><dl> |
| 1515 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1516 | External data format |
| 1517 | </dt> |
| 1518 | <dd> |
| 1519 | <p> |
| 1520 | The data content for the file was already supplied by a prior |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1521 | <code>blob</code> command. The frontend just needs to connect it. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1522 | </p> |
| 1523 | <div class="literalblock"> |
| 1524 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1525 | <pre><code> 'M' SP <mode> SP <dataref> SP <path> LF</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1526 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1527 | <div class="paragraph"><p>Here usually <code><dataref></code> must be either a mark reference (<code>:<idnum></code>) |
| 1528 | set by a prior <code>blob</code> command, or a full 40-byte SHA-1 of an |
| 1529 | existing Git blob object. If <code><mode></code> is <code>040000`</code> then |
| 1530 | <code><dataref></code> must be the full 40-byte SHA-1 of an existing |
| 1531 | Git tree object or a mark reference set with <code>--import-marks</code>.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1532 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1533 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1534 | Inline data format |
| 1535 | </dt> |
| 1536 | <dd> |
| 1537 | <p> |
| 1538 | The data content for the file has not been supplied yet. |
| 1539 | The frontend wants to supply it as part of this modify |
| 1540 | command. |
| 1541 | </p> |
| 1542 | <div class="literalblock"> |
| 1543 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1544 | <pre><code> 'M' SP <mode> SP 'inline' SP <path> LF |
| 1545 | data</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1546 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1547 | <div class="paragraph"><p>See below for a detailed description of the <code>data</code> command.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1548 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1549 | </dl></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1550 | <div class="paragraph"><p>In both formats <code><mode></code> is the type of file entry, specified |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1551 | in octal. Git only supports the following modes:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1552 | <div class="ulist"><ul> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1553 | <li> |
| 1554 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1555 | <code>100644</code> or <code>644</code>: A normal (not-executable) file. The majority |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1556 | of files in most projects use this mode. If in doubt, this is |
| 1557 | what you want. |
| 1558 | </p> |
| 1559 | </li> |
| 1560 | <li> |
| 1561 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1562 | <code>100755</code> or <code>755</code>: A normal, but executable, file. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1563 | </p> |
| 1564 | </li> |
| 1565 | <li> |
| 1566 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1567 | <code>120000</code>: A symlink, the content of the file will be the link target. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1568 | </p> |
| 1569 | </li> |
Junio C Hamano | 915cd9b | 2008-07-20 01:24:17 | [diff] [blame] | 1570 | <li> |
| 1571 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1572 | <code>160000</code>: A gitlink, SHA-1 of the object refers to a commit in |
Junio C Hamano | 915cd9b | 2008-07-20 01:24:17 | [diff] [blame] | 1573 | another repository. Git links can only be specified by SHA or through |
| 1574 | a commit mark. They are used to implement submodules. |
| 1575 | </p> |
| 1576 | </li> |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1577 | <li> |
| 1578 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1579 | <code>040000</code>: A subdirectory. Subdirectories can only be specified by |
| 1580 | SHA or through a tree mark set with <code>--import-marks</code>. |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1581 | </p> |
| 1582 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1583 | </ul></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1584 | <div class="paragraph"><p>In both formats <code><path></code> is the complete path of the file to be added |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1585 | (if not already existing) or modified (if already existing).</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1586 | <div class="paragraph"><p>A <code><path></code> string must use UNIX-style directory separators (forward |
| 1587 | slash <code>/</code>), may contain any byte other than <code>LF</code>, and must not |
| 1588 | start with double quote (<code>"</code>).</p></div> |
Junio C Hamano | bccb0db | 2012-11-29 22:51:20 | [diff] [blame] | 1589 | <div class="paragraph"><p>A path can use C-style string quoting; this is accepted in all cases |
| 1590 | and mandatory if the filename starts with double quote or contains |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1591 | <code>LF</code>. In C-style quoting, the complete name should be surrounded with |
| 1592 | double quotes, and any <code>LF</code>, backslash, or double quote characters |
Junio C Hamano | bccb0db | 2012-11-29 22:51:20 | [diff] [blame] | 1593 | must be escaped by preceding them with a backslash (e.g., |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1594 | <code>"path/with\n, \\ and \" in it"</code>).</p></div> |
| 1595 | <div class="paragraph"><p>The value of <code><path></code> must be in canonical form. That is it must not:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1596 | <div class="ulist"><ul> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1597 | <li> |
| 1598 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1599 | contain an empty directory component (e.g. <code>foo//bar</code> is invalid), |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1600 | </p> |
| 1601 | </li> |
| 1602 | <li> |
| 1603 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1604 | end with a directory separator (e.g. <code>foo/</code> is invalid), |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1605 | </p> |
| 1606 | </li> |
| 1607 | <li> |
| 1608 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1609 | start with a directory separator (e.g. <code>/foo</code> is invalid), |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1610 | </p> |
| 1611 | </li> |
| 1612 | <li> |
| 1613 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1614 | contain the special component <code>.</code> or <code>..</code> (e.g. <code>foo/./bar</code> and |
| 1615 | <code>foo/../bar</code> are invalid). |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1616 | </p> |
| 1617 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1618 | </ul></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1619 | <div class="paragraph"><p>The root of the tree can be represented by an empty string as <code><path></code>.</p></div> |
| 1620 | <div class="paragraph"><p>It is recommended that <code><path></code> always be encoded using UTF-8.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1621 | </div> |
| 1622 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1623 | <h4 id="_code_filedelete_code"><code>filedelete</code></h4> |
| 1624 | <div class="paragraph"><p>Included in a <code>commit</code> command to remove a file or recursively |
Junio C Hamano | 06216df | 2007-07-10 07:49:37 | [diff] [blame] | 1625 | delete an entire directory from the branch. If the file or directory |
| 1626 | removal makes its parent directory empty, the parent directory will |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1627 | be automatically removed too. This cascades up the tree until the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1628 | first non-empty directory or the root is reached.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1629 | <div class="literalblock"> |
| 1630 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1631 | <pre><code> 'D' SP <path> LF</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1632 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1633 | <div class="paragraph"><p>here <code><path></code> is the complete path of the file or subdirectory to |
Junio C Hamano | 06216df | 2007-07-10 07:49:37 | [diff] [blame] | 1634 | be removed from the branch. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1635 | See <code>filemodify</code> above for a detailed description of <code><path></code>.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1636 | </div> |
| 1637 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1638 | <h4 id="_code_filecopy_code"><code>filecopy</code></h4> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1639 | <div class="paragraph"><p>Recursively copies an existing file or subdirectory to a different |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1640 | location within the branch. The existing file or directory must |
| 1641 | exist. If the destination exists it will be completely replaced |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1642 | by the content copied from the source.</p></div> |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1643 | <div class="literalblock"> |
| 1644 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1645 | <pre><code> 'C' SP <path> SP <path> LF</code></pre> |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1646 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1647 | <div class="paragraph"><p>here the first <code><path></code> is the source location and the second |
| 1648 | <code><path></code> is the destination. See <code>filemodify</code> above for a detailed |
| 1649 | description of what <code><path></code> may look like. To use a source path |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1650 | that contains SP the path must be quoted.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1651 | <div class="paragraph"><p>A <code>filecopy</code> command takes effect immediately. Once the source |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1652 | location has been copied to the destination any future commands |
| 1653 | applied to the source location will not impact the destination of |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1654 | the copy.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1655 | </div> |
| 1656 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1657 | <h4 id="_code_filerename_code"><code>filerename</code></h4> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1658 | <div class="paragraph"><p>Renames an existing file or subdirectory to a different location |
Junio C Hamano | 06216df | 2007-07-10 07:49:37 | [diff] [blame] | 1659 | within the branch. The existing file or directory must exist. If |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1660 | the destination exists it will be replaced by the source directory.</p></div> |
Junio C Hamano | 06216df | 2007-07-10 07:49:37 | [diff] [blame] | 1661 | <div class="literalblock"> |
| 1662 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1663 | <pre><code> 'R' SP <path> SP <path> LF</code></pre> |
Junio C Hamano | 06216df | 2007-07-10 07:49:37 | [diff] [blame] | 1664 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1665 | <div class="paragraph"><p>here the first <code><path></code> is the source location and the second |
| 1666 | <code><path></code> is the destination. See <code>filemodify</code> above for a detailed |
| 1667 | description of what <code><path></code> may look like. To use a source path |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1668 | that contains SP the path must be quoted.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1669 | <div class="paragraph"><p>A <code>filerename</code> command takes effect immediately. Once the source |
Junio C Hamano | 06216df | 2007-07-10 07:49:37 | [diff] [blame] | 1670 | location has been renamed to the destination any future commands |
| 1671 | applied to the source location will create new files there and not |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1672 | impact the destination of the rename.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1673 | <div class="paragraph"><p>Note that a <code>filerename</code> is the same as a <code>filecopy</code> followed by a |
| 1674 | <code>filedelete</code> of the source location. There is a slight performance |
| 1675 | advantage to using <code>filerename</code>, but the advantage is so small |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1676 | that it is never worth trying to convert a delete/add pair in |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1677 | source material into a rename for fast-import. This <code>filerename</code> |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1678 | command is provided just to simplify frontends that already have |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1679 | rename information and don’t want bother with decomposing it into a |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1680 | <code>filecopy</code> followed by a <code>filedelete</code>.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1681 | </div> |
| 1682 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1683 | <h4 id="_code_filedeleteall_code"><code>filedeleteall</code></h4> |
| 1684 | <div class="paragraph"><p>Included in a <code>commit</code> command to remove all files (and also all |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1685 | directories) from the branch. This command resets the internal |
| 1686 | branch structure to have no files in it, allowing the frontend |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1687 | to subsequently add all interesting files from scratch.</p></div> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1688 | <div class="literalblock"> |
| 1689 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1690 | <pre><code> 'deleteall' LF</code></pre> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1691 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1692 | <div class="paragraph"><p>This command is extremely useful if the frontend does not know |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1693 | (or does not care to know) what files are currently on the branch, |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1694 | and therefore cannot generate the proper <code>filedelete</code> commands to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1695 | update the content.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1696 | <div class="paragraph"><p>Issuing a <code>filedeleteall</code> followed by the needed <code>filemodify</code> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1697 | commands to set the correct content will produce the same results |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1698 | as sending only the needed <code>filemodify</code> and <code>filedelete</code> commands. |
| 1699 | The <code>filedeleteall</code> approach may however require fast-import to use slightly |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1700 | more memory per active branch (less than 1 MiB for even most large |
| 1701 | projects); so frontends that can easily obtain only the affected |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1702 | paths for a commit are encouraged to do so.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1703 | </div> |
| 1704 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1705 | <h4 id="_code_notemodify_code"><code>notemodify</code></h4> |
| 1706 | <div class="paragraph"><p>Included in a <code>commit</code> <code><notes_ref></code> command to add a new note |
| 1707 | annotating a <code><commit-ish></code> or change this annotation contents. |
| 1708 | Internally it is similar to filemodify 100644 on <code><commit-ish></code> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 1709 | path (maybe split into subdirectories). It’s not advised to |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1710 | use any other commands to write to the <code><notes_ref></code> tree except |
| 1711 | <code>filedeleteall</code> to delete all existing notes in this tree. |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 1712 | This command has two different means of specifying the content |
| 1713 | of the note.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1714 | <div class="dlist"><dl> |
| 1715 | <dt class="hdlist1"> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1716 | External data format |
| 1717 | </dt> |
| 1718 | <dd> |
| 1719 | <p> |
| 1720 | The data content for the note was already supplied by a prior |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1721 | <code>blob</code> command. The frontend just needs to connect it to the |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1722 | commit that is to be annotated. |
| 1723 | </p> |
| 1724 | <div class="literalblock"> |
| 1725 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1726 | <pre><code> 'N' SP <dataref> SP <commit-ish> LF</code></pre> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1727 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1728 | <div class="paragraph"><p>Here <code><dataref></code> can be either a mark reference (<code>:<idnum></code>) |
| 1729 | set by a prior <code>blob</code> command, or a full 40-byte SHA-1 of an |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1730 | existing Git blob object.</p></div> |
| 1731 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1732 | <dt class="hdlist1"> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1733 | Inline data format |
| 1734 | </dt> |
| 1735 | <dd> |
| 1736 | <p> |
| 1737 | The data content for the note has not been supplied yet. |
| 1738 | The frontend wants to supply it as part of this modify |
| 1739 | command. |
| 1740 | </p> |
| 1741 | <div class="literalblock"> |
| 1742 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1743 | <pre><code> 'N' SP 'inline' SP <commit-ish> LF |
| 1744 | data</code></pre> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1745 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1746 | <div class="paragraph"><p>See below for a detailed description of the <code>data</code> command.</p></div> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1747 | </dd> |
| 1748 | </dl></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1749 | <div class="paragraph"><p>In both formats <code><commit-ish></code> is any of the commit specification |
| 1750 | expressions also accepted by <code>from</code> (see above).</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1751 | </div> |
| 1752 | </div> |
| 1753 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1754 | <h3 id="_code_mark_code"><code>mark</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1755 | <div class="paragraph"><p>Arranges for fast-import to save a reference to the current object, allowing |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1756 | the frontend to recall this object at a future point in time, without |
| 1757 | knowing its SHA-1. Here the current object is the object creation |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1758 | command the <code>mark</code> command appears within. This can be <code>commit</code>, |
| 1759 | <code>tag</code>, and <code>blob</code>, but <code>commit</code> is the most common usage.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1760 | <div class="literalblock"> |
| 1761 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1762 | <pre><code> 'mark' SP ':' <idnum> LF</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1763 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1764 | <div class="paragraph"><p>where <code><idnum></code> is the number assigned by the frontend to this mark. |
| 1765 | The value of <code><idnum></code> is expressed as an ASCII decimal integer. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1766 | The value 0 is reserved and cannot be used as |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1767 | a mark. Only values greater than or equal to 1 may be used as marks.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1768 | <div class="paragraph"><p>New marks are created automatically. Existing marks can be moved |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1769 | to another object simply by reusing the same <code><idnum></code> in another |
| 1770 | <code>mark</code> command.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1771 | </div> |
| 1772 | <div class="sect2"> |
Junio C Hamano | de48f45 | 2019-01-04 22:31:57 | [diff] [blame] | 1773 | <h3 id="_code_original_oid_code"><code>original-oid</code></h3> |
| 1774 | <div class="paragraph"><p>Provides the name of the object in the original source control system. |
| 1775 | fast-import will simply ignore this directive, but filter processes |
| 1776 | which operate on and modify the stream before feeding to fast-import |
| 1777 | may have uses for this information</p></div> |
| 1778 | <div class="literalblock"> |
| 1779 | <div class="content"> |
| 1780 | <pre><code> 'original-oid' SP <object-identifier> LF</code></pre> |
| 1781 | </div></div> |
Junio C Hamano | d128151 | 2020-10-05 22:21:55 | [diff] [blame] | 1782 | <div class="paragraph"><p>where <code><object-identifier></code> is any string not containing LF.</p></div> |
Junio C Hamano | de48f45 | 2019-01-04 22:31:57 | [diff] [blame] | 1783 | </div> |
| 1784 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1785 | <h3 id="_code_tag_code"><code>tag</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1786 | <div class="paragraph"><p>Creates an annotated tag referring to a specific commit. To create |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1787 | lightweight (non-annotated) tags see the <code>reset</code> command below.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1788 | <div class="literalblock"> |
| 1789 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1790 | <pre><code> 'tag' SP <name> LF |
Junio C Hamano | fa2a48b | 2019-10-15 05:24:40 | [diff] [blame] | 1791 | mark? |
Junio C Hamano | e6f28d0 | 2013-09-17 21:34:00 | [diff] [blame] | 1792 | 'from' SP <commit-ish> LF |
Junio C Hamano | de48f45 | 2019-01-04 22:31:57 | [diff] [blame] | 1793 | original-oid? |
Junio C Hamano | 6d325df | 2010-01-01 00:02:47 | [diff] [blame] | 1794 | 'tagger' (SP <name>)? SP LT <email> GT SP <when> LF |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1795 | data</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1796 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1797 | <div class="paragraph"><p>where <code><name></code> is the name of the tag to create.</p></div> |
| 1798 | <div class="paragraph"><p>Tag names are automatically prefixed with <code>refs/tags/</code> when stored |
| 1799 | in Git, so importing the CVS branch symbol <code>RELENG-1_0-FINAL</code> would |
| 1800 | use just <code>RELENG-1_0-FINAL</code> for <code><name></code>, and fast-import will write the |
| 1801 | corresponding ref as <code>refs/tags/RELENG-1_0-FINAL</code>.</p></div> |
| 1802 | <div class="paragraph"><p>The value of <code><name></code> must be a valid refname in Git and therefore |
| 1803 | may contain forward slashes. As <code>LF</code> is not valid in a Git refname, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1804 | no quoting or escaping syntax is supported here.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1805 | <div class="paragraph"><p>The <code>from</code> command is the same as in the <code>commit</code> command; see |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1806 | above for details.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1807 | <div class="paragraph"><p>The <code>tagger</code> command uses the same format as <code>committer</code> within |
| 1808 | <code>commit</code>; again see above for details.</p></div> |
| 1809 | <div class="paragraph"><p>The <code>data</code> command following <code>tagger</code> must supply the annotated tag |
| 1810 | message (see below for <code>data</code> command syntax). To import an empty |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1811 | tag message use a 0 length data. Tag messages are free-form and are |
| 1812 | not interpreted by Git. Currently they must be encoded in UTF-8, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1813 | as fast-import does not permit other encodings to be specified.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1814 | <div class="paragraph"><p>Signing annotated tags during import from within fast-import is not |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1815 | supported. Trying to include your own PGP/GPG signature is not |
| 1816 | recommended, as the frontend does not (easily) have access to the |
| 1817 | complete set of bytes which normally goes into such a signature. |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1818 | If signing is required, create lightweight tags from within fast-import with |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1819 | <code>reset</code>, then create the annotated versions of those tags offline |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1820 | with the standard <em>git tag</em> process.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1821 | </div> |
| 1822 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1823 | <h3 id="_code_reset_code"><code>reset</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1824 | <div class="paragraph"><p>Creates (or recreates) the named branch, optionally starting from |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1825 | a specific revision. The reset command allows a frontend to issue |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1826 | a new <code>from</code> command for an existing branch, or to create a new |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1827 | branch from an existing commit without creating a new commit.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1828 | <div class="literalblock"> |
| 1829 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1830 | <pre><code> 'reset' SP <ref> LF |
Junio C Hamano | e6f28d0 | 2013-09-17 21:34:00 | [diff] [blame] | 1831 | ('from' SP <commit-ish> LF)? |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1832 | LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1833 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1834 | <div class="paragraph"><p>For a detailed description of <code><ref></code> and <code><commit-ish></code> see above |
| 1835 | under <code>commit</code> and <code>from</code>.</p></div> |
| 1836 | <div class="paragraph"><p>The <code>LF</code> after the command is optional (it used to be required).</p></div> |
| 1837 | <div class="paragraph"><p>The <code>reset</code> command can also be used to create lightweight |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1838 | (non-annotated) tags. For example:</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1839 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1840 | <div class="content"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1841 | <div class="literalblock"> |
| 1842 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1843 | <pre><code>reset refs/tags/938 |
| 1844 | from :938</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1845 | </div></div> |
| 1846 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1847 | <div class="paragraph"><p>would create the lightweight tag <code>refs/tags/938</code> referring to |
| 1848 | whatever commit mark <code>:938</code> references.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1849 | </div> |
| 1850 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1851 | <h3 id="_code_blob_code"><code>blob</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1852 | <div class="paragraph"><p>Requests writing one file revision to the packfile. The revision |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1853 | is not connected to any commit; this connection must be formed in |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1854 | a subsequent <code>commit</code> command by referencing the blob through an |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1855 | assigned mark.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1856 | <div class="literalblock"> |
| 1857 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1858 | <pre><code> 'blob' LF |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1859 | mark? |
Junio C Hamano | de48f45 | 2019-01-04 22:31:57 | [diff] [blame] | 1860 | original-oid? |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1861 | data</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1862 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1863 | <div class="paragraph"><p>The mark command is optional here as some frontends have chosen |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1864 | to generate the Git SHA-1 for the blob on their own, and feed that |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1865 | directly to <code>commit</code>. This is typically more work than it’s worth |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1866 | however, as marks are inexpensive to store and easy to use.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1867 | </div> |
| 1868 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1869 | <h3 id="_code_data_code"><code>data</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1870 | <div class="paragraph"><p>Supplies raw data (for use as blob/file content, commit messages, or |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1871 | annotated tag messages) to fast-import. Data can be supplied using an exact |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1872 | byte count or delimited with a terminating line. Real frontends |
| 1873 | intended for production-quality conversions should always use the |
| 1874 | exact byte count format, as it is more robust and performs better. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1875 | The delimited format is intended primarily for testing fast-import.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1876 | <div class="paragraph"><p>Comment lines appearing within the <code><raw></code> part of <code>data</code> commands |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1877 | are always taken to be part of the body of the data and are therefore |
| 1878 | never ignored by fast-import. This makes it safe to import any |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1879 | file/message content whose lines might start with <code>#</code>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1880 | <div class="dlist"><dl> |
| 1881 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1882 | Exact byte count format |
| 1883 | </dt> |
| 1884 | <dd> |
| 1885 | <p> |
| 1886 | The frontend must specify the number of bytes of data. |
| 1887 | </p> |
| 1888 | <div class="literalblock"> |
| 1889 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1890 | <pre><code> 'data' SP <count> LF |
| 1891 | <raw> LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1892 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1893 | <div class="paragraph"><p>where <code><count></code> is the exact number of bytes appearing within |
| 1894 | <code><raw></code>. The value of <code><count></code> is expressed as an ASCII decimal |
| 1895 | integer. The <code>LF</code> on either side of <code><raw></code> is not |
| 1896 | included in <code><count></code> and will not be included in the imported data.</p></div> |
| 1897 | <div class="paragraph"><p>The <code>LF</code> after <code><raw></code> is optional (it used to be required) but |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1898 | recommended. Always including it makes debugging a fast-import |
| 1899 | stream easier as the next command always starts in column 0 |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1900 | of the next line, even if <code><raw></code> did not end with an <code>LF</code>.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1901 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1902 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1903 | Delimited format |
| 1904 | </dt> |
| 1905 | <dd> |
| 1906 | <p> |
| 1907 | A delimiter string is used to mark the end of the data. |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1908 | fast-import will compute the length by searching for the delimiter. |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 1909 | This format is primarily useful for testing and is not |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1910 | recommended for real data. |
| 1911 | </p> |
| 1912 | <div class="literalblock"> |
| 1913 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1914 | <pre><code> 'data' SP '<<' <delim> LF |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1915 | <raw> LF |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1916 | <delim> LF |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1917 | LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1918 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1919 | <div class="paragraph"><p>where <code><delim></code> is the chosen delimiter string. The string <code><delim></code> |
| 1920 | must not appear on a line by itself within <code><raw></code>, as otherwise |
| 1921 | fast-import will think the data ends earlier than it really does. The <code>LF</code> |
| 1922 | immediately trailing <code><raw></code> is part of <code><raw></code>. This is one of |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1923 | the limitations of the delimited format, it is impossible to supply |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1924 | a data chunk which does not have an LF as its last byte.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1925 | <div class="paragraph"><p>The <code>LF</code> after <code><delim> LF</code> is optional (it used to be required).</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1926 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1927 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1928 | </div> |
| 1929 | <div class="sect2"> |
Junio C Hamano | fa2a48b | 2019-10-15 05:24:40 | [diff] [blame] | 1930 | <h3 id="_code_alias_code"><code>alias</code></h3> |
| 1931 | <div class="paragraph"><p>Record that a mark refers to a given object without first creating any |
| 1932 | new object.</p></div> |
| 1933 | <div class="literalblock"> |
| 1934 | <div class="content"> |
| 1935 | <pre><code> 'alias' LF |
| 1936 | mark |
| 1937 | 'to' SP <commit-ish> LF |
| 1938 | LF?</code></pre> |
| 1939 | </div></div> |
| 1940 | <div class="paragraph"><p>For a detailed description of <code><commit-ish></code> see above under <code>from</code>.</p></div> |
| 1941 | </div> |
| 1942 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1943 | <h3 id="_code_checkpoint_code"><code>checkpoint</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1944 | <div class="paragraph"><p>Forces fast-import to close the current packfile, start a new one, and to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1945 | save out all current branch refs, tags and marks.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1946 | <div class="literalblock"> |
| 1947 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1948 | <pre><code> 'checkpoint' LF |
| 1949 | LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1950 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1951 | <div class="paragraph"><p>Note that fast-import automatically switches packfiles when the current |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1952 | packfile reaches --max-pack-size, or 4 GiB, whichever limit is |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1953 | smaller. During an automatic packfile switch fast-import does not update |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1954 | the branch refs, tags or marks.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1955 | <div class="paragraph"><p>As a <code>checkpoint</code> can require a significant amount of CPU time and |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1956 | disk IO (to compute the overall pack SHA-1 checksum, generate the |
| 1957 | corresponding index file, and update the refs) it can easily take |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1958 | several minutes for a single <code>checkpoint</code> command to complete.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1959 | <div class="paragraph"><p>Frontends may choose to issue checkpoints during extremely large |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1960 | and long running imports, or when they need to allow another Git |
| 1961 | process access to a branch. However given that a 30 GiB Subversion |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1962 | repository can be loaded into Git through fast-import in about 3 hours, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1963 | explicit checkpointing may not be necessary.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1964 | <div class="paragraph"><p>The <code>LF</code> after the command is optional (it used to be required).</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1965 | </div> |
| 1966 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1967 | <h3 id="_code_progress_code"><code>progress</code></h3> |
| 1968 | <div class="paragraph"><p>Causes fast-import to print the entire <code>progress</code> line unmodified to |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1969 | its standard output channel (file descriptor 1) when the command is |
| 1970 | processed from the input stream. The command otherwise has no impact |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1971 | on the current import, or on any of fast-import’s internal state.</p></div> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1972 | <div class="literalblock"> |
| 1973 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1974 | <pre><code> 'progress' SP <any> LF |
| 1975 | LF?</code></pre> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1976 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1977 | <div class="paragraph"><p>The <code><any></code> part of the command may contain any sequence of bytes |
| 1978 | that does not contain <code>LF</code>. The <code>LF</code> after the command is optional. |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1979 | Callers may wish to process the output through a tool such as sed to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1980 | remove the leading part of the line, for example:</p></div> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1981 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1982 | <div class="content"> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1983 | <div class="literalblock"> |
| 1984 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1985 | <pre><code>frontend | git fast-import | sed 's/^progress //'</code></pre> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1986 | </div></div> |
| 1987 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1988 | <div class="paragraph"><p>Placing a <code>progress</code> command immediately after a <code>checkpoint</code> will |
| 1989 | inform the reader when the <code>checkpoint</code> has been completed and it |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1990 | can safely access the refs that fast-import updated.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1991 | </div> |
| 1992 | <div class="sect2"> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 1993 | <h3 id="_code_get_mark_code"><code>get-mark</code></h3> |
| 1994 | <div class="paragraph"><p>Causes fast-import to print the SHA-1 corresponding to a mark to |
| 1995 | stdout or to the file descriptor previously arranged with the |
| 1996 | <code>--cat-blob-fd</code> argument. The command otherwise has no impact on the |
| 1997 | current import; its purpose is to retrieve SHA-1s that later commits |
| 1998 | might want to refer to in their commit messages.</p></div> |
| 1999 | <div class="literalblock"> |
| 2000 | <div class="content"> |
| 2001 | <pre><code> 'get-mark' SP ':' <idnum> LF</code></pre> |
| 2002 | </div></div> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 2003 | <div class="paragraph"><p>See “Responses To Commands” below for details about how to read |
| 2004 | this output safely.</p></div> |
| 2005 | </div> |
| 2006 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2007 | <h3 id="_code_cat_blob_code"><code>cat-blob</code></h3> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2008 | <div class="paragraph"><p>Causes fast-import to print a blob to a file descriptor previously |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2009 | arranged with the <code>--cat-blob-fd</code> argument. The command otherwise |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2010 | has no impact on the current import; its main purpose is to |
| 2011 | retrieve blobs that may be in fast-import’s memory but not |
| 2012 | accessible from the target repository.</p></div> |
| 2013 | <div class="literalblock"> |
| 2014 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2015 | <pre><code> 'cat-blob' SP <dataref> LF</code></pre> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2016 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2017 | <div class="paragraph"><p>The <code><dataref></code> can be either a mark reference (<code>:<idnum></code>) |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2018 | set previously or a full 40-byte SHA-1 of a Git blob, preexisting or |
| 2019 | ready to be written.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2020 | <div class="paragraph"><p>Output uses the same format as <code>git cat-file --batch</code>:</p></div> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2021 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2022 | <div class="content"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2023 | <div class="literalblock"> |
| 2024 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2025 | <pre><code><sha1> SP 'blob' SP <size> LF |
| 2026 | <contents> LF</code></pre> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2027 | </div></div> |
| 2028 | </div></div> |
Junio C Hamano | 2ba1471 | 2019-04-25 10:12:27 | [diff] [blame] | 2029 | <div class="paragraph"><p>This command can be used where a <code>filemodify</code> directive can appear, |
| 2030 | allowing it to be used in the middle of a commit. For a <code>filemodify</code> |
| 2031 | using an inline directive, it can also appear right before the <code>data</code> |
| 2032 | directive.</p></div> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2033 | <div class="paragraph"><p>See “Responses To Commands” below for details about how to read |
| 2034 | this output safely.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2035 | </div> |
| 2036 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2037 | <h3 id="_code_ls_code"><code>ls</code></h3> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2038 | <div class="paragraph"><p>Prints information about the object at a path to a file descriptor |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2039 | previously arranged with the <code>--cat-blob-fd</code> argument. This allows |
| 2040 | printing a blob from the active commit (with <code>cat-blob</code>) or copying a |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2041 | blob or tree from a previous commit for use in the current one (with |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2042 | <code>filemodify</code>).</p></div> |
Junio C Hamano | 2ba1471 | 2019-04-25 10:12:27 | [diff] [blame] | 2043 | <div class="paragraph"><p>The <code>ls</code> command can also be used where a <code>filemodify</code> directive can |
| 2044 | appear, allowing it to be used in the middle of a commit.</p></div> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2045 | <div class="dlist"><dl> |
| 2046 | <dt class="hdlist1"> |
| 2047 | Reading from the active commit |
| 2048 | </dt> |
| 2049 | <dd> |
| 2050 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2051 | This form can only be used in the middle of a <code>commit</code>. |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2052 | The path names a directory entry within fast-import’s |
| 2053 | active commit. The path must be quoted in this case. |
| 2054 | </p> |
| 2055 | <div class="literalblock"> |
| 2056 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2057 | <pre><code> 'ls' SP <path> LF</code></pre> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2058 | </div></div> |
| 2059 | </dd> |
| 2060 | <dt class="hdlist1"> |
| 2061 | Reading from a named tree |
| 2062 | </dt> |
| 2063 | <dd> |
| 2064 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2065 | The <code><dataref></code> can be a mark reference (<code>:<idnum></code>) or the |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2066 | full 40-byte SHA-1 of a Git tag, commit, or tree object, |
| 2067 | preexisting or waiting to be written. |
| 2068 | The path is relative to the top level of the tree |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2069 | named by <code><dataref></code>. |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2070 | </p> |
| 2071 | <div class="literalblock"> |
| 2072 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2073 | <pre><code> 'ls' SP <dataref> SP <path> LF</code></pre> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2074 | </div></div> |
| 2075 | </dd> |
| 2076 | </dl></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2077 | <div class="paragraph"><p>See <code>filemodify</code> above for a detailed description of <code><path></code>.</p></div> |
| 2078 | <div class="paragraph"><p>Output uses the same format as <code>git ls-tree <tree> -- <path></code>:</p></div> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2079 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2080 | <div class="content"> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2081 | <div class="literalblock"> |
| 2082 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2083 | <pre><code><mode> SP ('blob' | 'tree' | 'commit') SP <dataref> HT <path> LF</code></pre> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2084 | </div></div> |
| 2085 | </div></div> |
| 2086 | <div class="paragraph"><p>The <dataref> represents the blob, tree, or commit object at <path> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 2087 | and can be used in later <em>get-mark</em>, <em>cat-blob</em>, <em>filemodify</em>, or |
| 2088 | <em>ls</em> commands.</p></div> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2089 | <div class="paragraph"><p>If there is no file or subtree at that path, <em>git fast-import</em> will |
| 2090 | instead report</p></div> |
| 2091 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2092 | <div class="content"> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2093 | <div class="literalblock"> |
| 2094 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2095 | <pre><code>missing SP <path> LF</code></pre> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2096 | </div></div> |
| 2097 | </div></div> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2098 | <div class="paragraph"><p>See “Responses To Commands” below for details about how to read |
| 2099 | this output safely.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2100 | </div> |
| 2101 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2102 | <h3 id="_code_feature_code"><code>feature</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2103 | <div class="paragraph"><p>Require that fast-import supports the specified feature, or abort if |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2104 | it does not.</p></div> |
| 2105 | <div class="literalblock"> |
| 2106 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2107 | <pre><code> 'feature' SP <feature> ('=' <argument>)? LF</code></pre> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2108 | </div></div> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2109 | <div class="paragraph"><p>The <feature> part of the command may be any one of the following:</p></div> |
| 2110 | <div class="dlist"><dl> |
| 2111 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2112 | date-format |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2113 | </dt> |
| 2114 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2115 | export-marks |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2116 | </dt> |
| 2117 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2118 | relative-marks |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2119 | </dt> |
| 2120 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2121 | no-relative-marks |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2122 | </dt> |
| 2123 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2124 | force |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2125 | </dt> |
| 2126 | <dd> |
| 2127 | <p> |
| 2128 | Act as though the corresponding command-line option with |
Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2129 | a leading <code>--</code> was passed on the command line |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2130 | (see OPTIONS, above). |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2131 | </p> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2132 | </dd> |
| 2133 | <dt class="hdlist1"> |
| 2134 | import-marks |
| 2135 | </dt> |
Junio C Hamano | d8fa022 | 2011-08-26 16:18:15 | [diff] [blame] | 2136 | <dt class="hdlist1"> |
| 2137 | import-marks-if-exists |
| 2138 | </dt> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2139 | <dd> |
| 2140 | <p> |
| 2141 | Like --import-marks except in two respects: first, only one |
Junio C Hamano | d8fa022 | 2011-08-26 16:18:15 | [diff] [blame] | 2142 | "feature import-marks" or "feature import-marks-if-exists" |
| 2143 | command is allowed per stream; second, an --import-marks= |
| 2144 | or --import-marks-if-exists command-line option overrides |
| 2145 | any of these "feature" commands in the stream; third, |
| 2146 | "feature import-marks-if-exists" like a corresponding |
| 2147 | command-line option silently skips a nonexistent file. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2148 | </p> |
| 2149 | </dd> |
| 2150 | <dt class="hdlist1"> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 2151 | get-mark |
| 2152 | </dt> |
| 2153 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2154 | cat-blob |
| 2155 | </dt> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2156 | <dt class="hdlist1"> |
| 2157 | ls |
| 2158 | </dt> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2159 | <dd> |
| 2160 | <p> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 2161 | Require that the backend support the <em>get-mark</em>, <em>cat-blob</em>, |
| 2162 | or <em>ls</em> command respectively. |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2163 | Versions of fast-import not supporting the specified command |
| 2164 | will exit with a message indicating so. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2165 | This lets the import error out early with a clear message, |
| 2166 | rather than wasting time on the early part of an import |
| 2167 | before the unsupported command is detected. |
| 2168 | </p> |
| 2169 | </dd> |
Junio C Hamano | 23e3f53 | 2011-02-10 02:05:29 | [diff] [blame] | 2170 | <dt class="hdlist1"> |
| 2171 | notes |
| 2172 | </dt> |
| 2173 | <dd> |
| 2174 | <p> |
| 2175 | Require that the backend support the <em>notemodify</em> (N) |
| 2176 | subcommand to the <em>commit</em> command. |
| 2177 | Versions of fast-import not supporting notes will exit |
| 2178 | with a message indicating so. |
| 2179 | </p> |
| 2180 | </dd> |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 2181 | <dt class="hdlist1"> |
| 2182 | done |
| 2183 | </dt> |
| 2184 | <dd> |
| 2185 | <p> |
| 2186 | Error out if the stream ends without a <em>done</em> command. |
| 2187 | Without this feature, errors causing the frontend to end |
| 2188 | abruptly at a convenient point in the stream can go |
Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 2189 | undetected. This may occur, for example, if an import |
| 2190 | front end dies in mid-operation without emitting SIGTERM |
| 2191 | or SIGKILL at its subordinate git fast-import instance. |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 2192 | </p> |
| 2193 | </dd> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2194 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2195 | </div> |
| 2196 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2197 | <h3 id="_code_option_code"><code>option</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2198 | <div class="paragraph"><p>Processes the specified option so that git fast-import behaves in a |
| 2199 | way that suits the frontend’s needs. |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2200 | Note that options specified by the frontend are overridden by any |
| 2201 | options the user may specify to git fast-import itself.</p></div> |
| 2202 | <div class="literalblock"> |
| 2203 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2204 | <pre><code> 'option' SP <option> LF</code></pre> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2205 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2206 | <div class="paragraph"><p>The <code><option></code> part of the command may contain any of the options |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2207 | listed in the OPTIONS section that do not change import semantics, |
Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2208 | without the leading <code>--</code> and is treated in the same way.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2209 | <div class="paragraph"><p>Option commands must be the first commands on the input (not counting |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2210 | feature commands), to give an option command after any non-option |
| 2211 | command is an error.</p></div> |
Junio C Hamano | e1aeb5e | 2014-06-06 19:16:29 | [diff] [blame] | 2212 | <div class="paragraph"><p>The following command-line options change import semantics and may therefore |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2213 | not be passed as option:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2214 | <div class="ulist"><ul> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2215 | <li> |
| 2216 | <p> |
| 2217 | date-format |
| 2218 | </p> |
| 2219 | </li> |
| 2220 | <li> |
| 2221 | <p> |
| 2222 | import-marks |
| 2223 | </p> |
| 2224 | </li> |
| 2225 | <li> |
| 2226 | <p> |
| 2227 | export-marks |
| 2228 | </p> |
| 2229 | </li> |
| 2230 | <li> |
| 2231 | <p> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2232 | cat-blob-fd |
| 2233 | </p> |
| 2234 | </li> |
| 2235 | <li> |
| 2236 | <p> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2237 | force |
| 2238 | </p> |
| 2239 | </li> |
| 2240 | </ul></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2241 | </div> |
| 2242 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2243 | <h3 id="_code_done_code"><code>done</code></h3> |
| 2244 | <div class="paragraph"><p>If the <code>done</code> feature is not in use, treated as if EOF was read. |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 2245 | This can be used to tell fast-import to finish early.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2246 | <div class="paragraph"><p>If the <code>--done</code> command-line option or <code>feature done</code> command is |
| 2247 | in use, the <code>done</code> command is mandatory and marks the end of the |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 2248 | stream.</p></div> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2249 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2250 | </div> |
| 2251 | </div> |
| 2252 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 2253 | <h2 id="_responses_to_commands">RESPONSES TO COMMANDS</h2> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2254 | <div class="sectionbody"> |
| 2255 | <div class="paragraph"><p>New objects written by fast-import are not available immediately. |
| 2256 | Most fast-import commands have no visible effect until the next |
| 2257 | checkpoint (or completion). The frontend can send commands to |
| 2258 | fill fast-import’s input pipe without worrying about how quickly |
| 2259 | they will take effect, which improves performance by simplifying |
| 2260 | scheduling.</p></div> |
| 2261 | <div class="paragraph"><p>For some frontends, though, it is useful to be able to read back |
| 2262 | data from the current repository as it is being updated (for |
| 2263 | example when the source material describes objects in terms of |
| 2264 | patches to be applied to previously imported objects). This can |
| 2265 | be accomplished by connecting the frontend and fast-import via |
| 2266 | bidirectional pipes:</p></div> |
| 2267 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2268 | <div class="content"> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2269 | <div class="literalblock"> |
| 2270 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2271 | <pre><code>mkfifo fast-import-output |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2272 | frontend <fast-import-output | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2273 | git fast-import >fast-import-output</code></pre> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2274 | </div></div> |
| 2275 | </div></div> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 2276 | <div class="paragraph"><p>A frontend set up this way can use <code>progress</code>, <code>get-mark</code>, <code>ls</code>, and |
| 2277 | <code>cat-blob</code> commands to read information from the import in progress.</p></div> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2278 | <div class="paragraph"><p>To avoid deadlock, such frontends must completely consume any |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 2279 | pending output from <code>progress</code>, <code>ls</code>, <code>get-mark</code>, and <code>cat-blob</code> before |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2280 | performing writes to fast-import that might block.</p></div> |
| 2281 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2282 | </div> |
| 2283 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 2284 | <h2 id="_crash_reports">CRASH REPORTS</h2> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2285 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2286 | <div class="paragraph"><p>If fast-import is supplied invalid input it will terminate with a |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2287 | non-zero exit status and create a crash report in the top level of |
| 2288 | the Git repository it was importing into. Crash reports contain |
| 2289 | a snapshot of the internal fast-import state as well as the most |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2290 | recent commands that lead up to the crash.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2291 | <div class="paragraph"><p>All recent commands (including stream comments, file changes and |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2292 | progress commands) are shown in the command history within the crash |
| 2293 | report, but raw file data and commit messages are excluded from the |
| 2294 | crash report. This exclusion saves space within the report file |
| 2295 | and reduces the amount of buffering that fast-import must perform |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2296 | during execution.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2297 | <div class="paragraph"><p>After writing a crash report fast-import will close the current |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2298 | packfile and export the marks table. This allows the frontend |
| 2299 | developer to inspect the repository state and resume the import from |
| 2300 | the point where it crashed. The modified branches and tags are not |
| 2301 | updated during a crash, as the import did not complete successfully. |
| 2302 | Branch and tag information can be found in the crash report and |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2303 | must be applied manually if the update is needed.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2304 | <div class="paragraph"><p>An example crash:</p></div> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2305 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2306 | <div class="content"> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2307 | <div class="literalblock"> |
| 2308 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2309 | <pre><code>$ cat >in <<END_OF_INPUT |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2310 | # my very first test commit |
| 2311 | commit refs/heads/master |
| 2312 | committer Shawn O. Pearce <spearce> 19283 -0400 |
| 2313 | # who is that guy anyway? |
| 2314 | data <<EOF |
| 2315 | this is my commit |
| 2316 | EOF |
| 2317 | M 644 inline .gitignore |
| 2318 | data <<EOF |
| 2319 | .gitignore |
| 2320 | EOF |
| 2321 | M 777 inline bob |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2322 | END_OF_INPUT</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2323 | </div></div> |
| 2324 | <div class="literalblock"> |
| 2325 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2326 | <pre><code>$ git fast-import <in |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2327 | fatal: Corrupt mode: M 777 inline bob |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2328 | fast-import: dumping crash report to .git/fast_import_crash_8434</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2329 | </div></div> |
| 2330 | <div class="literalblock"> |
| 2331 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2332 | <pre><code>$ cat .git/fast_import_crash_8434 |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2333 | fast-import crash report: |
| 2334 | fast-import process: 8434 |
| 2335 | parent process : 1391 |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2336 | at Sat Sep 1 00:58:12 2007</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2337 | </div></div> |
| 2338 | <div class="literalblock"> |
| 2339 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2340 | <pre><code>fatal: Corrupt mode: M 777 inline bob</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2341 | </div></div> |
| 2342 | <div class="literalblock"> |
| 2343 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2344 | <pre><code>Most Recent Commands Before Crash |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2345 | --------------------------------- |
| 2346 | # my very first test commit |
| 2347 | commit refs/heads/master |
| 2348 | committer Shawn O. Pearce <spearce> 19283 -0400 |
| 2349 | # who is that guy anyway? |
| 2350 | data <<EOF |
| 2351 | M 644 inline .gitignore |
| 2352 | data <<EOF |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2353 | * M 777 inline bob</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2354 | </div></div> |
| 2355 | <div class="literalblock"> |
| 2356 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2357 | <pre><code>Active Branch LRU |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2358 | ----------------- |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2359 | active_branches = 1 cur, 5 max</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2360 | </div></div> |
| 2361 | <div class="literalblock"> |
| 2362 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2363 | <pre><code>pos clock name |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2364 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2365 | 1) 0 refs/heads/master</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2366 | </div></div> |
| 2367 | <div class="literalblock"> |
| 2368 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2369 | <pre><code>Inactive Branches |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2370 | ----------------- |
| 2371 | refs/heads/master: |
| 2372 | status : active loaded dirty |
| 2373 | tip commit : 0000000000000000000000000000000000000000 |
| 2374 | old tree : 0000000000000000000000000000000000000000 |
| 2375 | cur tree : 0000000000000000000000000000000000000000 |
| 2376 | commit clock: 0 |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2377 | last pack :</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2378 | </div></div> |
| 2379 | <div class="literalblock"> |
| 2380 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2381 | <pre><code>------------------- |
| 2382 | END OF CRASH REPORT</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2383 | </div></div> |
| 2384 | </div></div> |
| 2385 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2386 | </div> |
| 2387 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 2388 | <h2 id="_tips_and_tricks">TIPS AND TRICKS</h2> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2389 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2390 | <div class="paragraph"><p>The following tips and tricks have been collected from various |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2391 | users of fast-import, and are offered here as suggestions.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2392 | <div class="sect2"> |
| 2393 | <h3 id="_use_one_mark_per_commit">Use One Mark Per Commit</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2394 | <div class="paragraph"><p>When doing a repository conversion, use a unique mark per commit |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2395 | (<code>mark :<n></code>) and supply the --export-marks option on the command |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2396 | line. fast-import will dump a file which lists every mark and the Git |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2397 | object SHA-1 that corresponds to it. If the frontend can tie |
| 2398 | the marks back to the source repository, it is easy to verify the |
| 2399 | accuracy and completeness of the import by comparing each Git |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2400 | commit to the corresponding source revision.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2401 | <div class="paragraph"><p>Coming from a system such as Perforce or Subversion this should be |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2402 | quite simple, as the fast-import mark can also be the Perforce changeset |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2403 | number or the Subversion revision number.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2404 | </div> |
| 2405 | <div class="sect2"> |
| 2406 | <h3 id="_freely_skip_around_branches">Freely Skip Around Branches</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2407 | <div class="paragraph"><p>Don’t bother trying to optimize the frontend to stick to one branch |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2408 | at a time during an import. Although doing so might be slightly |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2409 | faster for fast-import, it tends to increase the complexity of the frontend |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2410 | code considerably.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2411 | <div class="paragraph"><p>The branch LRU builtin to fast-import tends to behave very well, and the |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2412 | cost of activating an inactive branch is so low that bouncing around |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2413 | between branches has virtually no impact on import performance.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2414 | </div> |
| 2415 | <div class="sect2"> |
| 2416 | <h3 id="_handling_renames">Handling Renames</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2417 | <div class="paragraph"><p>When importing a renamed file or directory, simply delete the old |
Junio C Hamano | 9dd8bb0 | 2007-02-12 07:15:35 | [diff] [blame] | 2418 | name(s) and modify the new name(s) during the corresponding commit. |
| 2419 | Git performs rename detection after-the-fact, rather than explicitly |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2420 | during a commit.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2421 | </div> |
| 2422 | <div class="sect2"> |
| 2423 | <h3 id="_use_tag_fixup_branches">Use Tag Fixup Branches</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2424 | <div class="paragraph"><p>Some other SCM systems let the user create a tag from multiple |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2425 | files which are not from the same commit/changeset. Or to create |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2426 | tags which are a subset of the files available in the repository.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2427 | <div class="paragraph"><p>Importing these tags as-is in Git is impossible without making at |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2428 | least one commit which “fixes up” the files to match the content |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2429 | of the tag. Use fast-import’s <code>reset</code> command to reset a dummy branch |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2430 | outside of your normal branch space to the base commit for the tag, |
| 2431 | then commit one or more file fixup commits, and finally tag the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2432 | dummy branch.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2433 | <div class="paragraph"><p>For example since all normal branches are stored under <code>refs/heads/</code> |
| 2434 | name the tag fixup branch <code>TAG_FIXUP</code>. This way it is impossible for |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2435 | the fixup branch used by the importer to have namespace conflicts |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2436 | with real branches imported from the source (the name <code>TAG_FIXUP</code> |
| 2437 | is not <code>refs/heads/TAG_FIXUP</code>).</p></div> |
| 2438 | <div class="paragraph"><p>When committing fixups, consider using <code>merge</code> to connect the |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2439 | commit(s) which are supplying file revisions to the fixup branch. |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 2440 | Doing so will allow tools such as <em>git blame</em> to track |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2441 | through the real commit history and properly annotate the source |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2442 | files.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2443 | <div class="paragraph"><p>After fast-import terminates the frontend will need to do <code>rm .git/TAG_FIXUP</code> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2444 | to remove the dummy branch.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2445 | </div> |
| 2446 | <div class="sect2"> |
| 2447 | <h3 id="_import_now_repack_later">Import Now, Repack Later</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2448 | <div class="paragraph"><p>As soon as fast-import completes the Git repository is completely valid |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 2449 | and ready for use. Typically this takes only a very short time, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2450 | even for considerably large projects (100,000+ commits).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2451 | <div class="paragraph"><p>However repacking the repository is necessary to improve data |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2452 | locality and access performance. It can also take hours on extremely |
| 2453 | large projects (especially if -f and a large --window parameter is |
| 2454 | used). Since repacking is safe to run alongside readers and writers, |
| 2455 | run the repack in the background and let it finish when it finishes. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2456 | There is no reason to wait to explore your new Git project!</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2457 | <div class="paragraph"><p>If you choose to wait for the repack, don’t try to run benchmarks |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2458 | or performance tests until repacking is completed. fast-import outputs |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2459 | suboptimal packfiles that are simply never seen in real use |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2460 | situations.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2461 | </div> |
| 2462 | <div class="sect2"> |
| 2463 | <h3 id="_repacking_historical_data">Repacking Historical Data</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2464 | <div class="paragraph"><p>If you are repacking very old imported data (e.g. older than the |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2465 | last year), consider expending some extra CPU time and supplying |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 2466 | --window=50 (or higher) when you run <em>git repack</em>. |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2467 | This will take longer, but will also produce a smaller packfile. |
| 2468 | You only need to expend the effort once, and everyone using your |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2469 | project will benefit from the smaller repository.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2470 | </div> |
| 2471 | <div class="sect2"> |
| 2472 | <h3 id="_include_some_progress_messages">Include Some Progress Messages</h3> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2473 | <div class="paragraph"><p>Every once in a while have your frontend emit a <code>progress</code> message |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 2474 | to fast-import. The contents of the messages are entirely free-form, |
| 2475 | so one suggestion would be to output the current month and year |
| 2476 | each time the current commit date moves into the next month. |
| 2477 | Your users will feel better knowing how much of the data stream |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2478 | has been processed.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2479 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2480 | </div> |
| 2481 | </div> |
| 2482 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 2483 | <h2 id="_packfile_optimization">PACKFILE OPTIMIZATION</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2484 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2485 | <div class="paragraph"><p>When packing a blob fast-import always attempts to deltify against the last |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2486 | blob written. Unless specifically arranged for by the frontend, |
| 2487 | this will probably not be a prior version of the same file, so the |
| 2488 | generated delta will not be the smallest possible. The resulting |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2489 | packfile will be compressed, but will not be optimal.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2490 | <div class="paragraph"><p>Frontends which have efficient access to all revisions of a |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2491 | single file (for example reading an RCS/CVS ,v file) can choose |
| 2492 | to supply all revisions of that file as a sequence of consecutive |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2493 | <code>blob</code> commands. This allows fast-import to deltify the different file |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2494 | revisions against each other, saving space in the final packfile. |
| 2495 | Marks can be used to later identify individual file revisions during |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2496 | a sequence of <code>commit</code> commands.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2497 | <div class="paragraph"><p>The packfile(s) created by fast-import do not encourage good disk access |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2498 | patterns. This is caused by fast-import writing the data in the order |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2499 | it is received on standard input, while Git typically organizes |
| 2500 | data within packfiles to make the most recent (current tip) data |
| 2501 | appear before historical data. Git also clusters commits together, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2502 | speeding up revision traversal through better cache locality.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2503 | <div class="paragraph"><p>For this reason it is strongly recommended that users repack the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2504 | repository with <code>git repack -a -d</code> after fast-import completes, allowing |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2505 | Git to reorganize the packfiles for faster data access. If blob |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2506 | deltas are suboptimal (see above) then also adding the <code>-f</code> option |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2507 | to force recomputation of all deltas can significantly reduce the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2508 | final packfile size (30-50% smaller can be quite typical).</p></div> |
Junio C Hamano | 2ba1471 | 2019-04-25 10:12:27 | [diff] [blame] | 2509 | <div class="paragraph"><p>Instead of running <code>git repack</code> you can also run <code>git gc |
| 2510 | --aggressive</code>, which will also optimize other things after an import |
| 2511 | (e.g. pack loose refs). As noted in the "AGGRESSIVE" section in |
| 2512 | <a href="git-gc.html">git-gc(1)</a> the <code>--aggressive</code> option will find new deltas with |
| 2513 | the <code>-f</code> option to <a href="git-repack.html">git-repack(1)</a>. For the reasons elaborated |
| 2514 | on above using <code>--aggressive</code> after a fast-import is one of the few |
| 2515 | cases where it’s known to be worthwhile.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2516 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2517 | </div> |
| 2518 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 2519 | <h2 id="_memory_utilization">MEMORY UTILIZATION</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2520 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2521 | <div class="paragraph"><p>There are a number of factors which affect how much memory fast-import |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2522 | requires to perform an import. Like critical sections of core |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 2523 | Git, fast-import uses its own memory allocators to amortize any overheads |
| 2524 | associated with malloc. In practice fast-import tends to amortize any |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2525 | malloc overheads to 0, due to its use of large block allocations.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2526 | <div class="sect2"> |
| 2527 | <h3 id="_per_object">per object</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2528 | <div class="paragraph"><p>fast-import maintains an in-memory structure for every object written in |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2529 | this execution. On a 32 bit system the structure is 32 bytes, |
| 2530 | on a 64 bit system the structure is 40 bytes (due to the larger |
| 2531 | pointer sizes). Objects in the table are not deallocated until |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2532 | fast-import terminates. Importing 2 million objects on a 32 bit system |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2533 | will require approximately 64 MiB of memory.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2534 | <div class="paragraph"><p>The object table is actually a hashtable keyed on the object name |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2535 | (the unique SHA-1). This storage configuration allows fast-import to reuse |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2536 | an existing or already written object and avoid writing duplicates |
| 2537 | to the output packfile. Duplicate blobs are surprisingly common |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2538 | in an import, typically due to branch merges in the source.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2539 | </div> |
| 2540 | <div class="sect2"> |
| 2541 | <h3 id="_per_mark">per mark</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2542 | <div class="paragraph"><p>Marks are stored in a sparse array, using 1 pointer (4 bytes or 8 |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2543 | bytes, depending on pointer size) per mark. Although the array |
| 2544 | is sparse, frontends are still strongly encouraged to use marks |
| 2545 | between 1 and n, where n is the total number of marks required for |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2546 | this import.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2547 | </div> |
| 2548 | <div class="sect2"> |
| 2549 | <h3 id="_per_branch">per branch</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2550 | <div class="paragraph"><p>Branches are classified as active and inactive. The memory usage |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2551 | of the two classes is significantly different.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2552 | <div class="paragraph"><p>Inactive branches are stored in a structure which uses 96 or 120 |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2553 | bytes (32 bit or 64 bit systems, respectively), plus the length of |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2554 | the branch name (typically under 200 bytes), per branch. fast-import will |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2555 | easily handle as many as 10,000 inactive branches in under 2 MiB |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2556 | of memory.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2557 | <div class="paragraph"><p>Active branches have the same overhead as inactive branches, but |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2558 | also contain copies of every tree that has been recently modified on |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2559 | that branch. If subtree <code>include</code> has not been modified since the |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2560 | branch became active, its contents will not be loaded into memory, |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2561 | but if subtree <code>src</code> has been modified by a commit since the branch |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2562 | became active, then its contents will be loaded in memory.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2563 | <div class="paragraph"><p>As active branches store metadata about the files contained on that |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2564 | branch, their in-memory storage size can grow to a considerable size |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2565 | (see below).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2566 | <div class="paragraph"><p>fast-import automatically moves active branches to inactive status based on |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2567 | a simple least-recently-used algorithm. The LRU chain is updated on |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2568 | each <code>commit</code> command. The maximum number of active branches can be |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2569 | increased or decreased on the command line with --active-branches=.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2570 | </div> |
| 2571 | <div class="sect2"> |
| 2572 | <h3 id="_per_active_tree">per active tree</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2573 | <div class="paragraph"><p>Trees (aka directories) use just 12 bytes of memory on top of the |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2574 | memory required for their entries (see “per active file” below). |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 2575 | The cost of a tree is virtually 0, as its overhead amortizes out |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2576 | over the individual file entries.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2577 | </div> |
| 2578 | <div class="sect2"> |
| 2579 | <h3 id="_per_active_file_entry">per active file entry</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2580 | <div class="paragraph"><p>Files (and pointers to subtrees) within active trees require 52 or 64 |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2581 | bytes (32/64 bit platforms) per entry. To conserve space, file and |
| 2582 | tree names are pooled in a common string table, allowing the filename |
| 2583 | “Makefile” to use just 16 bytes (after including the string header |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2584 | overhead) no matter how many times it occurs within the project.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2585 | <div class="paragraph"><p>The active branch LRU, when coupled with the filename string pool |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2586 | and lazy loading of subtrees, allows fast-import to efficiently import |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2587 | projects with 2,000+ branches and 45,114+ files in a very limited |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2588 | memory footprint (less than 2.7 MiB per active branch).</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2589 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2590 | </div> |
| 2591 | </div> |
| 2592 | <div class="sect1"> |
Junio C Hamano | b9d9d90 | 2018-05-23 07:07:42 | [diff] [blame] | 2593 | <h2 id="_signals">SIGNALS</h2> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2594 | <div class="sectionbody"> |
| 2595 | <div class="paragraph"><p>Sending <strong>SIGUSR1</strong> to the <em>git fast-import</em> process ends the current |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2596 | packfile early, simulating a <code>checkpoint</code> command. The impatient |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2597 | operator can use this facility to peek at the objects and refs from an |
| 2598 | import in progress, at the cost of some added running time and worse |
| 2599 | compression.</p></div> |
| 2600 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2601 | </div> |
| 2602 | <div class="sect1"> |
Junio C Hamano | ba8baee | 2022-09-14 20:25:23 | [diff] [blame] | 2603 | <h2 id="_configuration">CONFIGURATION</h2> |
| 2604 | <div class="sectionbody"> |
| 2605 | <div class="paragraph"><p>Everything below this line in this section is selectively included |
| 2606 | from the <a href="git-config.html">git-config(1)</a> documentation. The content is the same |
| 2607 | as what’s found there:</p></div> |
| 2608 | <div class="dlist"><dl> |
| 2609 | <dt class="hdlist1"> |
| 2610 | fastimport.unpackLimit |
| 2611 | </dt> |
| 2612 | <dd> |
| 2613 | <p> |
| 2614 | If the number of objects imported by <a href="git-fast-import.html">git-fast-import(1)</a> |
| 2615 | is below this limit, then the objects will be unpacked into |
| 2616 | loose object files. However if the number of imported objects |
| 2617 | equals or exceeds this limit then the pack will be stored as a |
| 2618 | pack. Storing the pack from a fast-import can make the import |
| 2619 | operation complete faster, especially on slow filesystems. If |
| 2620 | not set, the value of <code>transfer.unpackLimit</code> is used instead. |
| 2621 | </p> |
| 2622 | </dd> |
| 2623 | </dl></div> |
| 2624 | </div> |
| 2625 | </div> |
| 2626 | <div class="sect1"> |
Junio C Hamano | 1322024 | 2014-11-19 23:06:27 | [diff] [blame] | 2627 | <h2 id="_see_also">SEE ALSO</h2> |
| 2628 | <div class="sectionbody"> |
| 2629 | <div class="paragraph"><p><a href="git-fast-export.html">git-fast-export(1)</a></p></div> |
| 2630 | </div> |
| 2631 | </div> |
| 2632 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2633 | <h2 id="_git">GIT</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2634 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2635 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2636 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 2637 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2638 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 2639 | <div id="footnotes"><hr /></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2640 | <div id="footer"> |
| 2641 | <div id="footer-text"> |
Junio C Hamano | 2ef0ba3 | 2018-01-26 23:13:53 | [diff] [blame] | 2642 | Last updated |
Junio C Hamano | a7b2c10 | 2023-06-13 21:00:15 | [diff] [blame] | 2643 | 2022-09-14 13:23:11 PDT |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2644 | </div> |
| 2645 | </div> |
| 2646 | </body> |
| 2647 | </html> |