Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.6.9" /> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 7 | <title>git-fast-import(1)</title> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 8 | <style type="text/css"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 9 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 10 | |
| 11 | /* Default font. */ |
| 12 | body { |
| 13 | font-family: Georgia,serif; |
| 14 | } |
| 15 | |
| 16 | /* Title font. */ |
| 17 | h1, h2, h3, h4, h5, h6, |
| 18 | div.title, caption.title, |
| 19 | thead, p.table.header, |
| 20 | #toctitle, |
| 21 | #author, #revnumber, #revdate, #revremark, |
| 22 | #footer { |
| 23 | font-family: Arial,Helvetica,sans-serif; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | body { |
| 27 | margin: 1em 5% 1em 5%; |
| 28 | } |
| 29 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 30 | a { |
| 31 | color: blue; |
| 32 | text-decoration: underline; |
| 33 | } |
| 34 | a:visited { |
| 35 | color: fuchsia; |
| 36 | } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 37 | |
| 38 | em { |
| 39 | font-style: italic; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 40 | color: navy; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | strong { |
| 44 | font-weight: bold; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 45 | color: #083194; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 46 | } |
| 47 | |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 48 | h1, h2, h3, h4, h5, h6 { |
| 49 | color: #527bbd; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 50 | margin-top: 1.2em; |
| 51 | margin-bottom: 0.5em; |
| 52 | line-height: 1.3; |
| 53 | } |
| 54 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 55 | h1, h2, h3 { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 56 | border-bottom: 2px solid silver; |
| 57 | } |
| 58 | h2 { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 59 | padding-top: 0.5em; |
| 60 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 61 | h3 { |
| 62 | float: left; |
| 63 | } |
| 64 | h3 + * { |
| 65 | clear: left; |
| 66 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 67 | h5 { |
| 68 | font-size: 1.0em; |
| 69 | } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 70 | |
| 71 | div.sectionbody { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 72 | margin-left: 0; |
| 73 | } |
| 74 | |
| 75 | hr { |
| 76 | border: 1px solid silver; |
| 77 | } |
| 78 | |
| 79 | p { |
| 80 | margin-top: 0.5em; |
| 81 | margin-bottom: 0.5em; |
| 82 | } |
| 83 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 84 | ul, ol, li > p { |
| 85 | margin-top: 0; |
| 86 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 87 | ul > li { color: #aaa; } |
| 88 | ul > li > * { color: black; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 89 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 90 | .monospaced, code, pre { |
| 91 | font-family: "Courier New", Courier, monospace; |
| 92 | font-size: inherit; |
| 93 | color: navy; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 94 | padding: 0; |
| 95 | margin: 0; |
| 96 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 97 | pre { |
| 98 | white-space: pre-wrap; |
| 99 | } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 100 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 101 | #author { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 102 | color: #527bbd; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 103 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 104 | font-size: 1.1em; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 105 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 106 | #email { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 107 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 108 | #revnumber, #revdate, #revremark { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 109 | } |
| 110 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 111 | #footer { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 112 | font-size: small; |
| 113 | border-top: 2px solid silver; |
| 114 | padding-top: 0.5em; |
| 115 | margin-top: 4.0em; |
| 116 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 117 | #footer-text { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 118 | float: left; |
| 119 | padding-bottom: 0.5em; |
| 120 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 121 | #footer-badges { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 122 | float: right; |
| 123 | padding-bottom: 0.5em; |
| 124 | } |
| 125 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 126 | #preamble { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 127 | margin-top: 1.5em; |
| 128 | margin-bottom: 1.5em; |
| 129 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 130 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 131 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 132 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 133 | margin-top: 1.0em; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 134 | margin-bottom: 1.5em; |
| 135 | } |
| 136 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 137 | margin-top: 2.0em; |
| 138 | margin-bottom: 2.0em; |
| 139 | margin-right: 10%; |
| 140 | color: #606060; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | div.content { /* Block element content. */ |
| 144 | padding: 0; |
| 145 | } |
| 146 | |
| 147 | /* Block element titles. */ |
| 148 | div.title, caption.title { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 149 | color: #527bbd; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 150 | font-weight: bold; |
| 151 | text-align: left; |
| 152 | margin-top: 1.0em; |
| 153 | margin-bottom: 0.5em; |
| 154 | } |
| 155 | div.title + * { |
| 156 | margin-top: 0; |
| 157 | } |
| 158 | |
| 159 | td div.title:first-child { |
| 160 | margin-top: 0.0em; |
| 161 | } |
| 162 | div.content div.title:first-child { |
| 163 | margin-top: 0.0em; |
| 164 | } |
| 165 | div.content + div.title { |
| 166 | margin-top: 0.0em; |
| 167 | } |
| 168 | |
| 169 | div.sidebarblock > div.content { |
| 170 | background: #ffffee; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 171 | border: 1px solid #dddddd; |
| 172 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 173 | padding: 0.5em; |
| 174 | } |
| 175 | |
| 176 | div.listingblock > div.content { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 177 | border: 1px solid #dddddd; |
| 178 | border-left: 5px solid #f0f0f0; |
| 179 | background: #f8f8f8; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 180 | padding: 0.5em; |
| 181 | } |
| 182 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 183 | div.quoteblock, div.verseblock { |
| 184 | padding-left: 1.0em; |
| 185 | margin-left: 1.0em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 186 | margin-right: 10%; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 187 | border-left: 5px solid #f0f0f0; |
| 188 | color: #888; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 189 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 190 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 191 | div.quoteblock > div.attribution { |
| 192 | padding-top: 0.5em; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 193 | text-align: right; |
| 194 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 195 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 196 | div.verseblock > pre.content { |
| 197 | font-family: inherit; |
| 198 | font-size: inherit; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 199 | } |
| 200 | div.verseblock > div.attribution { |
| 201 | padding-top: 0.75em; |
| 202 | text-align: left; |
| 203 | } |
| 204 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 205 | div.verseblock + div.attribution { |
| 206 | text-align: left; |
| 207 | } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 208 | |
| 209 | div.admonitionblock .icon { |
| 210 | vertical-align: top; |
| 211 | font-size: 1.1em; |
| 212 | font-weight: bold; |
| 213 | text-decoration: underline; |
| 214 | color: #527bbd; |
| 215 | padding-right: 0.5em; |
| 216 | } |
| 217 | div.admonitionblock td.content { |
| 218 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 219 | border-left: 3px solid #dddddd; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 223 | border-left: 3px solid #dddddd; |
| 224 | padding-left: 0.5em; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 225 | } |
| 226 | |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 227 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 228 | span.image img { border-style: none; vertical-align: text-bottom; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 229 | a.image:visited { color: white; } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 230 | |
| 231 | dl { |
| 232 | margin-top: 0.8em; |
| 233 | margin-bottom: 0.8em; |
| 234 | } |
| 235 | dt { |
| 236 | margin-top: 0.5em; |
| 237 | margin-bottom: 0; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 238 | font-style: normal; |
| 239 | color: navy; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 240 | } |
| 241 | dd > *:first-child { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 242 | margin-top: 0.1em; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | ul, ol { |
| 246 | list-style-position: outside; |
| 247 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 248 | ol.arabic { |
| 249 | list-style-type: decimal; |
| 250 | } |
| 251 | ol.loweralpha { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 252 | list-style-type: lower-alpha; |
| 253 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 254 | ol.upperalpha { |
| 255 | list-style-type: upper-alpha; |
| 256 | } |
| 257 | ol.lowerroman { |
| 258 | list-style-type: lower-roman; |
| 259 | } |
| 260 | ol.upperroman { |
| 261 | list-style-type: upper-roman; |
| 262 | } |
| 263 | |
| 264 | div.compact ul, div.compact ol, |
| 265 | div.compact p, div.compact p, |
| 266 | div.compact div, div.compact div { |
| 267 | margin-top: 0.1em; |
| 268 | margin-bottom: 0.1em; |
| 269 | } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 270 | |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 271 | tfoot { |
| 272 | font-weight: bold; |
| 273 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 274 | td > div.verse { |
| 275 | white-space: pre; |
| 276 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 277 | |
| 278 | div.hdlist { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 279 | margin-top: 0.8em; |
| 280 | margin-bottom: 0.8em; |
| 281 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 282 | div.hdlist tr { |
| 283 | padding-bottom: 15px; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 284 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 285 | dt.hdlist1.strong, td.hdlist1.strong { |
| 286 | font-weight: bold; |
| 287 | } |
| 288 | td.hdlist1 { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 289 | vertical-align: top; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 290 | font-style: normal; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 291 | padding-right: 0.8em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 292 | color: navy; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 293 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 294 | td.hdlist2 { |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 295 | vertical-align: top; |
| 296 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 297 | div.hdlist.compact tr { |
| 298 | margin: 0; |
| 299 | padding-bottom: 0; |
| 300 | } |
| 301 | |
| 302 | .comment { |
| 303 | background: yellow; |
| 304 | } |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 305 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 306 | .footnote, .footnoteref { |
| 307 | font-size: 0.8em; |
| 308 | } |
| 309 | |
| 310 | span.footnote, span.footnoteref { |
| 311 | vertical-align: super; |
| 312 | } |
| 313 | |
| 314 | #footnotes { |
| 315 | margin: 20px 0 20px 0; |
| 316 | padding: 7px 0 0 0; |
| 317 | } |
| 318 | |
| 319 | #footnotes div.footnote { |
| 320 | margin: 0 0 5px 0; |
| 321 | } |
| 322 | |
| 323 | #footnotes hr { |
| 324 | border: none; |
| 325 | border-top: 1px solid silver; |
| 326 | height: 1px; |
| 327 | text-align: left; |
| 328 | margin-left: 0; |
| 329 | width: 20%; |
| 330 | min-width: 100px; |
| 331 | } |
| 332 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 333 | div.colist td { |
| 334 | padding-right: 0.5em; |
| 335 | padding-bottom: 0.3em; |
| 336 | vertical-align: top; |
| 337 | } |
| 338 | div.colist td img { |
| 339 | margin-top: 0.3em; |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 340 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 341 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 342 | @media print { |
| 343 | #footer-badges { display: none; } |
| 344 | } |
| 345 | |
| 346 | #toc { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 347 | margin-bottom: 2.5em; |
| 348 | } |
| 349 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 350 | #toctitle { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 351 | color: #527bbd; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 352 | font-size: 1.1em; |
| 353 | font-weight: bold; |
| 354 | margin-top: 1.0em; |
| 355 | margin-bottom: 0.1em; |
| 356 | } |
| 357 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 358 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 359 | margin-top: 0; |
| 360 | margin-bottom: 0; |
| 361 | } |
| 362 | div.toclevel2 { |
| 363 | margin-left: 2em; |
| 364 | font-size: 0.9em; |
| 365 | } |
| 366 | div.toclevel3 { |
| 367 | margin-left: 4em; |
| 368 | font-size: 0.9em; |
| 369 | } |
| 370 | div.toclevel4 { |
| 371 | margin-left: 6em; |
| 372 | font-size: 0.9em; |
| 373 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 374 | |
| 375 | span.aqua { color: aqua; } |
| 376 | span.black { color: black; } |
| 377 | span.blue { color: blue; } |
| 378 | span.fuchsia { color: fuchsia; } |
| 379 | span.gray { color: gray; } |
| 380 | span.green { color: green; } |
| 381 | span.lime { color: lime; } |
| 382 | span.maroon { color: maroon; } |
| 383 | span.navy { color: navy; } |
| 384 | span.olive { color: olive; } |
| 385 | span.purple { color: purple; } |
| 386 | span.red { color: red; } |
| 387 | span.silver { color: silver; } |
| 388 | span.teal { color: teal; } |
| 389 | span.white { color: white; } |
| 390 | span.yellow { color: yellow; } |
| 391 | |
| 392 | span.aqua-background { background: aqua; } |
| 393 | span.black-background { background: black; } |
| 394 | span.blue-background { background: blue; } |
| 395 | span.fuchsia-background { background: fuchsia; } |
| 396 | span.gray-background { background: gray; } |
| 397 | span.green-background { background: green; } |
| 398 | span.lime-background { background: lime; } |
| 399 | span.maroon-background { background: maroon; } |
| 400 | span.navy-background { background: navy; } |
| 401 | span.olive-background { background: olive; } |
| 402 | span.purple-background { background: purple; } |
| 403 | span.red-background { background: red; } |
| 404 | span.silver-background { background: silver; } |
| 405 | span.teal-background { background: teal; } |
| 406 | span.white-background { background: white; } |
| 407 | span.yellow-background { background: yellow; } |
| 408 | |
| 409 | span.big { font-size: 2em; } |
| 410 | span.small { font-size: 0.6em; } |
| 411 | |
| 412 | span.underline { text-decoration: underline; } |
| 413 | span.overline { text-decoration: overline; } |
| 414 | span.line-through { text-decoration: line-through; } |
| 415 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 416 | div.unbreakable { page-break-inside: avoid; } |
| 417 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 418 | |
| 419 | /* |
| 420 | * xhtml11 specific |
| 421 | * |
| 422 | * */ |
| 423 | |
| 424 | div.tableblock { |
| 425 | margin-top: 1.0em; |
| 426 | margin-bottom: 1.5em; |
| 427 | } |
| 428 | div.tableblock > table { |
| 429 | border: 3px solid #527bbd; |
| 430 | } |
| 431 | thead, p.table.header { |
| 432 | font-weight: bold; |
| 433 | color: #527bbd; |
| 434 | } |
| 435 | p.table { |
| 436 | margin-top: 0; |
| 437 | } |
| 438 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 439 | div.tableblock > table[frame="void"] { |
| 440 | border-style: none; |
| 441 | } |
| 442 | div.tableblock > table[frame="hsides"] { |
| 443 | border-left-style: none; |
| 444 | border-right-style: none; |
| 445 | } |
| 446 | div.tableblock > table[frame="vsides"] { |
| 447 | border-top-style: none; |
| 448 | border-bottom-style: none; |
| 449 | } |
| 450 | |
| 451 | |
| 452 | /* |
| 453 | * html5 specific |
| 454 | * |
| 455 | * */ |
| 456 | |
| 457 | table.tableblock { |
| 458 | margin-top: 1.0em; |
| 459 | margin-bottom: 1.5em; |
| 460 | } |
| 461 | thead, p.tableblock.header { |
| 462 | font-weight: bold; |
| 463 | color: #527bbd; |
| 464 | } |
| 465 | p.tableblock { |
| 466 | margin-top: 0; |
| 467 | } |
| 468 | table.tableblock { |
| 469 | border-width: 3px; |
| 470 | border-spacing: 0px; |
| 471 | border-style: solid; |
| 472 | border-color: #527bbd; |
| 473 | border-collapse: collapse; |
| 474 | } |
| 475 | th.tableblock, td.tableblock { |
| 476 | border-width: 1px; |
| 477 | padding: 4px; |
| 478 | border-style: solid; |
| 479 | border-color: #527bbd; |
| 480 | } |
| 481 | |
| 482 | table.tableblock.frame-topbot { |
| 483 | border-left-style: hidden; |
| 484 | border-right-style: hidden; |
| 485 | } |
| 486 | table.tableblock.frame-sides { |
| 487 | border-top-style: hidden; |
| 488 | border-bottom-style: hidden; |
| 489 | } |
| 490 | table.tableblock.frame-none { |
| 491 | border-style: hidden; |
| 492 | } |
| 493 | |
| 494 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 495 | text-align: left; |
| 496 | } |
| 497 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 498 | text-align: center; |
| 499 | } |
| 500 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 501 | text-align: right; |
| 502 | } |
| 503 | |
| 504 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 505 | vertical-align: top; |
| 506 | } |
| 507 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 508 | vertical-align: middle; |
| 509 | } |
| 510 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 511 | vertical-align: bottom; |
| 512 | } |
| 513 | |
| 514 | |
| 515 | /* |
| 516 | * manpage specific |
| 517 | * |
| 518 | * */ |
| 519 | |
| 520 | body.manpage h1 { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 521 | padding-top: 0.5em; |
| 522 | padding-bottom: 0.5em; |
| 523 | border-top: 2px solid silver; |
| 524 | border-bottom: 2px solid silver; |
| 525 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 526 | body.manpage h2 { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 527 | border-style: none; |
| 528 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 529 | body.manpage div.sectionbody { |
| 530 | margin-left: 3em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 531 | } |
| 532 | |
| 533 | @media print { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 534 | body.manpage div#toc { display: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 535 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 536 | |
| 537 | |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 538 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 539 | <script type="text/javascript"> |
| 540 | /*<![CDATA[*/ |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 541 | var asciidoc = { // Namespace. |
| 542 | |
| 543 | ///////////////////////////////////////////////////////////////////// |
| 544 | // Table Of Contents generator |
| 545 | ///////////////////////////////////////////////////////////////////// |
| 546 | |
| 547 | /* Author: Mihai Bazon, September 2002 |
| 548 | * http://students.infoiasi.ro/~mishoo |
| 549 | * |
| 550 | * Table Of Content generator |
| 551 | * Version: 0.4 |
| 552 | * |
| 553 | * Feel free to use this script under the terms of the GNU General Public |
| 554 | * License, as long as you do not remove or alter this notice. |
| 555 | */ |
| 556 | |
| 557 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 558 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 559 | |
| 560 | // toclevels = 1..4. |
| 561 | toc: function (toclevels) { |
| 562 | |
| 563 | function getText(el) { |
| 564 | var text = ""; |
| 565 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 566 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 567 | text += i.data; |
| 568 | else if (i.firstChild != null) |
| 569 | text += getText(i); |
| 570 | } |
| 571 | return text; |
| 572 | } |
| 573 | |
| 574 | function TocEntry(el, text, toclevel) { |
| 575 | this.element = el; |
| 576 | this.text = text; |
| 577 | this.toclevel = toclevel; |
| 578 | } |
| 579 | |
| 580 | function tocEntries(el, toclevels) { |
| 581 | var result = new Array; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 582 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 583 | // Function that scans the DOM tree for header elements (the DOM2 |
| 584 | // nodeIterator API would be a better technique but not supported by all |
| 585 | // browsers). |
| 586 | var iterate = function (el) { |
| 587 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 588 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 589 | var mo = re.exec(i.tagName); |
| 590 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 591 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 592 | } |
| 593 | iterate(i); |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | iterate(el); |
| 598 | return result; |
| 599 | } |
| 600 | |
| 601 | var toc = document.getElementById("toc"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 602 | if (!toc) { |
| 603 | return; |
| 604 | } |
| 605 | |
| 606 | // Delete existing TOC entries in case we're reloading the TOC. |
| 607 | var tocEntriesToRemove = []; |
| 608 | var i; |
| 609 | for (i = 0; i < toc.childNodes.length; i++) { |
| 610 | var entry = toc.childNodes[i]; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 611 | if (entry.nodeName.toLowerCase() == 'div' |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 612 | && entry.getAttribute("class") |
| 613 | && entry.getAttribute("class").match(/^toclevel/)) |
| 614 | tocEntriesToRemove.push(entry); |
| 615 | } |
| 616 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 617 | toc.removeChild(tocEntriesToRemove[i]); |
| 618 | } |
| 619 | |
| 620 | // Rebuild TOC entries. |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 621 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 622 | for (var i = 0; i < entries.length; ++i) { |
| 623 | var entry = entries[i]; |
| 624 | if (entry.element.id == "") |
| 625 | entry.element.id = "_toc_" + i; |
| 626 | var a = document.createElement("a"); |
| 627 | a.href = "#" + entry.element.id; |
| 628 | a.appendChild(document.createTextNode(entry.text)); |
| 629 | var div = document.createElement("div"); |
| 630 | div.appendChild(a); |
| 631 | div.className = "toclevel" + entry.toclevel; |
| 632 | toc.appendChild(div); |
| 633 | } |
| 634 | if (entries.length == 0) |
| 635 | toc.parentNode.removeChild(toc); |
| 636 | }, |
| 637 | |
| 638 | |
| 639 | ///////////////////////////////////////////////////////////////////// |
| 640 | // Footnotes generator |
| 641 | ///////////////////////////////////////////////////////////////////// |
| 642 | |
| 643 | /* Based on footnote generation code from: |
| 644 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 645 | */ |
| 646 | |
| 647 | footnotes: function () { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 648 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 649 | var i; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 650 | var noteholder = document.getElementById("footnotes"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 651 | if (!noteholder) { |
| 652 | return; |
| 653 | } |
| 654 | var entriesToRemove = []; |
| 655 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 656 | var entry = noteholder.childNodes[i]; |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 657 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 658 | entriesToRemove.push(entry); |
| 659 | } |
| 660 | for (i = 0; i < entriesToRemove.length; i++) { |
| 661 | noteholder.removeChild(entriesToRemove[i]); |
| 662 | } |
| 663 | |
| 664 | // Rebuild footnote entries. |
| 665 | var cont = document.getElementById("content"); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 666 | var spans = cont.getElementsByTagName("span"); |
| 667 | var refs = {}; |
| 668 | var n = 0; |
| 669 | for (i=0; i<spans.length; i++) { |
| 670 | if (spans[i].className == "footnote") { |
| 671 | n++; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 672 | var note = spans[i].getAttribute("data-note"); |
| 673 | if (!note) { |
| 674 | // Use [\s\S] in place of . so multi-line matches work. |
| 675 | // Because JavaScript has no s (dotall) regex flag. |
| 676 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 677 | spans[i].innerHTML = |
| 678 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 679 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 680 | spans[i].setAttribute("data-note", note); |
| 681 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 682 | noteholder.innerHTML += |
| 683 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 684 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 685 | n + "</a>. " + note + "</div>"; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 686 | var id =spans[i].getAttribute("id"); |
| 687 | if (id != null) refs["#"+id] = n; |
| 688 | } |
| 689 | } |
| 690 | if (n == 0) |
| 691 | noteholder.parentNode.removeChild(noteholder); |
| 692 | else { |
| 693 | // Process footnoterefs. |
| 694 | for (i=0; i<spans.length; i++) { |
| 695 | if (spans[i].className == "footnoteref") { |
| 696 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 697 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 698 | n = refs[href]; |
| 699 | spans[i].innerHTML = |
| 700 | "[<a href='#_footnote_" + n + |
| 701 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 702 | } |
| 703 | } |
| 704 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 705 | }, |
| 706 | |
| 707 | install: function(toclevels) { |
| 708 | var timerId; |
| 709 | |
| 710 | function reinstall() { |
| 711 | asciidoc.footnotes(); |
| 712 | if (toclevels) { |
| 713 | asciidoc.toc(toclevels); |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | function reinstallAndRemoveTimer() { |
| 718 | clearInterval(timerId); |
| 719 | reinstall(); |
| 720 | } |
| 721 | |
| 722 | timerId = setInterval(reinstall, 500); |
| 723 | if (document.addEventListener) |
| 724 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 725 | else |
| 726 | window.onload = reinstallAndRemoveTimer; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 727 | } |
| 728 | |
| 729 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 730 | asciidoc.install(); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 731 | /*]]>*/ |
| 732 | </script> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 733 | </head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 734 | <body class="manpage"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 735 | <div id="header"> |
| 736 | <h1> |
| 737 | git-fast-import(1) Manual Page |
| 738 | </h1> |
| 739 | <h2>NAME</h2> |
| 740 | <div class="sectionbody"> |
| 741 | <p>git-fast-import - |
Junio C Hamano | 053827f | 2007-02-14 07:23:58 | [diff] [blame] | 742 | Backend for fast Git data importers |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 743 | </p> |
| 744 | </div> |
| 745 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 746 | <div id="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 747 | <div class="sect1"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 748 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 749 | <div class="sectionbody"> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 750 | <div class="verseblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 751 | <pre class="content">frontend | <em>git fast-import</em> [options]</pre> |
| 752 | <div class="attribution"> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 753 | </div></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 754 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 755 | </div> |
| 756 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 757 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 758 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 759 | <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] | 760 | Most end users want to use one of the existing frontend programs, |
| 761 | which parses a specific type of foreign source and feeds the contents |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 762 | stored there to <em>git fast-import</em>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 763 | <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] | 764 | writes one or more packfiles directly into the current repository. |
| 765 | When EOF is received on standard input, fast import writes out |
| 766 | updated branch and tag refs, fully updating the current repository |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 767 | with the newly imported data.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 768 | <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] | 769 | has already been initialized by <em>git init</em>) or incrementally |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 770 | update an existing populated repository. Whether or not incremental |
| 771 | imports are supported from a particular foreign source depends on |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 772 | the frontend program in use.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 773 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 774 | </div> |
| 775 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 776 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 777 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 778 | <div class="dlist"><dl> |
| 779 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 780 | --force |
| 781 | </dt> |
| 782 | <dd> |
| 783 | <p> |
| 784 | Force updating modified existing branches, even if doing |
| 785 | so would cause commits to be lost (as the new commit does |
| 786 | not contain the old commit). |
| 787 | </p> |
| 788 | </dd> |
| 789 | <dt class="hdlist1"> |
| 790 | --quiet |
| 791 | </dt> |
| 792 | <dd> |
| 793 | <p> |
| 794 | Disable all non-fatal output, making fast-import silent when it |
| 795 | is successful. This option disables the output shown by |
| 796 | --stats. |
| 797 | </p> |
| 798 | </dd> |
| 799 | <dt class="hdlist1"> |
| 800 | --stats |
| 801 | </dt> |
| 802 | <dd> |
| 803 | <p> |
| 804 | Display some basic statistics about the objects fast-import has |
| 805 | created, the packfiles they were stored into, and the |
| 806 | memory used by fast-import during this run. Showing this output |
| 807 | is currently the default, but can be disabled with --quiet. |
| 808 | </p> |
| 809 | </dd> |
| 810 | </dl></div> |
| 811 | <div class="sect2"> |
| 812 | <h3 id="_options_for_frontends">Options for Frontends</h3> |
| 813 | <div class="dlist"><dl> |
| 814 | <dt class="hdlist1"> |
| 815 | --cat-blob-fd=<fd> |
| 816 | </dt> |
| 817 | <dd> |
| 818 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 819 | Write responses to <code>cat-blob</code> and <code>ls</code> queries to the |
| 820 | file descriptor <fd> instead of <code>stdout</code>. Allows <code>progress</code> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 821 | output intended for the end-user to be separated from other |
| 822 | output. |
| 823 | </p> |
| 824 | </dd> |
| 825 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 826 | --date-format=<fmt> |
| 827 | </dt> |
| 828 | <dd> |
| 829 | <p> |
| 830 | Specify the type of dates the frontend will supply to |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 831 | 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] | 832 | See “Date Formats” below for details about which formats |
| 833 | are supported, and their syntax. |
| 834 | </p> |
| 835 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 836 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 837 | --done |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 838 | </dt> |
| 839 | <dd> |
| 840 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 841 | 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] | 842 | the stream. This option might be useful for detecting errors |
| 843 | that cause the frontend to terminate before it has started to |
| 844 | write a stream. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 845 | </p> |
| 846 | </dd> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 847 | </dl></div> |
| 848 | </div> |
| 849 | <div class="sect2"> |
| 850 | <h3 id="_locations_of_marks_files">Locations of Marks Files</h3> |
| 851 | <div class="dlist"><dl> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 852 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 853 | --export-marks=<file> |
| 854 | </dt> |
| 855 | <dd> |
| 856 | <p> |
| 857 | Dumps the internal marks table to <file> when complete. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 858 | Marks are written one per line as <code>:markid SHA-1</code>. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 859 | Frontends can use this file to validate imports after they |
Junio C Hamano | d15328a | 2007-03-09 09:06:40 | [diff] [blame] | 860 | have been completed, or to save the marks table across |
| 861 | incremental runs. As <file> is only opened and truncated |
| 862 | at checkpoint (or completion) the same path can also be |
| 863 | safely given to --import-marks. |
| 864 | </p> |
| 865 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 866 | <dt class="hdlist1"> |
Junio C Hamano | d15328a | 2007-03-09 09:06:40 | [diff] [blame] | 867 | --import-marks=<file> |
| 868 | </dt> |
| 869 | <dd> |
| 870 | <p> |
| 871 | Before processing any input, load the marks specified in |
| 872 | <file>. The input file must exist, must be readable, and |
| 873 | must use the same format as produced by --export-marks. |
| 874 | Multiple options may be supplied to import more than one |
| 875 | set of marks. If a mark is defined to different values, |
| 876 | the last file wins. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 877 | </p> |
| 878 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 879 | <dt class="hdlist1"> |
Junio C Hamano | 23e3f53 | 2011-02-10 02:05:29 | [diff] [blame] | 880 | --import-marks-if-exists=<file> |
| 881 | </dt> |
| 882 | <dd> |
| 883 | <p> |
| 884 | Like --import-marks but instead of erroring out, silently |
| 885 | skips the file if it does not exist. |
| 886 | </p> |
| 887 | </dd> |
| 888 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 889 | --[no-]relative-marks |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 890 | </dt> |
| 891 | <dd> |
| 892 | <p> |
Junio C Hamano | a0dac24 | 2011-05-06 05:10:29 | [diff] [blame] | 893 | After specifying --relative-marks the paths specified |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 894 | with --import-marks= and --export-marks= are relative |
| 895 | to an internal directory in the current repository. |
| 896 | In git-fast-import this means that the paths are relative |
| 897 | to the .git/info/fast-import directory. However, other |
| 898 | importers may use a different location. |
| 899 | </p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 900 | <div class="paragraph"><p>Relative and non-relative marks may be combined by interweaving |
| 901 | --(no-)-relative-marks with the --(import|export)-marks= options.</p></div> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 902 | </dd> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 903 | </dl></div> |
| 904 | </div> |
| 905 | <div class="sect2"> |
| 906 | <h3 id="_performance_and_compression_tuning">Performance and Compression Tuning</h3> |
| 907 | <div class="dlist"><dl> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 908 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 909 | --active-branches=<n> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 910 | </dt> |
| 911 | <dd> |
| 912 | <p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 913 | Maximum number of branches to maintain active at once. |
| 914 | See “Memory Utilization” below for details. Default is 5. |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 915 | </p> |
| 916 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 917 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 918 | --big-file-threshold=<n> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 919 | </dt> |
| 920 | <dd> |
| 921 | <p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 922 | Maximum size of a blob that fast-import will attempt to |
| 923 | create a delta for, expressed in bytes. The default is 512m |
| 924 | (512 MiB). Some importers may wish to lower this on systems |
| 925 | with constrained memory. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 926 | </p> |
| 927 | </dd> |
| 928 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 929 | --depth=<n> |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 930 | </dt> |
| 931 | <dd> |
| 932 | <p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 933 | Maximum delta depth, for blob and tree deltification. |
| 934 | Default is 10. |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 935 | </p> |
| 936 | </dd> |
| 937 | <dt class="hdlist1"> |
Junio C Hamano | 9dd8bb0 | 2007-02-12 07:15:35 | [diff] [blame] | 938 | --export-pack-edges=<file> |
| 939 | </dt> |
| 940 | <dd> |
| 941 | <p> |
| 942 | After creating a packfile, print a line of data to |
| 943 | <file> listing the filename of the packfile and the last |
| 944 | commit on each branch that was written to that packfile. |
| 945 | This information may be useful after importing projects |
| 946 | whose total object set exceeds the 4 GiB packfile limit, |
| 947 | as these commits can be used as edge points during calls |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 948 | to <em>git pack-objects</em>. |
Junio C Hamano | 9dd8bb0 | 2007-02-12 07:15:35 | [diff] [blame] | 949 | </p> |
| 950 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 951 | <dt class="hdlist1"> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 952 | --max-pack-size=<n> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 953 | </dt> |
| 954 | <dd> |
| 955 | <p> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 956 | Maximum size of each output packfile. |
| 957 | The default is unlimited. |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 958 | </p> |
| 959 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 960 | </dl></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 961 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 962 | </div> |
Junio C Hamano | 7dac690 | 2013-01-12 08:25:31 | [diff] [blame] | 963 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 964 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 965 | <h2 id="_performance">Performance</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 966 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 967 | <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] | 968 | amount of memory usage and processing time. Assuming the frontend |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 969 | 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] | 970 | import times for projects holding 10+ years of history and containing |
| 971 | 100,000+ individual commits are generally completed in just 1-2 |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 972 | hours on quite modest (~$2,000 USD) hardware.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 973 | <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] | 974 | source just cannot extract revisions fast enough) or disk IO (fast-import |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 975 | writes as fast as the disk will take the data). Imports will run |
| 976 | 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] | 977 | destination Git repository (due to less IO contention).</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 978 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 979 | </div> |
| 980 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 981 | <h2 id="_development_cost">Development Cost</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 982 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 983 | <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] | 984 | lines of Perl/Python/Ruby code. Most developers have been able to |
| 985 | create working importers in just a couple of hours, even though it |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 986 | 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] | 987 | an ideal situation, given that most conversion tools are throw-away |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 988 | (use once, and never look back).</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 989 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 990 | </div> |
| 991 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 992 | <h2 id="_parallel_operation">Parallel Operation</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 993 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 994 | <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] | 995 | 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] | 996 | 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] | 997 | are never used by fast-import).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 998 | <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] | 999 | After the import, during its ref update phase, fast-import tests each |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1000 | existing branch ref to verify the update will be a fast-forward |
| 1001 | update (the commit stored in the ref is contained in the new |
| 1002 | 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] | 1003 | fast-forward update, fast-import will skip updating that ref and instead |
| 1004 | prints a warning message. fast-import will always attempt to update all |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1005 | branch refs, and does not stop on the first failure.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1006 | <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] | 1007 | this only be used on an otherwise quiet repository. Using --force |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1008 | 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] | 1009 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1010 | </div> |
| 1011 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1012 | <h2 id="_technical_discussion">Technical Discussion</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1013 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1014 | <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] | 1015 | or modified at any point during the import process by sending a |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1016 | <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] | 1017 | program to process an unlimited number of branches simultaneously, |
| 1018 | generating commits in the order they are available from the source |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1019 | data. It also simplifies the frontend programs considerably.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1020 | <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] | 1021 | file within it. (It does however update the current Git repository, |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1022 | 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] | 1023 | the working directory for its own purposes, such as extracting file |
| 1024 | revisions from the foreign source. This ignorance of the working |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1025 | 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] | 1026 | need to perform any costly file update operations when switching |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1027 | between branches.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1028 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1029 | </div> |
| 1030 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1031 | <h2 id="_input_format">Input Format</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1032 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1033 | <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] | 1034 | the fast-import input format is text (ASCII) based. This text based |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1035 | format simplifies development and debugging of frontend programs, |
| 1036 | especially when a higher level language such as Perl, Python or |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1037 | Ruby is being used.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1038 | <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] | 1039 | <strong>exactly</strong> one space. Likewise LF means one (and only one) linefeed |
| 1040 | and HT one (and only one) horizontal tab. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1041 | Supplying additional whitespace characters will cause unexpected |
| 1042 | results, such as branch names or file names with leading or trailing |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1043 | 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] | 1044 | unexpected input.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1045 | <div class="sect2"> |
| 1046 | <h3 id="_stream_comments">Stream Comments</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1047 | <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] | 1048 | begins with <code>#</code> (ASCII pound/hash) up to and including the line |
| 1049 | 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] | 1050 | that does not contain an LF and therefore may be used to include |
| 1051 | any detailed debugging information that might be specific to the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1052 | frontend and useful when inspecting a fast-import data stream.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1053 | </div> |
| 1054 | <div class="sect2"> |
| 1055 | <h3 id="_date_formats">Date Formats</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1056 | <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] | 1057 | 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] | 1058 | in the --date-format=<fmt> command-line option.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1059 | <div class="dlist"><dl> |
| 1060 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1061 | <code>raw</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1062 | </dt> |
| 1063 | <dd> |
| 1064 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1065 | 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] | 1066 | It is also fast-import’s default format, if --date-format was |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1067 | not specified. |
| 1068 | </p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1069 | <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] | 1070 | seconds since the UNIX epoch (midnight, Jan 1, 1970, UTC) and is |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1071 | written as an ASCII decimal integer.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1072 | <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] | 1073 | offset from UTC. For example EST (which is 5 hours behind UTC) |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1074 | would be expressed in <code><tz></code> by “-0500” while UTC is “+0000”. |
| 1075 | 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] | 1076 | advisement to help formatting routines display the timestamp.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1077 | <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] | 1078 | “+0000”, or the most common local offset. For example many |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1079 | organizations have a CVS repository which has only ever been accessed |
Junio C Hamano | e3acfb8 | 2013-11-12 23:22:57 | [diff] [blame] | 1080 | 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] | 1081 | case a reasonable offset from UTC could be assumed.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1082 | <div class="paragraph"><p>Unlike the <code>rfc2822</code> format, this format is very strict. Any |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1083 | variation in formatting will cause fast-import to reject the value.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1084 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1085 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1086 | <code>rfc2822</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1087 | </dt> |
| 1088 | <dd> |
| 1089 | <p> |
| 1090 | This is the standard email format as described by RFC 2822. |
| 1091 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1092 | <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] | 1093 | 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] | 1094 | same parser used by <em>git am</em> when applying patches |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1095 | received from email.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1096 | <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] | 1097 | these cases Git will still be able to obtain the correct date from |
| 1098 | the malformed string. There are also some types of malformed |
| 1099 | strings which Git will parse wrong, and yet consider valid. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1100 | Seriously malformed strings will be rejected.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1101 | <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] | 1102 | contained in an RFC 2822 date string is used to adjust the date |
| 1103 | value to UTC prior to storage. Therefore it is important that |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1104 | this information be as accurate as possible.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1105 | <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] | 1106 | the frontend should let fast-import handle the parsing and conversion |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1107 | (rather than attempting to do it itself) as the Git parser has |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1108 | been well tested in the wild.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1109 | <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] | 1110 | 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] | 1111 | 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] | 1112 | ambiguity in parsing.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1113 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1114 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1115 | <code>now</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1116 | </dt> |
| 1117 | <dd> |
| 1118 | <p> |
Junio C Hamano | e3acfb8 | 2013-11-12 23:22:57 | [diff] [blame] | 1119 | Always use the current time and time zone. The literal |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1120 | <code>now</code> must always be supplied for <code><when></code>. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1121 | </p> |
Junio C Hamano | e3acfb8 | 2013-11-12 23:22:57 | [diff] [blame] | 1122 | <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] | 1123 | 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] | 1124 | 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] | 1125 | time zone.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1126 | <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] | 1127 | may be useful to a process that wants to create a new commit |
| 1128 | right now, without needing to use a working directory or |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1129 | <em>git update-index</em>.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1130 | <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] | 1131 | the timestamps may not match, as the system clock will be polled |
| 1132 | twice (once for each command). The only way to ensure that both |
| 1133 | author and committer identity information has the same timestamp |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1134 | is to omit <code>author</code> (thus copying from <code>committer</code>) or to use a |
| 1135 | date format other than <code>now</code>.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1136 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1137 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1138 | </div> |
| 1139 | <div class="sect2"> |
| 1140 | <h3 id="_commands">Commands</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1141 | <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] | 1142 | and control the current import process. More detailed discussion |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1143 | (with examples) of each command follows later.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1144 | <div class="dlist"><dl> |
| 1145 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1146 | <code>commit</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1147 | </dt> |
| 1148 | <dd> |
| 1149 | <p> |
| 1150 | Creates a new branch or updates an existing branch by |
| 1151 | creating a new commit and updating the branch to point at |
| 1152 | the newly created commit. |
| 1153 | </p> |
| 1154 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1155 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1156 | <code>tag</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1157 | </dt> |
| 1158 | <dd> |
| 1159 | <p> |
| 1160 | Creates an annotated tag object from an existing commit or |
| 1161 | branch. Lightweight tags are not supported by this command, |
| 1162 | as they are not recommended for recording meaningful points |
| 1163 | in time. |
| 1164 | </p> |
| 1165 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1166 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1167 | <code>reset</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1168 | </dt> |
| 1169 | <dd> |
| 1170 | <p> |
| 1171 | Reset an existing branch (or a new branch) to a specific |
| 1172 | revision. This command must be used to change a branch to |
| 1173 | a specific revision without making a commit on it. |
| 1174 | </p> |
| 1175 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1176 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1177 | <code>blob</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1178 | </dt> |
| 1179 | <dd> |
| 1180 | <p> |
| 1181 | Convert raw file data into a blob, for future use in a |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1182 | <code>commit</code> command. This command is optional and is not |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1183 | needed to perform an import. |
| 1184 | </p> |
| 1185 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1186 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1187 | <code>checkpoint</code> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1188 | </dt> |
| 1189 | <dd> |
| 1190 | <p> |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1191 | Forces fast-import to close the current packfile, generate its |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1192 | unique SHA-1 checksum and index, and start a new packfile. |
| 1193 | This command is optional and is not needed to perform |
| 1194 | an import. |
| 1195 | </p> |
| 1196 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1197 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1198 | <code>progress</code> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1199 | </dt> |
| 1200 | <dd> |
| 1201 | <p> |
| 1202 | Causes fast-import to echo the entire line to its own |
| 1203 | standard output. This command is optional and is not needed |
| 1204 | to perform an import. |
| 1205 | </p> |
| 1206 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1207 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1208 | <code>done</code> |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 1209 | </dt> |
| 1210 | <dd> |
| 1211 | <p> |
| 1212 | Marks the end of the stream. This command is optional |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1213 | unless the <code>done</code> feature was requested using the |
| 1214 | <code>--done</code> command-line option or <code>feature done</code> command. |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 1215 | </p> |
| 1216 | </dd> |
| 1217 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1218 | <code>cat-blob</code> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1219 | </dt> |
| 1220 | <dd> |
| 1221 | <p> |
| 1222 | 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] | 1223 | format to the file descriptor set with <code>--cat-blob-fd</code> or |
| 1224 | <code>stdout</code> if unspecified. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1225 | </p> |
| 1226 | </dd> |
| 1227 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1228 | <code>ls</code> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1229 | </dt> |
| 1230 | <dd> |
| 1231 | <p> |
| 1232 | Causes fast-import to print a line describing a directory |
| 1233 | 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] | 1234 | <code>--cat-blob-fd</code> or <code>stdout</code> if unspecified. |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1235 | </p> |
| 1236 | </dd> |
| 1237 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1238 | <code>feature</code> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1239 | </dt> |
| 1240 | <dd> |
| 1241 | <p> |
Junio C Hamano | 0e0e0d2 | 2013-09-12 23:25:03 | [diff] [blame] | 1242 | Enable the specified feature. This requires that fast-import |
| 1243 | supports the specified feature, and aborts if it does not. |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1244 | </p> |
| 1245 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1246 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1247 | <code>option</code> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1248 | </dt> |
| 1249 | <dd> |
| 1250 | <p> |
| 1251 | Specify any of the options listed under OPTIONS that do not |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1252 | change stream semantic to suit the frontend’s needs. This |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1253 | command is optional and is not needed to perform an import. |
| 1254 | </p> |
| 1255 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1256 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1257 | </div> |
| 1258 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1259 | <h3 id="_code_commit_code"><code>commit</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1260 | <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] | 1261 | change to the project.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1262 | <div class="literalblock"> |
| 1263 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1264 | <pre><code> 'commit' SP <ref> LF |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1265 | mark? |
Junio C Hamano | 6d325df | 2010-01-01 00:02:47 | [diff] [blame] | 1266 | ('author' (SP <name>)? SP LT <email> GT SP <when> LF)? |
| 1267 | 'committer' (SP <name>)? SP LT <email> GT SP <when> LF |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1268 | data |
Junio C Hamano | e6f28d0 | 2013-09-17 21:34:00 | [diff] [blame] | 1269 | ('from' SP <commit-ish> LF)? |
| 1270 | ('merge' SP <commit-ish> LF)? |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1271 | (filemodify | filedelete | filecopy | filerename | filedeleteall | notemodify)* |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1272 | LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1273 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1274 | <div class="paragraph"><p>where <code><ref></code> is the name of the branch to make the commit on. |
| 1275 | Typically branch names are prefixed with <code>refs/heads/</code> in |
| 1276 | Git, so importing the CVS branch symbol <code>RELENG-1_0</code> would use |
| 1277 | <code>refs/heads/RELENG-1_0</code> for the value of <code><ref></code>. The value of |
| 1278 | <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] | 1279 | 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] | 1280 | <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] | 1281 | reference to the newly created commit for future use by the frontend |
| 1282 | (see below for format). It is very common for frontends to mark |
| 1283 | every commit they create, thereby allowing future branch creation |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1284 | from any imported commit.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1285 | <div class="paragraph"><p>The <code>data</code> command following <code>committer</code> must supply the commit |
| 1286 | 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] | 1287 | commit message use a 0 length data. Commit messages are free-form |
| 1288 | and are not interpreted by Git. Currently they must be encoded in |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1289 | 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] | 1290 | <div class="paragraph"><p>Zero or more <code>filemodify</code>, <code>filedelete</code>, <code>filecopy</code>, <code>filerename</code>, |
| 1291 | <code>filedeleteall</code> and <code>notemodify</code> commands |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1292 | may be included to update the contents of the branch prior to |
| 1293 | creating the commit. These commands may be supplied in any order. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1294 | However it is recommended that a <code>filedeleteall</code> command precede |
| 1295 | all <code>filemodify</code>, <code>filecopy</code>, <code>filerename</code> and <code>notemodify</code> commands in |
| 1296 | the same commit, as <code>filedeleteall</code> wipes the branch clean (see below).</p></div> |
| 1297 | <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] | 1298 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1299 | <h4 id="_code_author_code"><code>author</code></h4> |
| 1300 | <div class="paragraph"><p>An <code>author</code> command may optionally appear, if the author information |
| 1301 | might differ from the committer information. If <code>author</code> is omitted |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1302 | then fast-import will automatically use the committer’s information for |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1303 | the author portion of the commit. See below for a description of |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1304 | 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] | 1305 | </div> |
| 1306 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1307 | <h4 id="_code_committer_code"><code>committer</code></h4> |
| 1308 | <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] | 1309 | they made it.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1310 | <div class="paragraph"><p>Here <code><name></code> is the person’s display name (for example |
| 1311 | “Com M Itter”) and <code><email></code> is the person’s email address |
| 1312 | (“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] | 1313 | and greater-than (\x3e) symbols. These are required to delimit |
| 1314 | the email address from the other fields in the line. Note that |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1315 | <code><name></code> and <code><email></code> are free-form and may contain any sequence |
| 1316 | of bytes, except <code>LT</code>, <code>GT</code> and <code>LF</code>. <code><name></code> is typically UTF-8 encoded.</p></div> |
| 1317 | <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] | 1318 | that was selected by the --date-format=<fmt> command-line option. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1319 | See “Date Formats” above for the set of supported formats, and |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1320 | their syntax.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1321 | </div> |
| 1322 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1323 | <h4 id="_code_from_code"><code>from</code></h4> |
| 1324 | <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] | 1325 | this branch from. This revision will be the first ancestor of the |
Junio C Hamano | ac28f43 | 2012-11-21 21:58:58 | [diff] [blame] | 1326 | 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] | 1327 | 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] | 1328 | modifications in this commit.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1329 | <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] | 1330 | will cause fast-import to create that commit with no ancestor. This |
| 1331 | tends to be desired only for the initial commit of a project. |
Junio C Hamano | 25c0b70 | 2008-03-23 09:41:37 | [diff] [blame] | 1332 | If the frontend creates all files from scratch when making a new |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1333 | 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] | 1334 | the commit with an empty tree. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1335 | Omitting the <code>from</code> command on existing branches is usually desired, |
Junio C Hamano | 5dad083 | 2007-02-13 05:16:23 | [diff] [blame] | 1336 | as the current commit on that branch is automatically assumed to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1337 | be the first ancestor of the new commit.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1338 | <div class="paragraph"><p>As <code>LF</code> is not valid in a Git refname or SHA-1 expression, no |
| 1339 | quoting or escaping syntax is supported within <code><commit-ish></code>.</p></div> |
| 1340 | <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] | 1341 | <div class="ulist"><ul> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1342 | <li> |
| 1343 | <p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1344 | The name of an existing branch already in fast-import’s internal branch |
| 1345 | 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] | 1346 | expression. |
| 1347 | </p> |
| 1348 | </li> |
| 1349 | <li> |
| 1350 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1351 | 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] | 1352 | </p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1353 | <div class="paragraph"><p>The reason fast-import uses <code>:</code> to denote a mark reference is this character |
| 1354 | is not legal in a Git branch name. The leading <code>:</code> makes it easy |
| 1355 | to distinguish between the mark 42 (<code>:42</code>) and the branch 42 (<code>42</code> |
| 1356 | 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] | 1357 | consist only of base-10 digits.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1358 | <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] | 1359 | </li> |
| 1360 | <li> |
| 1361 | <p> |
| 1362 | A complete 40 byte or abbreviated commit SHA-1 in hex. |
| 1363 | </p> |
| 1364 | </li> |
| 1365 | <li> |
| 1366 | <p> |
| 1367 | Any valid Git SHA-1 expression that resolves to a commit. See |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1368 | “SPECIFYING REVISIONS” in <a href="gitrevisions.html">gitrevisions(7)</a> for details. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1369 | </p> |
| 1370 | </li> |
Junio C Hamano | c8c398a | 2014-06-16 21:14:05 | [diff] [blame] | 1371 | <li> |
| 1372 | <p> |
| 1373 | The special null SHA-1 (40 zeros) specifies that the branch is to be |
| 1374 | removed. |
| 1375 | </p> |
| 1376 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1377 | </ul></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1378 | <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] | 1379 | current branch value should be written as:</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1380 | <div class="listingblock"> |
| 1381 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1382 | <pre><code> from refs/heads/branch^0</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1383 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1384 | <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] | 1385 | start from itself, and the branch is created in memory before the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1386 | <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] | 1387 | fast-import to resolve the commit through Git’s revision parsing library, |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1388 | rather than its internal branch table, thereby loading in the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1389 | existing value of the branch.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1390 | </div> |
| 1391 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1392 | <h4 id="_code_merge_code"><code>merge</code></h4> |
Junio C Hamano | ac28f43 | 2012-11-21 21:58:58 | [diff] [blame] | 1393 | <div class="paragraph"><p>Includes one additional ancestor commit. The additional ancestry |
| 1394 | 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] | 1395 | If the <code>from</code> command is |
| 1396 | 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] | 1397 | the first ancestor of the current commit, and the branch will start |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1398 | out with no files. An unlimited number of <code>merge</code> commands per |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1399 | commit are permitted by fast-import, thereby establishing an n-way merge. |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1400 | However Git’s other tools never create commits with more than 15 |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1401 | additional ancestors (forming a 16-way merge). For this reason |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1402 | it is suggested that frontends do not use more than 15 <code>merge</code> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1403 | commands per commit; 16, if starting a new, empty branch.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1404 | <div class="paragraph"><p>Here <code><commit-ish></code> is any of the commit specification expressions |
| 1405 | also accepted by <code>from</code> (see above).</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1406 | </div> |
| 1407 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1408 | <h4 id="_code_filemodify_code"><code>filemodify</code></h4> |
| 1409 | <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] | 1410 | content of an existing file. This command has two different means |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1411 | of specifying the content of the file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1412 | <div class="dlist"><dl> |
| 1413 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1414 | External data format |
| 1415 | </dt> |
| 1416 | <dd> |
| 1417 | <p> |
| 1418 | The data content for the file was already supplied by a prior |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1419 | <code>blob</code> command. The frontend just needs to connect it. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1420 | </p> |
| 1421 | <div class="literalblock"> |
| 1422 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1423 | <pre><code> 'M' SP <mode> SP <dataref> SP <path> LF</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1424 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1425 | <div class="paragraph"><p>Here usually <code><dataref></code> must be either a mark reference (<code>:<idnum></code>) |
| 1426 | set by a prior <code>blob</code> command, or a full 40-byte SHA-1 of an |
| 1427 | existing Git blob object. If <code><mode></code> is <code>040000`</code> then |
| 1428 | <code><dataref></code> must be the full 40-byte SHA-1 of an existing |
| 1429 | 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] | 1430 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1431 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1432 | Inline data format |
| 1433 | </dt> |
| 1434 | <dd> |
| 1435 | <p> |
| 1436 | The data content for the file has not been supplied yet. |
| 1437 | The frontend wants to supply it as part of this modify |
| 1438 | command. |
| 1439 | </p> |
| 1440 | <div class="literalblock"> |
| 1441 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1442 | <pre><code> 'M' SP <mode> SP 'inline' SP <path> LF |
| 1443 | data</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1444 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1445 | <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] | 1446 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1447 | </dl></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1448 | <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] | 1449 | in octal. Git only supports the following modes:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1450 | <div class="ulist"><ul> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1451 | <li> |
| 1452 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1453 | <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] | 1454 | of files in most projects use this mode. If in doubt, this is |
| 1455 | what you want. |
| 1456 | </p> |
| 1457 | </li> |
| 1458 | <li> |
| 1459 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1460 | <code>100755</code> or <code>755</code>: A normal, but executable, file. |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1461 | </p> |
| 1462 | </li> |
| 1463 | <li> |
| 1464 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1465 | <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] | 1466 | </p> |
| 1467 | </li> |
Junio C Hamano | 915cd9b | 2008-07-20 01:24:17 | [diff] [blame] | 1468 | <li> |
| 1469 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1470 | <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] | 1471 | another repository. Git links can only be specified by SHA or through |
| 1472 | a commit mark. They are used to implement submodules. |
| 1473 | </p> |
| 1474 | </li> |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1475 | <li> |
| 1476 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1477 | <code>040000</code>: A subdirectory. Subdirectories can only be specified by |
| 1478 | SHA or through a tree mark set with <code>--import-marks</code>. |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1479 | </p> |
| 1480 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1481 | </ul></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1482 | <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] | 1483 | (if not already existing) or modified (if already existing).</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1484 | <div class="paragraph"><p>A <code><path></code> string must use UNIX-style directory separators (forward |
| 1485 | slash <code>/</code>), may contain any byte other than <code>LF</code>, and must not |
| 1486 | start with double quote (<code>"</code>).</p></div> |
Junio C Hamano | bccb0db | 2012-11-29 22:51:20 | [diff] [blame] | 1487 | <div class="paragraph"><p>A path can use C-style string quoting; this is accepted in all cases |
| 1488 | and mandatory if the filename starts with double quote or contains |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1489 | <code>LF</code>. In C-style quoting, the complete name should be surrounded with |
| 1490 | double quotes, and any <code>LF</code>, backslash, or double quote characters |
Junio C Hamano | bccb0db | 2012-11-29 22:51:20 | [diff] [blame] | 1491 | must be escaped by preceding them with a backslash (e.g., |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1492 | <code>"path/with\n, \\ and \" in it"</code>).</p></div> |
| 1493 | <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] | 1494 | <div class="ulist"><ul> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1495 | <li> |
| 1496 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1497 | 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] | 1498 | </p> |
| 1499 | </li> |
| 1500 | <li> |
| 1501 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1502 | end with a directory separator (e.g. <code>foo/</code> is invalid), |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1503 | </p> |
| 1504 | </li> |
| 1505 | <li> |
| 1506 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1507 | start with a directory separator (e.g. <code>/foo</code> is invalid), |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1508 | </p> |
| 1509 | </li> |
| 1510 | <li> |
| 1511 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1512 | contain the special component <code>.</code> or <code>..</code> (e.g. <code>foo/./bar</code> and |
| 1513 | <code>foo/../bar</code> are invalid). |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1514 | </p> |
| 1515 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1516 | </ul></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1517 | <div class="paragraph"><p>The root of the tree can be represented by an empty string as <code><path></code>.</p></div> |
| 1518 | <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] | 1519 | </div> |
| 1520 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1521 | <h4 id="_code_filedelete_code"><code>filedelete</code></h4> |
| 1522 | <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] | 1523 | delete an entire directory from the branch. If the file or directory |
| 1524 | removal makes its parent directory empty, the parent directory will |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1525 | be automatically removed too. This cascades up the tree until the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1526 | first non-empty directory or the root is reached.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1527 | <div class="literalblock"> |
| 1528 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1529 | <pre><code> 'D' SP <path> LF</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1530 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1531 | <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] | 1532 | be removed from the branch. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1533 | 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] | 1534 | </div> |
| 1535 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1536 | <h4 id="_code_filecopy_code"><code>filecopy</code></h4> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1537 | <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] | 1538 | location within the branch. The existing file or directory must |
| 1539 | exist. If the destination exists it will be completely replaced |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1540 | by the content copied from the source.</p></div> |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1541 | <div class="literalblock"> |
| 1542 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1543 | <pre><code> 'C' SP <path> SP <path> LF</code></pre> |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1544 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1545 | <div class="paragraph"><p>here the first <code><path></code> is the source location and the second |
| 1546 | <code><path></code> is the destination. See <code>filemodify</code> above for a detailed |
| 1547 | 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] | 1548 | that contains SP the path must be quoted.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1549 | <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] | 1550 | location has been copied to the destination any future commands |
| 1551 | applied to the source location will not impact the destination of |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1552 | the copy.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1553 | </div> |
| 1554 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1555 | <h4 id="_code_filerename_code"><code>filerename</code></h4> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1556 | <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] | 1557 | within the branch. The existing file or directory must exist. If |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1558 | 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] | 1559 | <div class="literalblock"> |
| 1560 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1561 | <pre><code> 'R' SP <path> SP <path> LF</code></pre> |
Junio C Hamano | 06216df | 2007-07-10 07:49:37 | [diff] [blame] | 1562 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1563 | <div class="paragraph"><p>here the first <code><path></code> is the source location and the second |
| 1564 | <code><path></code> is the destination. See <code>filemodify</code> above for a detailed |
| 1565 | 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] | 1566 | that contains SP the path must be quoted.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1567 | <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] | 1568 | location has been renamed to the destination any future commands |
| 1569 | applied to the source location will create new files there and not |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1570 | impact the destination of the rename.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1571 | <div class="paragraph"><p>Note that a <code>filerename</code> is the same as a <code>filecopy</code> followed by a |
| 1572 | <code>filedelete</code> of the source location. There is a slight performance |
| 1573 | advantage to using <code>filerename</code>, but the advantage is so small |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1574 | 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] | 1575 | source material into a rename for fast-import. This <code>filerename</code> |
Junio C Hamano | c0ea7c6 | 2007-07-15 07:19:06 | [diff] [blame] | 1576 | command is provided just to simplify frontends that already have |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1577 | rename information and don’t want bother with decomposing it into a |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1578 | <code>filecopy</code> followed by a <code>filedelete</code>.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1579 | </div> |
| 1580 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1581 | <h4 id="_code_filedeleteall_code"><code>filedeleteall</code></h4> |
| 1582 | <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] | 1583 | directories) from the branch. This command resets the internal |
| 1584 | branch structure to have no files in it, allowing the frontend |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1585 | to subsequently add all interesting files from scratch.</p></div> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1586 | <div class="literalblock"> |
| 1587 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1588 | <pre><code> 'deleteall' LF</code></pre> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 1589 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1590 | <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] | 1591 | (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] | 1592 | and therefore cannot generate the proper <code>filedelete</code> commands to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1593 | update the content.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1594 | <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] | 1595 | commands to set the correct content will produce the same results |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1596 | as sending only the needed <code>filemodify</code> and <code>filedelete</code> commands. |
| 1597 | 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] | 1598 | more memory per active branch (less than 1 MiB for even most large |
| 1599 | projects); so frontends that can easily obtain only the affected |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1600 | paths for a commit are encouraged to do so.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1601 | </div> |
| 1602 | <div class="sect3"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1603 | <h4 id="_code_notemodify_code"><code>notemodify</code></h4> |
| 1604 | <div class="paragraph"><p>Included in a <code>commit</code> <code><notes_ref></code> command to add a new note |
| 1605 | annotating a <code><commit-ish></code> or change this annotation contents. |
| 1606 | Internally it is similar to filemodify 100644 on <code><commit-ish></code> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 1607 | path (maybe split into subdirectories). It’s not advised to |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1608 | use any other commands to write to the <code><notes_ref></code> tree except |
| 1609 | <code>filedeleteall</code> to delete all existing notes in this tree. |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 1610 | This command has two different means of specifying the content |
| 1611 | of the note.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1612 | <div class="dlist"><dl> |
| 1613 | <dt class="hdlist1"> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1614 | External data format |
| 1615 | </dt> |
| 1616 | <dd> |
| 1617 | <p> |
| 1618 | The data content for the note was already supplied by a prior |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1619 | <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] | 1620 | commit that is to be annotated. |
| 1621 | </p> |
| 1622 | <div class="literalblock"> |
| 1623 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1624 | <pre><code> 'N' SP <dataref> SP <commit-ish> LF</code></pre> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1625 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1626 | <div class="paragraph"><p>Here <code><dataref></code> can be either a mark reference (<code>:<idnum></code>) |
| 1627 | 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] | 1628 | existing Git blob object.</p></div> |
| 1629 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1630 | <dt class="hdlist1"> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1631 | Inline data format |
| 1632 | </dt> |
| 1633 | <dd> |
| 1634 | <p> |
| 1635 | The data content for the note has not been supplied yet. |
| 1636 | The frontend wants to supply it as part of this modify |
| 1637 | command. |
| 1638 | </p> |
| 1639 | <div class="literalblock"> |
| 1640 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1641 | <pre><code> 'N' SP 'inline' SP <commit-ish> LF |
| 1642 | data</code></pre> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1643 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1644 | <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] | 1645 | </dd> |
| 1646 | </dl></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1647 | <div class="paragraph"><p>In both formats <code><commit-ish></code> is any of the commit specification |
| 1648 | expressions also accepted by <code>from</code> (see above).</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1649 | </div> |
| 1650 | </div> |
| 1651 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1652 | <h3 id="_code_mark_code"><code>mark</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1653 | <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] | 1654 | the frontend to recall this object at a future point in time, without |
| 1655 | knowing its SHA-1. Here the current object is the object creation |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1656 | command the <code>mark</code> command appears within. This can be <code>commit</code>, |
| 1657 | <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] | 1658 | <div class="literalblock"> |
| 1659 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1660 | <pre><code> 'mark' SP ':' <idnum> LF</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1661 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1662 | <div class="paragraph"><p>where <code><idnum></code> is the number assigned by the frontend to this mark. |
| 1663 | 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] | 1664 | The value 0 is reserved and cannot be used as |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1665 | 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] | 1666 | <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] | 1667 | to another object simply by reusing the same <code><idnum></code> in another |
| 1668 | <code>mark</code> command.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1669 | </div> |
| 1670 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1671 | <h3 id="_code_tag_code"><code>tag</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1672 | <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] | 1673 | 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] | 1674 | <div class="literalblock"> |
| 1675 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1676 | <pre><code> 'tag' SP <name> LF |
Junio C Hamano | e6f28d0 | 2013-09-17 21:34:00 | [diff] [blame] | 1677 | 'from' SP <commit-ish> LF |
Junio C Hamano | 6d325df | 2010-01-01 00:02:47 | [diff] [blame] | 1678 | 'tagger' (SP <name>)? SP LT <email> GT SP <when> LF |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1679 | data</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1680 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1681 | <div class="paragraph"><p>where <code><name></code> is the name of the tag to create.</p></div> |
| 1682 | <div class="paragraph"><p>Tag names are automatically prefixed with <code>refs/tags/</code> when stored |
| 1683 | in Git, so importing the CVS branch symbol <code>RELENG-1_0-FINAL</code> would |
| 1684 | use just <code>RELENG-1_0-FINAL</code> for <code><name></code>, and fast-import will write the |
| 1685 | corresponding ref as <code>refs/tags/RELENG-1_0-FINAL</code>.</p></div> |
| 1686 | <div class="paragraph"><p>The value of <code><name></code> must be a valid refname in Git and therefore |
| 1687 | 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] | 1688 | no quoting or escaping syntax is supported here.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1689 | <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] | 1690 | above for details.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1691 | <div class="paragraph"><p>The <code>tagger</code> command uses the same format as <code>committer</code> within |
| 1692 | <code>commit</code>; again see above for details.</p></div> |
| 1693 | <div class="paragraph"><p>The <code>data</code> command following <code>tagger</code> must supply the annotated tag |
| 1694 | 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] | 1695 | tag message use a 0 length data. Tag messages are free-form and are |
| 1696 | not interpreted by Git. Currently they must be encoded in UTF-8, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1697 | 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] | 1698 | <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] | 1699 | supported. Trying to include your own PGP/GPG signature is not |
| 1700 | recommended, as the frontend does not (easily) have access to the |
| 1701 | complete set of bytes which normally goes into such a signature. |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1702 | If signing is required, create lightweight tags from within fast-import with |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1703 | <code>reset</code>, then create the annotated versions of those tags offline |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1704 | with the standard <em>git tag</em> process.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1705 | </div> |
| 1706 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1707 | <h3 id="_code_reset_code"><code>reset</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1708 | <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] | 1709 | a specific revision. The reset command allows a frontend to issue |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1710 | 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] | 1711 | branch from an existing commit without creating a new commit.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1712 | <div class="literalblock"> |
| 1713 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1714 | <pre><code> 'reset' SP <ref> LF |
Junio C Hamano | e6f28d0 | 2013-09-17 21:34:00 | [diff] [blame] | 1715 | ('from' SP <commit-ish> LF)? |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1716 | LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1717 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1718 | <div class="paragraph"><p>For a detailed description of <code><ref></code> and <code><commit-ish></code> see above |
| 1719 | under <code>commit</code> and <code>from</code>.</p></div> |
| 1720 | <div class="paragraph"><p>The <code>LF</code> after the command is optional (it used to be required).</p></div> |
| 1721 | <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] | 1722 | (non-annotated) tags. For example:</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1723 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1724 | <div class="content"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1725 | <div class="literalblock"> |
| 1726 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1727 | <pre><code>reset refs/tags/938 |
| 1728 | from :938</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1729 | </div></div> |
| 1730 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1731 | <div class="paragraph"><p>would create the lightweight tag <code>refs/tags/938</code> referring to |
| 1732 | whatever commit mark <code>:938</code> references.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1733 | </div> |
| 1734 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1735 | <h3 id="_code_blob_code"><code>blob</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1736 | <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] | 1737 | is not connected to any commit; this connection must be formed in |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1738 | a subsequent <code>commit</code> command by referencing the blob through an |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1739 | assigned mark.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1740 | <div class="literalblock"> |
| 1741 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1742 | <pre><code> 'blob' LF |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1743 | mark? |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1744 | data</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1745 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1746 | <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] | 1747 | 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] | 1748 | 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] | 1749 | 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] | 1750 | </div> |
| 1751 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1752 | <h3 id="_code_data_code"><code>data</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1753 | <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] | 1754 | 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] | 1755 | byte count or delimited with a terminating line. Real frontends |
| 1756 | intended for production-quality conversions should always use the |
| 1757 | exact byte count format, as it is more robust and performs better. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1758 | The delimited format is intended primarily for testing fast-import.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1759 | <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] | 1760 | are always taken to be part of the body of the data and are therefore |
| 1761 | never ignored by fast-import. This makes it safe to import any |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1762 | file/message content whose lines might start with <code>#</code>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1763 | <div class="dlist"><dl> |
| 1764 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1765 | Exact byte count format |
| 1766 | </dt> |
| 1767 | <dd> |
| 1768 | <p> |
| 1769 | The frontend must specify the number of bytes of data. |
| 1770 | </p> |
| 1771 | <div class="literalblock"> |
| 1772 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1773 | <pre><code> 'data' SP <count> LF |
| 1774 | <raw> LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1775 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1776 | <div class="paragraph"><p>where <code><count></code> is the exact number of bytes appearing within |
| 1777 | <code><raw></code>. The value of <code><count></code> is expressed as an ASCII decimal |
| 1778 | integer. The <code>LF</code> on either side of <code><raw></code> is not |
| 1779 | included in <code><count></code> and will not be included in the imported data.</p></div> |
| 1780 | <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] | 1781 | recommended. Always including it makes debugging a fast-import |
| 1782 | stream easier as the next command always starts in column 0 |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1783 | 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] | 1784 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1785 | <dt class="hdlist1"> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1786 | Delimited format |
| 1787 | </dt> |
| 1788 | <dd> |
| 1789 | <p> |
| 1790 | A delimiter string is used to mark the end of the data. |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1791 | fast-import will compute the length by searching for the delimiter. |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 1792 | This format is primarily useful for testing and is not |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1793 | recommended for real data. |
| 1794 | </p> |
| 1795 | <div class="literalblock"> |
| 1796 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1797 | <pre><code> 'data' SP '<<' <delim> LF |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1798 | <raw> LF |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1799 | <delim> LF |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1800 | LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1801 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1802 | <div class="paragraph"><p>where <code><delim></code> is the chosen delimiter string. The string <code><delim></code> |
| 1803 | must not appear on a line by itself within <code><raw></code>, as otherwise |
| 1804 | fast-import will think the data ends earlier than it really does. The <code>LF</code> |
| 1805 | 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] | 1806 | the limitations of the delimited format, it is impossible to supply |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1807 | 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] | 1808 | <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] | 1809 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1810 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1811 | </div> |
| 1812 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1813 | <h3 id="_code_checkpoint_code"><code>checkpoint</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1814 | <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] | 1815 | save out all current branch refs, tags and marks.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1816 | <div class="literalblock"> |
| 1817 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1818 | <pre><code> 'checkpoint' LF |
| 1819 | LF?</code></pre> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 1820 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1821 | <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] | 1822 | packfile reaches --max-pack-size, or 4 GiB, whichever limit is |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1823 | smaller. During an automatic packfile switch fast-import does not update |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1824 | the branch refs, tags or marks.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1825 | <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] | 1826 | disk IO (to compute the overall pack SHA-1 checksum, generate the |
| 1827 | corresponding index file, and update the refs) it can easily take |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1828 | 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] | 1829 | <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] | 1830 | and long running imports, or when they need to allow another Git |
| 1831 | process access to a branch. However given that a 30 GiB Subversion |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 1832 | 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] | 1833 | explicit checkpointing may not be necessary.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1834 | <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] | 1835 | </div> |
| 1836 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1837 | <h3 id="_code_progress_code"><code>progress</code></h3> |
| 1838 | <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] | 1839 | its standard output channel (file descriptor 1) when the command is |
| 1840 | processed from the input stream. The command otherwise has no impact |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1841 | 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] | 1842 | <div class="literalblock"> |
| 1843 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1844 | <pre><code> 'progress' SP <any> LF |
| 1845 | LF?</code></pre> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1846 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1847 | <div class="paragraph"><p>The <code><any></code> part of the command may contain any sequence of bytes |
| 1848 | 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] | 1849 | 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] | 1850 | remove the leading part of the line, for example:</p></div> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1851 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1852 | <div class="content"> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1853 | <div class="literalblock"> |
| 1854 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1855 | <pre><code>frontend | git fast-import | sed 's/^progress //'</code></pre> |
Junio C Hamano | e52cf78 | 2007-08-19 19:15:52 | [diff] [blame] | 1856 | </div></div> |
| 1857 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1858 | <div class="paragraph"><p>Placing a <code>progress</code> command immediately after a <code>checkpoint</code> will |
| 1859 | 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] | 1860 | can safely access the refs that fast-import updated.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1861 | </div> |
| 1862 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1863 | <h3 id="_code_cat_blob_code"><code>cat-blob</code></h3> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1864 | <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] | 1865 | arranged with the <code>--cat-blob-fd</code> argument. The command otherwise |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1866 | has no impact on the current import; its main purpose is to |
| 1867 | retrieve blobs that may be in fast-import’s memory but not |
| 1868 | accessible from the target repository.</p></div> |
| 1869 | <div class="literalblock"> |
| 1870 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1871 | <pre><code> 'cat-blob' SP <dataref> LF</code></pre> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1872 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1873 | <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] | 1874 | set previously or a full 40-byte SHA-1 of a Git blob, preexisting or |
| 1875 | ready to be written.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1876 | <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] | 1877 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1878 | <div class="content"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1879 | <div class="literalblock"> |
| 1880 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1881 | <pre><code><sha1> SP 'blob' SP <size> LF |
| 1882 | <contents> LF</code></pre> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1883 | </div></div> |
| 1884 | </div></div> |
| 1885 | <div class="paragraph"><p>This command can be used anywhere in the stream that comments are |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1886 | accepted. In particular, the <code>cat-blob</code> command can be used in the |
| 1887 | middle of a commit but not in the middle of a <code>data</code> command.</p></div> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 1888 | <div class="paragraph"><p>See “Responses To Commands” below for details about how to read |
| 1889 | this output safely.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1890 | </div> |
| 1891 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1892 | <h3 id="_code_ls_code"><code>ls</code></h3> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1893 | <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] | 1894 | previously arranged with the <code>--cat-blob-fd</code> argument. This allows |
| 1895 | 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] | 1896 | 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] | 1897 | <code>filemodify</code>).</p></div> |
| 1898 | <div class="paragraph"><p>The <code>ls</code> command can be used anywhere in the stream that comments are |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1899 | accepted, including the middle of a commit.</p></div> |
| 1900 | <div class="dlist"><dl> |
| 1901 | <dt class="hdlist1"> |
| 1902 | Reading from the active commit |
| 1903 | </dt> |
| 1904 | <dd> |
| 1905 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1906 | 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] | 1907 | The path names a directory entry within fast-import’s |
| 1908 | active commit. The path must be quoted in this case. |
| 1909 | </p> |
| 1910 | <div class="literalblock"> |
| 1911 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1912 | <pre><code> 'ls' SP <path> LF</code></pre> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1913 | </div></div> |
| 1914 | </dd> |
| 1915 | <dt class="hdlist1"> |
| 1916 | Reading from a named tree |
| 1917 | </dt> |
| 1918 | <dd> |
| 1919 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1920 | 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] | 1921 | full 40-byte SHA-1 of a Git tag, commit, or tree object, |
| 1922 | preexisting or waiting to be written. |
| 1923 | The path is relative to the top level of the tree |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1924 | named by <code><dataref></code>. |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1925 | </p> |
| 1926 | <div class="literalblock"> |
| 1927 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1928 | <pre><code> 'ls' SP <dataref> SP <path> LF</code></pre> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1929 | </div></div> |
| 1930 | </dd> |
| 1931 | </dl></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1932 | <div class="paragraph"><p>See <code>filemodify</code> above for a detailed description of <code><path></code>.</p></div> |
| 1933 | <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] | 1934 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1935 | <div class="content"> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1936 | <div class="literalblock"> |
| 1937 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1938 | <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] | 1939 | </div></div> |
| 1940 | </div></div> |
| 1941 | <div class="paragraph"><p>The <dataref> represents the blob, tree, or commit object at <path> |
| 1942 | and can be used in later <em>cat-blob</em>, <em>filemodify</em>, or <em>ls</em> commands.</p></div> |
| 1943 | <div class="paragraph"><p>If there is no file or subtree at that path, <em>git fast-import</em> will |
| 1944 | instead report</p></div> |
| 1945 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1946 | <div class="content"> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1947 | <div class="literalblock"> |
| 1948 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1949 | <pre><code>missing SP <path> LF</code></pre> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 1950 | </div></div> |
| 1951 | </div></div> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 1952 | <div class="paragraph"><p>See “Responses To Commands” below for details about how to read |
| 1953 | this output safely.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1954 | </div> |
| 1955 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1956 | <h3 id="_code_feature_code"><code>feature</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1957 | <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] | 1958 | it does not.</p></div> |
| 1959 | <div class="literalblock"> |
| 1960 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1961 | <pre><code> 'feature' SP <feature> ('=' <argument>)? LF</code></pre> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1962 | </div></div> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1963 | <div class="paragraph"><p>The <feature> part of the command may be any one of the following:</p></div> |
| 1964 | <div class="dlist"><dl> |
| 1965 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1966 | date-format |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1967 | </dt> |
| 1968 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1969 | export-marks |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1970 | </dt> |
| 1971 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1972 | relative-marks |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1973 | </dt> |
| 1974 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1975 | no-relative-marks |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1976 | </dt> |
| 1977 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1978 | force |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1979 | </dt> |
| 1980 | <dd> |
| 1981 | <p> |
| 1982 | Act as though the corresponding command-line option with |
| 1983 | a leading <em>--</em> was passed on the command line |
| 1984 | (see OPTIONS, above). |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1985 | </p> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1986 | </dd> |
| 1987 | <dt class="hdlist1"> |
| 1988 | import-marks |
| 1989 | </dt> |
Junio C Hamano | d8fa022 | 2011-08-26 16:18:15 | [diff] [blame] | 1990 | <dt class="hdlist1"> |
| 1991 | import-marks-if-exists |
| 1992 | </dt> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1993 | <dd> |
| 1994 | <p> |
| 1995 | Like --import-marks except in two respects: first, only one |
Junio C Hamano | d8fa022 | 2011-08-26 16:18:15 | [diff] [blame] | 1996 | "feature import-marks" or "feature import-marks-if-exists" |
| 1997 | command is allowed per stream; second, an --import-marks= |
| 1998 | or --import-marks-if-exists command-line option overrides |
| 1999 | any of these "feature" commands in the stream; third, |
| 2000 | "feature import-marks-if-exists" like a corresponding |
| 2001 | command-line option silently skips a nonexistent file. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2002 | </p> |
| 2003 | </dd> |
| 2004 | <dt class="hdlist1"> |
| 2005 | cat-blob |
| 2006 | </dt> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2007 | <dt class="hdlist1"> |
| 2008 | ls |
| 2009 | </dt> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2010 | <dd> |
| 2011 | <p> |
Junio C Hamano | 73d1051 | 2011-03-01 01:02:38 | [diff] [blame] | 2012 | Require that the backend support the <em>cat-blob</em> or <em>ls</em> command. |
| 2013 | Versions of fast-import not supporting the specified command |
| 2014 | will exit with a message indicating so. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2015 | This lets the import error out early with a clear message, |
| 2016 | rather than wasting time on the early part of an import |
| 2017 | before the unsupported command is detected. |
| 2018 | </p> |
| 2019 | </dd> |
Junio C Hamano | 23e3f53 | 2011-02-10 02:05:29 | [diff] [blame] | 2020 | <dt class="hdlist1"> |
| 2021 | notes |
| 2022 | </dt> |
| 2023 | <dd> |
| 2024 | <p> |
| 2025 | Require that the backend support the <em>notemodify</em> (N) |
| 2026 | subcommand to the <em>commit</em> command. |
| 2027 | Versions of fast-import not supporting notes will exit |
| 2028 | with a message indicating so. |
| 2029 | </p> |
| 2030 | </dd> |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 2031 | <dt class="hdlist1"> |
| 2032 | done |
| 2033 | </dt> |
| 2034 | <dd> |
| 2035 | <p> |
| 2036 | Error out if the stream ends without a <em>done</em> command. |
| 2037 | Without this feature, errors causing the frontend to end |
| 2038 | abruptly at a convenient point in the stream can go |
Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 2039 | undetected. This may occur, for example, if an import |
| 2040 | front end dies in mid-operation without emitting SIGTERM |
| 2041 | or SIGKILL at its subordinate git fast-import instance. |
Junio C Hamano | fbc773c | 2011-08-02 00:09:12 | [diff] [blame] | 2042 | </p> |
| 2043 | </dd> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2044 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2045 | </div> |
| 2046 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2047 | <h3 id="_code_option_code"><code>option</code></h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2048 | <div class="paragraph"><p>Processes the specified option so that git fast-import behaves in a |
| 2049 | way that suits the frontend’s needs. |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2050 | Note that options specified by the frontend are overridden by any |
| 2051 | options the user may specify to git fast-import itself.</p></div> |
| 2052 | <div class="literalblock"> |
| 2053 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2054 | <pre><code> 'option' SP <option> LF</code></pre> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2055 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2056 | <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] | 2057 | listed in the OPTIONS section that do not change import semantics, |
| 2058 | without the leading <em>--</em> and is treated in the same way.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2059 | <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] | 2060 | feature commands), to give an option command after any non-option |
| 2061 | command is an error.</p></div> |
Junio C Hamano | e1aeb5e | 2014-06-06 19:16:29 | [diff] [blame] | 2062 | <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] | 2063 | not be passed as option:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2064 | <div class="ulist"><ul> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2065 | <li> |
| 2066 | <p> |
| 2067 | date-format |
| 2068 | </p> |
| 2069 | </li> |
| 2070 | <li> |
| 2071 | <p> |
| 2072 | import-marks |
| 2073 | </p> |
| 2074 | </li> |
| 2075 | <li> |
| 2076 | <p> |
| 2077 | export-marks |
| 2078 | </p> |
| 2079 | </li> |
| 2080 | <li> |
| 2081 | <p> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2082 | cat-blob-fd |
| 2083 | </p> |
| 2084 | </li> |
| 2085 | <li> |
| 2086 | <p> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 2087 | force |
| 2088 | </p> |
| 2089 | </li> |
| 2090 | </ul></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2091 | </div> |
| 2092 | <div class="sect2"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2093 | <h3 id="_code_done_code"><code>done</code></h3> |
| 2094 | <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] | 2095 | 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] | 2096 | <div class="paragraph"><p>If the <code>--done</code> command-line option or <code>feature done</code> command is |
| 2097 | 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] | 2098 | stream.</p></div> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2099 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2100 | </div> |
| 2101 | </div> |
| 2102 | <div class="sect1"> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2103 | <h2 id="_responses_to_commands">Responses To Commands</h2> |
| 2104 | <div class="sectionbody"> |
| 2105 | <div class="paragraph"><p>New objects written by fast-import are not available immediately. |
| 2106 | Most fast-import commands have no visible effect until the next |
| 2107 | checkpoint (or completion). The frontend can send commands to |
| 2108 | fill fast-import’s input pipe without worrying about how quickly |
| 2109 | they will take effect, which improves performance by simplifying |
| 2110 | scheduling.</p></div> |
| 2111 | <div class="paragraph"><p>For some frontends, though, it is useful to be able to read back |
| 2112 | data from the current repository as it is being updated (for |
| 2113 | example when the source material describes objects in terms of |
| 2114 | patches to be applied to previously imported objects). This can |
| 2115 | be accomplished by connecting the frontend and fast-import via |
| 2116 | bidirectional pipes:</p></div> |
| 2117 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2118 | <div class="content"> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2119 | <div class="literalblock"> |
| 2120 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2121 | <pre><code>mkfifo fast-import-output |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2122 | frontend <fast-import-output | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2123 | git fast-import >fast-import-output</code></pre> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2124 | </div></div> |
| 2125 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2126 | <div class="paragraph"><p>A frontend set up this way can use <code>progress</code>, <code>ls</code>, and <code>cat-blob</code> |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2127 | commands to read information from the import in progress.</p></div> |
| 2128 | <div class="paragraph"><p>To avoid deadlock, such frontends must completely consume any |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2129 | pending output from <code>progress</code>, <code>ls</code>, and <code>cat-blob</code> before |
Junio C Hamano | 4eda136 | 2012-04-23 20:55:49 | [diff] [blame] | 2130 | performing writes to fast-import that might block.</p></div> |
| 2131 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2132 | </div> |
| 2133 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2134 | <h2 id="_crash_reports">Crash Reports</h2> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2135 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2136 | <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] | 2137 | non-zero exit status and create a crash report in the top level of |
| 2138 | the Git repository it was importing into. Crash reports contain |
| 2139 | 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] | 2140 | recent commands that lead up to the crash.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2141 | <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] | 2142 | progress commands) are shown in the command history within the crash |
| 2143 | report, but raw file data and commit messages are excluded from the |
| 2144 | crash report. This exclusion saves space within the report file |
| 2145 | and reduces the amount of buffering that fast-import must perform |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2146 | during execution.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2147 | <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] | 2148 | packfile and export the marks table. This allows the frontend |
| 2149 | developer to inspect the repository state and resume the import from |
| 2150 | the point where it crashed. The modified branches and tags are not |
| 2151 | updated during a crash, as the import did not complete successfully. |
| 2152 | Branch and tag information can be found in the crash report and |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2153 | must be applied manually if the update is needed.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2154 | <div class="paragraph"><p>An example crash:</p></div> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2155 | <div class="exampleblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2156 | <div class="content"> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2157 | <div class="literalblock"> |
| 2158 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2159 | <pre><code>$ cat >in <<END_OF_INPUT |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2160 | # my very first test commit |
| 2161 | commit refs/heads/master |
| 2162 | committer Shawn O. Pearce <spearce> 19283 -0400 |
| 2163 | # who is that guy anyway? |
| 2164 | data <<EOF |
| 2165 | this is my commit |
| 2166 | EOF |
| 2167 | M 644 inline .gitignore |
| 2168 | data <<EOF |
| 2169 | .gitignore |
| 2170 | EOF |
| 2171 | M 777 inline bob |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2172 | END_OF_INPUT</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2173 | </div></div> |
| 2174 | <div class="literalblock"> |
| 2175 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2176 | <pre><code>$ git fast-import <in |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2177 | fatal: Corrupt mode: M 777 inline bob |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2178 | 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] | 2179 | </div></div> |
| 2180 | <div class="literalblock"> |
| 2181 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2182 | <pre><code>$ cat .git/fast_import_crash_8434 |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2183 | fast-import crash report: |
| 2184 | fast-import process: 8434 |
| 2185 | parent process : 1391 |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2186 | at Sat Sep 1 00:58:12 2007</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2187 | </div></div> |
| 2188 | <div class="literalblock"> |
| 2189 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2190 | <pre><code>fatal: Corrupt mode: M 777 inline bob</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2191 | </div></div> |
| 2192 | <div class="literalblock"> |
| 2193 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2194 | <pre><code>Most Recent Commands Before Crash |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2195 | --------------------------------- |
| 2196 | # my very first test commit |
| 2197 | commit refs/heads/master |
| 2198 | committer Shawn O. Pearce <spearce> 19283 -0400 |
| 2199 | # who is that guy anyway? |
| 2200 | data <<EOF |
| 2201 | M 644 inline .gitignore |
| 2202 | data <<EOF |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2203 | * M 777 inline bob</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2204 | </div></div> |
| 2205 | <div class="literalblock"> |
| 2206 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2207 | <pre><code>Active Branch LRU |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2208 | ----------------- |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2209 | active_branches = 1 cur, 5 max</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2210 | </div></div> |
| 2211 | <div class="literalblock"> |
| 2212 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2213 | <pre><code>pos clock name |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2214 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2215 | 1) 0 refs/heads/master</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2216 | </div></div> |
| 2217 | <div class="literalblock"> |
| 2218 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2219 | <pre><code>Inactive Branches |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2220 | ----------------- |
| 2221 | refs/heads/master: |
| 2222 | status : active loaded dirty |
| 2223 | tip commit : 0000000000000000000000000000000000000000 |
| 2224 | old tree : 0000000000000000000000000000000000000000 |
| 2225 | cur tree : 0000000000000000000000000000000000000000 |
| 2226 | commit clock: 0 |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2227 | last pack :</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2228 | </div></div> |
| 2229 | <div class="literalblock"> |
| 2230 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2231 | <pre><code>------------------- |
| 2232 | END OF CRASH REPORT</code></pre> |
Junio C Hamano | 2139193 | 2008-02-16 10:02:54 | [diff] [blame] | 2233 | </div></div> |
| 2234 | </div></div> |
| 2235 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2236 | </div> |
| 2237 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2238 | <h2 id="_tips_and_tricks">Tips and Tricks</h2> |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2239 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2240 | <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] | 2241 | users of fast-import, and are offered here as suggestions.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2242 | <div class="sect2"> |
| 2243 | <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] | 2244 | <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] | 2245 | (<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] | 2246 | 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] | 2247 | object SHA-1 that corresponds to it. If the frontend can tie |
| 2248 | the marks back to the source repository, it is easy to verify the |
| 2249 | accuracy and completeness of the import by comparing each Git |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2250 | commit to the corresponding source revision.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2251 | <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] | 2252 | 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] | 2253 | number or the Subversion revision number.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2254 | </div> |
| 2255 | <div class="sect2"> |
| 2256 | <h3 id="_freely_skip_around_branches">Freely Skip Around Branches</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2257 | <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] | 2258 | at a time during an import. Although doing so might be slightly |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2259 | 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] | 2260 | code considerably.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2261 | <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] | 2262 | cost of activating an inactive branch is so low that bouncing around |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2263 | between branches has virtually no impact on import performance.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2264 | </div> |
| 2265 | <div class="sect2"> |
| 2266 | <h3 id="_handling_renames">Handling Renames</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2267 | <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] | 2268 | name(s) and modify the new name(s) during the corresponding commit. |
| 2269 | Git performs rename detection after-the-fact, rather than explicitly |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2270 | during a commit.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2271 | </div> |
| 2272 | <div class="sect2"> |
| 2273 | <h3 id="_use_tag_fixup_branches">Use Tag Fixup Branches</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2274 | <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] | 2275 | files which are not from the same commit/changeset. Or to create |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2276 | 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] | 2277 | <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] | 2278 | least one commit which “fixes up” the files to match the content |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2279 | 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] | 2280 | outside of your normal branch space to the base commit for the tag, |
| 2281 | then commit one or more file fixup commits, and finally tag the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2282 | dummy branch.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2283 | <div class="paragraph"><p>For example since all normal branches are stored under <code>refs/heads/</code> |
| 2284 | 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] | 2285 | the fixup branch used by the importer to have namespace conflicts |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2286 | with real branches imported from the source (the name <code>TAG_FIXUP</code> |
| 2287 | is not <code>refs/heads/TAG_FIXUP</code>).</p></div> |
| 2288 | <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] | 2289 | commit(s) which are supplying file revisions to the fixup branch. |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 2290 | 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] | 2291 | through the real commit history and properly annotate the source |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2292 | files.</p></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2293 | <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] | 2294 | to remove the dummy branch.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2295 | </div> |
| 2296 | <div class="sect2"> |
| 2297 | <h3 id="_import_now_repack_later">Import Now, Repack Later</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2298 | <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] | 2299 | and ready for use. Typically this takes only a very short time, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2300 | even for considerably large projects (100,000+ commits).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2301 | <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] | 2302 | locality and access performance. It can also take hours on extremely |
| 2303 | large projects (especially if -f and a large --window parameter is |
| 2304 | used). Since repacking is safe to run alongside readers and writers, |
| 2305 | 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] | 2306 | 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] | 2307 | <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] | 2308 | or performance tests until repacking is completed. fast-import outputs |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2309 | suboptimal packfiles that are simply never seen in real use |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2310 | situations.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2311 | </div> |
| 2312 | <div class="sect2"> |
| 2313 | <h3 id="_repacking_historical_data">Repacking Historical Data</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2314 | <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] | 2315 | last year), consider expending some extra CPU time and supplying |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 2316 | --window=50 (or higher) when you run <em>git repack</em>. |
Junio C Hamano | dfc4ce7 | 2007-02-07 23:17:29 | [diff] [blame] | 2317 | This will take longer, but will also produce a smaller packfile. |
| 2318 | You only need to expend the effort once, and everyone using your |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2319 | project will benefit from the smaller repository.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2320 | </div> |
| 2321 | <div class="sect2"> |
| 2322 | <h3 id="_include_some_progress_messages">Include Some Progress Messages</h3> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2323 | <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] | 2324 | to fast-import. The contents of the messages are entirely free-form, |
| 2325 | so one suggestion would be to output the current month and year |
| 2326 | each time the current commit date moves into the next month. |
| 2327 | Your users will feel better knowing how much of the data stream |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2328 | has been processed.</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2329 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2330 | </div> |
| 2331 | </div> |
| 2332 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2333 | <h2 id="_packfile_optimization">Packfile Optimization</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2334 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2335 | <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] | 2336 | blob written. Unless specifically arranged for by the frontend, |
| 2337 | this will probably not be a prior version of the same file, so the |
| 2338 | generated delta will not be the smallest possible. The resulting |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2339 | packfile will be compressed, but will not be optimal.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2340 | <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] | 2341 | single file (for example reading an RCS/CVS ,v file) can choose |
| 2342 | to supply all revisions of that file as a sequence of consecutive |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2343 | <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] | 2344 | revisions against each other, saving space in the final packfile. |
| 2345 | Marks can be used to later identify individual file revisions during |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2346 | a sequence of <code>commit</code> commands.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2347 | <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] | 2348 | 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] | 2349 | it is received on standard input, while Git typically organizes |
| 2350 | data within packfiles to make the most recent (current tip) data |
| 2351 | appear before historical data. Git also clusters commits together, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2352 | speeding up revision traversal through better cache locality.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2353 | <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] | 2354 | 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] | 2355 | Git to reorganize the packfiles for faster data access. If blob |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2356 | 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] | 2357 | to force recomputation of all deltas can significantly reduce the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2358 | final packfile size (30-50% smaller can be quite typical).</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2359 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2360 | </div> |
| 2361 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2362 | <h2 id="_memory_utilization">Memory Utilization</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2363 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2364 | <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] | 2365 | requires to perform an import. Like critical sections of core |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 2366 | Git, fast-import uses its own memory allocators to amortize any overheads |
| 2367 | associated with malloc. In practice fast-import tends to amortize any |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2368 | 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] | 2369 | <div class="sect2"> |
| 2370 | <h3 id="_per_object">per object</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2371 | <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] | 2372 | this execution. On a 32 bit system the structure is 32 bytes, |
| 2373 | on a 64 bit system the structure is 40 bytes (due to the larger |
| 2374 | pointer sizes). Objects in the table are not deallocated until |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2375 | fast-import terminates. Importing 2 million objects on a 32 bit system |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2376 | will require approximately 64 MiB of memory.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2377 | <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] | 2378 | (the unique SHA-1). This storage configuration allows fast-import to reuse |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2379 | an existing or already written object and avoid writing duplicates |
| 2380 | to the output packfile. Duplicate blobs are surprisingly common |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2381 | 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] | 2382 | </div> |
| 2383 | <div class="sect2"> |
| 2384 | <h3 id="_per_mark">per mark</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2385 | <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] | 2386 | bytes, depending on pointer size) per mark. Although the array |
| 2387 | is sparse, frontends are still strongly encouraged to use marks |
| 2388 | 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] | 2389 | this import.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2390 | </div> |
| 2391 | <div class="sect2"> |
| 2392 | <h3 id="_per_branch">per branch</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2393 | <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] | 2394 | of the two classes is significantly different.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2395 | <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] | 2396 | bytes (32 bit or 64 bit systems, respectively), plus the length of |
Junio C Hamano | d333998 | 2007-02-09 08:38:48 | [diff] [blame] | 2397 | the branch name (typically under 200 bytes), per branch. fast-import will |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2398 | 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] | 2399 | of memory.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2400 | <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] | 2401 | also contain copies of every tree that has been recently modified on |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2402 | 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] | 2403 | branch became active, its contents will not be loaded into memory, |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2404 | 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] | 2405 | became active, then its contents will be loaded in memory.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2406 | <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] | 2407 | branch, their in-memory storage size can grow to a considerable size |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2408 | (see below).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2409 | <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] | 2410 | a simple least-recently-used algorithm. The LRU chain is updated on |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 2411 | 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] | 2412 | increased or decreased on the command line with --active-branches=.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2413 | </div> |
| 2414 | <div class="sect2"> |
| 2415 | <h3 id="_per_active_tree">per active tree</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2416 | <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] | 2417 | memory required for their entries (see “per active file” below). |
Junio C Hamano | a638742 | 2007-08-25 03:54:27 | [diff] [blame] | 2418 | 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] | 2419 | over the individual file entries.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2420 | </div> |
| 2421 | <div class="sect2"> |
| 2422 | <h3 id="_per_active_file_entry">per active file entry</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2423 | <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] | 2424 | bytes (32/64 bit platforms) per entry. To conserve space, file and |
| 2425 | tree names are pooled in a common string table, allowing the filename |
| 2426 | “Makefile” to use just 16 bytes (after including the string header |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2427 | 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] | 2428 | <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] | 2429 | and lazy loading of subtrees, allows fast-import to efficiently import |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2430 | 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] | 2431 | memory footprint (less than 2.7 MiB per active branch).</p></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2432 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2433 | </div> |
| 2434 | </div> |
| 2435 | <div class="sect1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2436 | <h2 id="_signals">Signals</h2> |
| 2437 | <div class="sectionbody"> |
| 2438 | <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] | 2439 | packfile early, simulating a <code>checkpoint</code> command. The impatient |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 2440 | operator can use this facility to peek at the objects and refs from an |
| 2441 | import in progress, at the cost of some added running time and worse |
| 2442 | compression.</p></div> |
| 2443 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2444 | </div> |
| 2445 | <div class="sect1"> |
Junio C Hamano | 1322024 | 2014-11-19 23:06:27 | [diff] [blame] | 2446 | <h2 id="_see_also">SEE ALSO</h2> |
| 2447 | <div class="sectionbody"> |
| 2448 | <div class="paragraph"><p><a href="git-fast-export.html">git-fast-export(1)</a></p></div> |
| 2449 | </div> |
| 2450 | </div> |
| 2451 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2452 | <h2 id="_git">GIT</h2> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2453 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2454 | <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] | 2455 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 2456 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 2457 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 2458 | <div id="footnotes"><hr /></div> |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2459 | <div id="footer"> |
| 2460 | <div id="footer-text"> |
Junio C Hamano | 1322024 | 2014-11-19 23:06:27 | [diff] [blame] | 2461 | Last updated 2014-11-19 15:05:50 PST |
Junio C Hamano | df60f44 | 2007-02-07 05:52:37 | [diff] [blame] | 2462 | </div> |
| 2463 | </div> |
| 2464 | </body> |
| 2465 | </html> |