Skip to content

Commit 1950925

Browse files
committed
Added NodeGit 0.4.0
1 parent 1d62213 commit 1950925

File tree

16 files changed

+399
-80
lines changed

16 files changed

+399
-80
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
`script/bootstrap`
2-
`script/server`
3-
`open http://localhost:4000`
1+
```
2+
script/bootstrap
3+
script/server
4+
5+
open http://localhost:4000
6+
```
47

58
## Generating the site
69

_config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ title: NodeGit
33
description: Asynchronous native Node bindings to libgit2
44
url: "http://nodegit.org"
55
date_format: "ordinal"
6-
current_nodegit_version: 0.3.3
6+
current_nodegit_version: 0.4.0
77
other_nodegit_versions:
88
- HEAD
9+
- 0.3.3
910
- 0.2.7
1011

1112
# Build settings

api/config/index.md

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,44 @@ menu_item: api
77
return_to:
88
"API Documentation Index": /api/
99
sections:
10+
"openDefault": "#openDefault"
11+
"#getString": "#getString"
1012
"#setInt64": "#setInt64"
1113
"#setMultivar": "#setMultivar"
1214
"#setString": "#setString"
1315
"#snapshot": "#snapshot"
1416
"LEVEL": "#LEVEL"
1517
---
1618

17-
## <a name="setInt64"></a><span>Config#</span>setInt64 <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
19+
## <a name="openDefault"></a><span>Config.</span>openDefault <span class="tags"><span class="async">Async</span></span>
20+
21+
```js
22+
Config.openDefault().then(function(config) {
23+
// Use config
24+
});
25+
```
26+
27+
| Returns | |
28+
| --- | --- |
29+
| [Config](/api/config/) | |
30+
31+
## <a name="getString"></a><span>Config#</span>getString <span class="tags"><span class="async">Async</span></span>
32+
33+
```js
34+
config.getString(name).then(function(string) {
35+
// Use string
36+
});
37+
```
38+
39+
| Parameters | Type |
40+
| --- | --- | --- |
41+
| name | String | the variable's name |
42+
43+
| Returns | |
44+
| --- | --- |
45+
| String | |
46+
47+
## <a name="setInt64"></a><span>Config#</span>setInt64 <span class="tags"><span class="sync">Sync</span></span>
1848

1949
```js
2050
var result = config.setInt64(name, value);
@@ -29,7 +59,7 @@ var result = config.setInt64(name, value);
2959
| --- | --- |
3060
| Number | 0 or an error code |
3161

32-
## <a name="setMultivar"></a><span>Config#</span>setMultivar <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
62+
## <a name="setMultivar"></a><span>Config#</span>setMultivar <span class="tags"><span class="sync">Sync</span></span>
3363

3464
```js
3565
var result = config.setMultivar(name, regexp, value);
@@ -45,10 +75,12 @@ var result = config.setMultivar(name, regexp, value);
4575
| --- | --- |
4676
| Number | |
4777

48-
## <a name="setString"></a><span>Config#</span>setString <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
78+
## <a name="setString"></a><span>Config#</span>setString <span class="tags"><span class="async">Async</span></span>
4979

5080
```js
51-
var result = config.setString(name, value);
81+
config.setString(name, value).then(function(result) {
82+
// Use result
83+
});
5284
```
5385

5486
| Parameters | Type |
@@ -60,7 +92,7 @@ var result = config.setString(name, value);
6092
| --- | --- |
6193
| Number | 0 or an error code |
6294

63-
## <a name="snapshot"></a><span>Config#</span>snapshot <span class="tags"><span class="async">Async</span><span class="experimental">Experimental</span></span>
95+
## <a name="snapshot"></a><span>Config#</span>snapshot <span class="tags"><span class="async">Async</span></span>
6496

6597
```js
6698
config.snapshot().then(function(config) {

api/convenient_line/index.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
layout: default
3+
menu_item: api
4+
title: ConvenientLine
5+
description: Version 0.3.0
6+
menu_item: api
7+
return_to:
8+
"API Documentation Index": /api/
9+
sections:
10+
"#content": "#content"
11+
"#contentLen": "#contentLen"
12+
"#contentOffset": "#contentOffset"
13+
"#newLineno": "#newLineno"
14+
"#numLines": "#numLines"
15+
"#oldLineno": "#oldLineno"
16+
"#origin": "#origin"
17+
"#rawContent": "#rawContent"
18+
---
19+
20+
## <a name="content"></a><span>ConvenientLine#</span>content <span class="tags"><span class="sync">Sync</span></span>
21+
22+
```js
23+
var string = convenientLine.content();
24+
```
25+
26+
The relevant line
27+
28+
| Returns | |
29+
| --- | --- |
30+
| String | |
31+
32+
## <a name="contentLen"></a><span>ConvenientLine#</span>contentLen <span class="tags"><span class="sync">Sync</span></span>
33+
34+
```js
35+
var string = convenientLine.contentLen();
36+
```
37+
38+
The content of the line
39+
40+
| Returns | |
41+
| --- | --- |
42+
| String | |
43+
44+
## <a name="contentOffset"></a><span>ConvenientLine#</span>contentOffset <span class="tags"><span class="sync">Sync</span></span>
45+
46+
```js
47+
var string = convenientLine.contentOffset();
48+
```
49+
50+
The content of the line
51+
52+
| Returns | |
53+
| --- | --- |
54+
| String | |
55+
56+
## <a name="newLineno"></a><span>ConvenientLine#</span>newLineno <span class="tags"><span class="sync">Sync</span></span>
57+
58+
```js
59+
var string = convenientLine.newLineno();
60+
```
61+
62+
The content of the line
63+
64+
| Returns | |
65+
| --- | --- |
66+
| String | |
67+
68+
## <a name="numLines"></a><span>ConvenientLine#</span>numLines <span class="tags"><span class="sync">Sync</span></span>
69+
70+
```js
71+
var string = convenientLine.numLines();
72+
```
73+
74+
The content of the line
75+
76+
| Returns | |
77+
| --- | --- |
78+
| String | |
79+
80+
## <a name="oldLineno"></a><span>ConvenientLine#</span>oldLineno <span class="tags"><span class="sync">Sync</span></span>
81+
82+
```js
83+
var string = convenientLine.oldLineno();
84+
```
85+
86+
The content of the line
87+
88+
| Returns | |
89+
| --- | --- |
90+
| String | |
91+
92+
## <a name="origin"></a><span>ConvenientLine#</span>origin <span class="tags"><span class="sync">Sync</span></span>
93+
94+
```js
95+
var string = convenientLine.origin();
96+
```
97+
98+
The content of the line
99+
100+
| Returns | |
101+
| --- | --- |
102+
| String | |
103+
104+
## <a name="rawContent"></a><span>ConvenientLine#</span>rawContent <span class="tags"><span class="sync">Sync</span></span>
105+
106+
```js
107+
var string = convenientLine.rawContent();
108+
```
109+
110+
The content of the line
111+
112+
| Returns | |
113+
| --- | --- |
114+
| String | |
115+

api/diff/index.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ menu_item: api
77
return_to:
88
"API Documentation Index": /api/
99
sections:
10+
"blobToBuffer": "#blobToBuffer"
1011
"indexToWorkdir": "#indexToWorkdir"
1112
"treeToIndex": "#treeToIndex"
1213
"treeToTree": "#treeToTree"
@@ -27,6 +28,31 @@ sections:
2728
"STATS_FORMAT": "#STATS_FORMAT"
2829
---
2930

31+
## <a name="blobToBuffer"></a><span>Diff.</span>blobToBuffer <span class="tags"><span class="async">Async</span></span>
32+
33+
```js
34+
Diff.blobToBuffer(old_blob, old_as_path, buffer, buffer_len, buffer_as_path, options, file_cb, hunk_cb, line_cb, payload).then(function(result) {
35+
// Use result
36+
});
37+
```
38+
39+
| Parameters | Type | |
40+
| --- | --- | --- |
41+
| old_blob | [Blob](/api/blob/) | Blob for old side of diff, or NULL for empty blob |
42+
| old_as_path | String | Treat old blob as if it had this filename; can be NULL |
43+
| buffer | String | Raw data for new side of diff, or NULL for empty |
44+
| buffer_len | Number | Length of raw data for new side of diff |
45+
| buffer_as_path | String | Treat buffer as if it had this filename; can be NULL |
46+
| options | [DiffOptions](/api/diff_options/) | Options for diff, or NULL for default options |
47+
| file_cb | DiffFileCb | Callback for "file"; made once if there is a diff; can be NULL |
48+
| hunk_cb | DiffHunkCb | Callback for each hunk in diff; can be NULL |
49+
| line_cb | DiffLineCb | Callback for each line in diff; can be NULL |
50+
| payload | Void | Payload passed to each callback function |
51+
52+
| Returns | |
53+
| --- | --- |
54+
| Number | 0 on success, non-zero callback return value, or error code |
55+
3056
## <a name="indexToWorkdir"></a><span>Diff.</span>indexToWorkdir <span class="tags"><span class="async">Async</span></span>
3157

3258
```js

api/graph/index.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,29 @@ menu_item: api
77
return_to:
88
"API Documentation Index": /api/
99
sections:
10+
"aheadBehind": "#aheadBehind"
1011
"descendantOf": "#descendantOf"
1112
---
1213

13-
## <a name="descendantOf"></a><span>Graph.</span>descendantOf <span class="tags"><span class="sync">Sync</span><span class="experimental">Experimental</span></span>
14+
## <a name="aheadBehind"></a><span>Graph.</span>aheadBehind <span class="tags"><span class="async">Async</span></span>
15+
16+
```js
17+
Graph.aheadBehind(repo, local, upstream).then(function(result) {
18+
// Use result
19+
});
20+
```
21+
22+
| Parameters | Type | |
23+
| --- | --- | --- |
24+
| repo | [Repository](/api/repository/) | the repository where the commits exist |
25+
| local | [Oid](/api/oid/) | the commit for local |
26+
| upstream | [Oid](/api/oid/) | the commit for upstream |
27+
28+
| Returns | |
29+
| --- | --- |
30+
| Number | number of unique from commits in `local` |
31+
32+
## <a name="descendantOf"></a><span>Graph.</span>descendantOf <span class="tags"><span class="sync">Sync</span></span>
1433

1534
```js
1635
var result = Graph.descendantOf(repo, commit, ancestor);

0 commit comments

Comments
 (0)