@@ -9,19 +9,24 @@ return_to:
9
9
sections :
10
10
" listContains " : " #listContains"
11
11
" listLength " : " #listLength"
12
- " listNew " : " #listNew"
13
- " listStreamBlob " : " #listStreamBlob"
14
- " listStreamData " : " #listStreamData"
15
- " listStreamFile " : " #listStreamFile"
12
+ " load " : " #load"
16
13
" unregister " : " #unregister"
14
+ " #applyToBlob " : " #applyToBlob"
15
+ " #applyToData " : " #applyToData"
16
+ " #applyToFile " : " #applyToFile"
17
+ " #free " : " #free"
17
18
" #lookup " : " #lookup"
18
19
" #register " : " #register"
19
20
" FLAG " : " #FLAG"
20
21
" MODE " : " #MODE"
21
22
" Instance Variables " : " #ivars"
22
23
---
23
24
24
- ## <a name =" listContains " ></a ><span >Filter.</span >listContains <span class =" tags " ><span class =" sync " >Sync</span ><span class =" experimental " >Experimental</span ></span >
25
+ ``` js
26
+ var filter = new Filter ();
27
+ ```
28
+
29
+ ## <a name =" listContains " ></a ><span >Filter.</span >listContains <span class =" tags " ><span class =" sync " >Sync</span ></span >
25
30
26
31
``` js
27
32
var result = Filter .listContains (filters, name);
@@ -36,7 +41,7 @@ var result = Filter.listContains(filters, name);
36
41
| --- | --- |
37
42
| Number | 1 if the filter is in the list, 0 otherwise |
38
43
39
- ## <a name =" listLength " ></a ><span >Filter.</span >listLength <span class =" tags " ><span class =" sync " >Sync</span ><span class = " experimental " >Experimental</ span >< /span >
44
+ ## <a name =" listLength " ></a ><span >Filter.</span >listLength <span class =" tags " ><span class =" sync " >Sync</span ></span >
40
45
41
46
``` js
42
47
var result = Filter .listLength (fl);
@@ -50,90 +55,98 @@ var result = Filter.listLength(fl);
50
55
| --- | --- |
51
56
| Number | The number of filters in the list |
52
57
53
- ## <a name =" listNew " ></a ><span >Filter.</span >listNew <span class =" tags " ><span class =" async " >Async</ span >< span class = " experimental " >Experimental </span ></span >
58
+ ## <a name =" load " ></a ><span >Filter.</span >load <span class =" tags " ><span class =" async " >Async</span ></span >
54
59
55
60
``` js
56
- Filter .listNew (repo, mode, options ).then (function (filterList ) {
61
+ Filter .load (repo, blob, path, mode, flags ).then (function (filterList ) {
57
62
// Use filterList
58
63
});
59
64
```
60
65
61
66
| Parameters | Type | |
62
67
| --- | --- | --- |
63
- | repo | [ Repository] ( /api/repository/ ) | |
64
- | mode | Number | |
65
- | options | Number | |
68
+ | repo | [ Repository] ( /api/repository/ ) | Repository object that contains ` path ` |
69
+ | blob | [ Blob] ( /api/blob/ ) | The blob to which the filter will be applied (if known) |
70
+ | path | String | Relative path of the file to be filtered |
71
+ | mode | Number | Filtering direction (WT->ODB or ODB->WT) |
72
+ | flags | Number | Combination of ` git_filter_flag_t ` flags |
66
73
67
74
| Returns | |
68
75
| --- | --- |
69
- | [ FilterList] ( /api/filter_list/ ) | |
76
+ | [ FilterList] ( /api/filter_list/ ) | Output newly created git_filter_list (or NULL) |
70
77
71
- ## <a name =" listStreamBlob " ></a ><span >Filter.</span >listStreamBlob <span class =" tags " ><span class =" sync " >Sync</ span >< span class = " experimental " >Experimental </span ></span >
78
+ ## <a name =" unregister " ></a ><span >Filter.</span >unregister <span class =" tags " ><span class =" sync " >Sync</span ></span >
72
79
73
80
``` js
74
- var result = Filter .listStreamBlob (filters, blob, target );
81
+ var result = Filter .unregister (name );
75
82
```
76
83
77
84
| Parameters | Type | |
78
85
| --- | --- | --- |
79
- | filters | [ FilterList] ( /api/filter_list/ ) | the list of filters to apply |
80
- | blob | [ Blob] ( /api/blob/ ) | the blob to filter |
81
- | target | [ Writestream] ( /api/writestream/ ) | the stream into which the data will be written |
86
+ | name | String | The name under which the filter was registered |
82
87
83
88
| Returns | |
84
89
| --- | --- |
85
- | Number | |
90
+ | Number | 0 on success, error code
91
+ <
92
+ 0 on failure |
86
93
87
- ## <a name =" listStreamData " ></a ><span >Filter. </span >listStreamData <span class =" tags " ><span class =" sync " >Sync</ span >< span class = " experimental " >Experimental </span ></span >
94
+ ## <a name =" applyToBlob " ></a ><span >Filter# </span >applyToBlob <span class =" tags " ><span class =" async " >Async </span ></span >
88
95
89
96
``` js
90
- var result = Filter .listStreamData (filters, data, target);
97
+ filter .applyToBlob (blob).then (function (buf ) {
98
+ // Use buf
99
+ });
91
100
```
92
101
93
- | Parameters | Type | |
102
+ | Parameters | Type |
94
103
| --- | --- | --- |
95
- | filters | [ FilterList] ( /api/filter_list/ ) | the list of filters to apply |
96
- | data | [ Buf] ( /api/buf/ ) | the buffer to filter |
97
- | target | [ Writestream] ( /api/writestream/ ) | the stream into which the data will be written |
104
+ | blob | [ Blob] ( /api/blob/ ) | the blob to filter |
98
105
99
106
| Returns | |
100
107
| --- | --- |
101
- | Number | |
108
+ | [ Buf ] ( /api/buf/ ) | buffer into which to store the filtered file |
102
109
103
- ## <a name =" listStreamFile " ></a ><span >Filter. </span >listStreamFile <span class =" tags " ><span class =" sync " >Sync</ span >< span class = " experimental " >Experimental </span ></span >
110
+ ## <a name =" applyToData " ></a ><span >Filter# </span >applyToData <span class =" tags " ><span class =" async " >Async </span ></span >
104
111
105
112
``` js
106
- var result = Filter .listStreamFile (filters, repo, path, target);
113
+ filter .applyToData (in ).then (function (buf ) {
114
+ // Use buf
115
+ });
107
116
```
108
117
109
- | Parameters | Type | |
118
+ | Parameters | Type |
110
119
| --- | --- | --- |
111
- | filters | [ FilterList] ( /api/filter_list/ ) | the list of filters to apply |
112
- | repo | [ Repository] ( /api/repository/ ) | the repository in which to perform the filtering |
113
- | path | String | the path of the file to filter, a relative path will be taken as relative to the workdir |
114
- | target | [ Writestream] ( /api/writestream/ ) | the stream into which the data will be written |
120
+ | in | [ Buf] ( /api/buf/ ) | Buffer containing the data to filter |
115
121
116
122
| Returns | |
117
123
| --- | --- |
118
- | Number | |
124
+ | [ Buf ] ( /api/buf/ ) | Buffer to store the result of the filtering |
119
125
120
- ## <a name =" unregister " ></a ><span >Filter. </span >unregister <span class =" tags " ><span class =" sync " >Sync</ span >< span class = " experimental " >Experimental </span ></span >
126
+ ## <a name =" applyToFile " ></a ><span >Filter# </span >applyToFile <span class =" tags " ><span class =" async " >Async </span ></span >
121
127
122
128
``` js
123
- var result = Filter .unregister (name);
129
+ filter .applyToFile (repo, path).then (function (buf ) {
130
+ // Use buf
131
+ });
124
132
```
125
133
126
- | Parameters | Type | |
134
+ | Parameters | Type |
127
135
| --- | --- | --- |
128
- | name | String | The name under which the filter was registered |
136
+ | repo | [ Repository] ( /api/repository/ ) | the repository in which to perform the filtering |
137
+ | path | String | the path of the file to filter, a relative path will be taken as relative to the workdir |
129
138
130
139
| Returns | |
131
140
| --- | --- |
132
- | Number | 0 on success, error code
133
- <
134
- 0 on failure |
141
+ | [ Buf] ( /api/buf/ ) | buffer into which to store the filtered file |
142
+
143
+ ## <a name =" free " ></a ><span >Filter#</span >free <span class =" tags " ><span class =" sync " >Sync</span ></span >
144
+
145
+ ``` js
146
+ filter .free ();
147
+ ```
135
148
136
- ## <a name =" lookup " ></a ><span >Filter#</span >lookup <span class =" tags " ><span class =" sync " >Sync</span ><span class = " experimental " >Experimental</ span >< /span >
149
+ ## <a name =" lookup " ></a ><span >Filter#</span >lookup <span class =" tags " ><span class =" sync " >Sync</span ></span >
137
150
138
151
``` js
139
152
var filter = filter .lookup (name);
@@ -147,7 +160,7 @@ var filter = filter.lookup(name);
147
160
| --- | --- |
148
161
| [ Filter] ( /api/filter/ ) | |
149
162
150
- ## <a name =" register " ></a ><span >Filter#</span >register <span class =" tags " ><span class =" sync " >Sync</span ><span class = " experimental " >Experimental</ span >< /span >
163
+ ## <a name =" register " ></a ><span >Filter#</span >register <span class =" tags " ><span class =" sync " >Sync</span ></span >
151
164
152
165
``` js
153
166
var result = filter .register (name, priority);
@@ -184,7 +197,11 @@ var result = filter.register(name, priority);
184
197
185
198
| Variable | Type | Description |
186
199
| --- | --- | --- |
200
+ | <a name =" apply " ></a >apply | FilterApplyFn | |
187
201
| <a name =" attributes " ></a >attributes | String | |
188
- | <a name =" stream " ></a >stream | FilterStreamFn | |
202
+ | <a name =" check " ></a >check | FilterCheckFn | |
203
+ | <a name =" cleanup " ></a >cleanup | FilterCleanupFn | |
204
+ | <a name =" initialize " ></a >initialize | FilterInitFn | |
205
+ | <a name =" shutdown " ></a >shutdown | FilterShutdownFn | |
189
206
| <a name =" version " ></a >version | Number | |
190
207
0 commit comments