|
1 | | -/* |
2 | | -(See Documentation/git-fast-import.txt for maintained documentation.) |
3 | | -Format of STDIN stream: |
4 | | -
|
5 | | - stream ::= cmd*; |
6 | | -
|
7 | | - cmd ::= new_blob |
8 | | - | new_commit |
9 | | - | new_tag |
10 | | - | reset_branch |
11 | | - | checkpoint |
12 | | - | progress |
13 | | - ; |
14 | | -
|
15 | | - new_blob ::= 'blob' lf |
16 | | - mark? |
17 | | - file_content; |
18 | | - file_content ::= data; |
19 | | -
|
20 | | - new_commit ::= 'commit' sp ref_str lf |
21 | | - mark? |
22 | | - ('author' (sp name)? sp '<' email '>' sp when lf)? |
23 | | - 'committer' (sp name)? sp '<' email '>' sp when lf |
24 | | - commit_msg |
25 | | - ('from' sp commit-ish lf)? |
26 | | - ('merge' sp commit-ish lf)* |
27 | | - (file_change | ls)* |
28 | | - lf?; |
29 | | - commit_msg ::= data; |
30 | | -
|
31 | | - ls ::= 'ls' sp '"' quoted(path) '"' lf; |
32 | | -
|
33 | | - file_change ::= file_clr |
34 | | - | file_del |
35 | | - | file_rnm |
36 | | - | file_cpy |
37 | | - | file_obm |
38 | | - | file_inm; |
39 | | - file_clr ::= 'deleteall' lf; |
40 | | - file_del ::= 'D' sp path_str lf; |
41 | | - file_rnm ::= 'R' sp path_str sp path_str lf; |
42 | | - file_cpy ::= 'C' sp path_str sp path_str lf; |
43 | | - file_obm ::= 'M' sp mode sp (hexsha1 | idnum) sp path_str lf; |
44 | | - file_inm ::= 'M' sp mode sp 'inline' sp path_str lf |
45 | | - data; |
46 | | - note_obm ::= 'N' sp (hexsha1 | idnum) sp commit-ish lf; |
47 | | - note_inm ::= 'N' sp 'inline' sp commit-ish lf |
48 | | - data; |
49 | | -
|
50 | | - new_tag ::= 'tag' sp tag_str lf |
51 | | - 'from' sp commit-ish lf |
52 | | - ('tagger' (sp name)? sp '<' email '>' sp when lf)? |
53 | | - tag_msg; |
54 | | - tag_msg ::= data; |
55 | | -
|
56 | | - reset_branch ::= 'reset' sp ref_str lf |
57 | | - ('from' sp commit-ish lf)? |
58 | | - lf?; |
59 | | -
|
60 | | - checkpoint ::= 'checkpoint' lf |
61 | | - lf?; |
62 | | -
|
63 | | - progress ::= 'progress' sp not_lf* lf |
64 | | - lf?; |
65 | | -
|
66 | | - # note: the first idnum in a stream should be 1 and subsequent |
67 | | - # idnums should not have gaps between values as this will cause |
68 | | - # the stream parser to reserve space for the gapped values. An |
69 | | - # idnum can be updated in the future to a new object by issuing |
70 | | - # a new mark directive with the old idnum. |
71 | | - # |
72 | | - mark ::= 'mark' sp idnum lf; |
73 | | - data ::= (delimited_data | exact_data) |
74 | | - lf?; |
75 | | -
|
76 | | - # note: delim may be any string but must not contain lf. |
77 | | - # data_line may contain any data but must not be exactly |
78 | | - # delim. |
79 | | - delimited_data ::= 'data' sp '<<' delim lf |
80 | | - (data_line lf)* |
81 | | - delim lf; |
82 | | -
|
83 | | - # note: declen indicates the length of binary_data in bytes. |
84 | | - # declen does not include the lf preceding the binary data. |
85 | | - # |
86 | | - exact_data ::= 'data' sp declen lf |
87 | | - binary_data; |
88 | | -
|
89 | | - # note: quoted strings are C-style quoting supporting \c for |
90 | | - # common escapes of 'c' (e..g \n, \t, \\, \") or \nnn where nnn |
91 | | - # is the signed byte value in octal. Note that the only |
92 | | - # characters which must actually be escaped to protect the |
93 | | - # stream formatting is: \, " and LF. Otherwise these values |
94 | | - # are UTF8. |
95 | | - # |
96 | | - commit-ish ::= (ref_str | hexsha1 | sha1exp_str | idnum); |
97 | | - ref_str ::= ref; |
98 | | - sha1exp_str ::= sha1exp; |
99 | | - tag_str ::= tag; |
100 | | - path_str ::= path | '"' quoted(path) '"' ; |
101 | | - mode ::= '100644' | '644' |
102 | | - | '100755' | '755' |
103 | | - | '120000' |
104 | | - ; |
105 | | -
|
106 | | - declen ::= # unsigned 32 bit value, ascii base10 notation; |
107 | | - bigint ::= # unsigned integer value, ascii base10 notation; |
108 | | - binary_data ::= # file content, not interpreted; |
109 | | -
|
110 | | - when ::= raw_when | rfc2822_when; |
111 | | - raw_when ::= ts sp tz; |
112 | | - rfc2822_when ::= # Valid RFC 2822 date and time; |
113 | | -
|
114 | | - sp ::= # ASCII space character; |
115 | | - lf ::= # ASCII newline (LF) character; |
116 | | -
|
117 | | - # note: a colon (':') must precede the numerical value assigned to |
118 | | - # an idnum. This is to distinguish it from a ref or tag name as |
119 | | - # GIT does not permit ':' in ref or tag strings. |
120 | | - # |
121 | | - idnum ::= ':' bigint; |
122 | | - path ::= # GIT style file path, e.g. "a/b/c"; |
123 | | - ref ::= # GIT ref name, e.g. "refs/heads/MOZ_GECKO_EXPERIMENT"; |
124 | | - tag ::= # GIT tag name, e.g. "FIREFOX_1_5"; |
125 | | - sha1exp ::= # Any valid GIT SHA1 expression; |
126 | | - hexsha1 ::= # SHA1 in hexadecimal format; |
127 | | -
|
128 | | - # note: name and email are UTF8 strings, however name must not |
129 | | - # contain '<' or lf and email must not contain any of the |
130 | | - # following: '<', '>', lf. |
131 | | - # |
132 | | - name ::= # valid GIT author/committer name; |
133 | | - email ::= # valid GIT author/committer email; |
134 | | - ts ::= # time since the epoch in seconds, ascii base10 notation; |
135 | | - tz ::= # GIT style timezone; |
136 | | -
|
137 | | - # note: comments, get-mark, ls-tree, and cat-blob requests may |
138 | | - # appear anywhere in the input, except within a data command. Any |
139 | | - # form of the data command always escapes the related input from |
140 | | - # comment processing. |
141 | | - # |
142 | | - # In case it is not clear, the '#' that starts the comment |
143 | | - # must be the first character on that line (an lf |
144 | | - # preceded it). |
145 | | - # |
146 | | -
|
147 | | - get_mark ::= 'get-mark' sp idnum lf; |
148 | | - cat_blob ::= 'cat-blob' sp (hexsha1 | idnum) lf; |
149 | | - ls_tree ::= 'ls' sp (hexsha1 | idnum) sp path_str lf; |
150 | | -
|
151 | | - comment ::= '#' not_lf* lf; |
152 | | - not_lf ::= # Any byte that is not ASCII newline (LF); |
153 | | -*/ |
154 | | - |
155 | 1 | #include "builtin.h" |
156 | 2 | #include "cache.h" |
157 | 3 | #include "repository.h" |
|
0 commit comments