@@ -9,19 +9,24 @@ return_to:
99sections :
1010 " listContains " : " #listContains"
1111 " listLength " : " #listLength"
12- " listNew " : " #listNew"
13- " listStreamBlob " : " #listStreamBlob"
14- " listStreamData " : " #listStreamData"
15- " listStreamFile " : " #listStreamFile"
12+ " load " : " #load"
1613 " unregister " : " #unregister"
14+ " #applyToBlob " : " #applyToBlob"
15+ " #applyToData " : " #applyToData"
16+ " #applyToFile " : " #applyToFile"
17+ " #free " : " #free"
1718 " #lookup " : " #lookup"
1819 " #register " : " #register"
1920 " FLAG " : " #FLAG"
2021 " MODE " : " #MODE"
2122 " Instance Variables " : " #ivars"
2223---
2324
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 >
2530
2631``` js
2732var result = Filter .listContains (filters, name);
@@ -36,7 +41,7 @@ var result = Filter.listContains(filters, name);
3641| --- | --- |
3742| Number | 1 if the filter is in the list, 0 otherwise |
3843
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 >
4045
4146``` js
4247var result = Filter .listLength (fl);
@@ -50,90 +55,98 @@ var result = Filter.listLength(fl);
5055| --- | --- |
5156| Number | The number of filters in the list |
5257
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 >
5459
5560``` js
56- Filter .listNew (repo, mode, options ).then (function (filterList ) {
61+ Filter .load (repo, blob, path, mode, flags ).then (function (filterList ) {
5762 // Use filterList
5863});
5964```
6065
6166| Parameters | Type | |
6267| --- | --- | --- |
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 |
6673
6774| Returns | |
6875| --- | --- |
69- | [ FilterList] ( /api/filter_list/ ) | |
76+ | [ FilterList] ( /api/filter_list/ ) | Output newly created git_filter_list (or NULL) |
7077
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 >
7279
7380``` js
74- var result = Filter .listStreamBlob (filters, blob, target );
81+ var result = Filter .unregister (name );
7582```
7683
7784| Parameters | Type | |
7885| --- | --- | --- |
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 |
8287
8388| Returns | |
8489| --- | --- |
85- | Number | |
90+ | Number | 0 on success, error code
91+ <
92+ 0 on failure |
8693
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 >
8895
8996``` js
90- var result = Filter .listStreamData (filters, data, target);
97+ filter .applyToBlob (blob).then (function (buf ) {
98+ // Use buf
99+ });
91100```
92101
93- | Parameters | Type | |
102+ | Parameters | Type |
94103| --- | --- | --- |
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 |
98105
99106| Returns | |
100107| --- | --- |
101- | Number | |
108+ | [ Buf ] ( /api/buf/ ) | buffer into which to store the filtered file |
102109
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 >
104111
105112``` js
106- var result = Filter .listStreamFile (filters, repo, path, target);
113+ filter .applyToData (in ).then (function (buf ) {
114+ // Use buf
115+ });
107116```
108117
109- | Parameters | Type | |
118+ | Parameters | Type |
110119| --- | --- | --- |
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 |
115121
116122| Returns | |
117123| --- | --- |
118- | Number | |
124+ | [ Buf ] ( /api/buf/ ) | Buffer to store the result of the filtering |
119125
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 >
121127
122128``` js
123- var result = Filter .unregister (name);
129+ filter .applyToFile (repo, path).then (function (buf ) {
130+ // Use buf
131+ });
124132```
125133
126- | Parameters | Type | |
134+ | Parameters | Type |
127135| --- | --- | --- |
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 |
129138
130139| Returns | |
131140| --- | --- |
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+ ```
135148
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 >
137150
138151``` js
139152var filter = filter .lookup (name);
@@ -147,7 +160,7 @@ var filter = filter.lookup(name);
147160| --- | --- |
148161| [ Filter] ( /api/filter/ ) | |
149162
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 >
151164
152165``` js
153166var result = filter .register (name, priority);
@@ -184,7 +197,11 @@ var result = filter.register(name, priority);
184197
185198| Variable | Type | Description |
186199| --- | --- | --- |
200+ | <a name =" apply " ></a >apply | FilterApplyFn | |
187201| <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 | |
189206| <a name =" version " ></a >version | Number | |
190207
0 commit comments