|
1 | 1 | #lang scribble/manual
|
2 | 2 |
|
3 |
| -@(require (for-label racket)) |
| 3 | +@(require (for-label racket libgit2) |
| 4 | + "doc.rkt") |
4 | 5 |
|
5 | 6 | @title{Revwalk}
|
6 | 7 |
|
7 |
| -@defmodule[libgit2/include/revwalk] |
| 8 | +@defmodule-lg2[libgit2/include/revwalk] |
8 | 9 |
|
9 | 10 |
|
10 |
| -@defproc[(git_revwalk_add_hide_cb |
11 |
| - [walk revwalk?] |
12 |
| - [hide_cb git_revwalk_hide_cb] |
13 |
| - [payload bytes?]) |
| 11 | +@defproc[(git_revwalk_add_hide_cb [walk revwalk?] |
| 12 | + [hide_cb git_revwalk_hide_cb] |
| 13 | + [payload bytes?]) |
14 | 14 | integer?]{
|
15 | 15 | Adds a callback function to hide a commit and its parents
|
16 | 16 |
|
17 | 17 | }
|
18 | 18 |
|
19 |
| -@defproc[(git_revwalk_free |
20 |
| - [walk revwalk?]) |
| 19 | +@defproc[(git_revwalk_free [walk revwalk?]) |
21 | 20 | void?]{
|
22 | 21 | Free a revision walker previously allocated.
|
23 | 22 |
|
24 | 23 | }
|
25 | 24 |
|
26 |
| -@defproc[(git_revwalk_hide |
27 |
| - [walk revwalk?] |
28 |
| - [commit_id oid?]) |
| 25 | +@defproc[(git_revwalk_hide [walk revwalk?] [commit_id oid?]) |
29 | 26 | integer?]{
|
30 | 27 | Mark a commit (and its ancestors) uninteresting for the output.
|
31 | 28 |
|
|
35 | 32 |
|
36 | 33 | }
|
37 | 34 |
|
38 |
| -@defproc[(git_revwalk_hide_glob |
39 |
| - [walk revwalk?] |
40 |
| - [glob string?]) |
| 35 | +@defproc[(git_revwalk_hide_glob [walk revwalk?] [glob string?]) |
41 | 36 | integer?]{
|
42 | 37 | Hide matching references.
|
43 | 38 |
|
|
49 | 44 |
|
50 | 45 | }
|
51 | 46 |
|
52 |
| -@defproc[(git_revwalk_hide_head |
53 |
| - [walk revwalk?]) |
| 47 | +@defproc[(git_revwalk_hide_head [walk revwalk?]) |
54 | 48 | integer?]{
|
55 | 49 | Hide the repository's HEAD
|
56 | 50 |
|
57 | 51 | }
|
58 | 52 |
|
59 |
| -@defproc[(git_revwalk_hide_ref |
60 |
| - [walk revwalk?] |
61 |
| - [refname string?]) |
| 53 | +@defproc[(git_revwalk_hide_ref [walk revwalk?] [refname string?]) |
62 | 54 | integer?]{
|
63 | 55 | Hide the OID pointed to by a reference
|
64 | 56 |
|
65 | 57 | The reference must point to a committish.
|
66 | 58 |
|
67 | 59 | }
|
68 | 60 |
|
69 |
| -@defproc[(git_revwalk_new |
70 |
| - [repo repository?]) |
| 61 | +@defproc[(git_revwalk_new [repo repository?]) |
71 | 62 | revwalk?]{
|
72 | 63 | Allocate a new revision walker to iterate through a repo.
|
73 | 64 |
|
|
79 | 70 |
|
80 | 71 | }
|
81 | 72 |
|
82 |
| -@defproc[(git_revwalk_next |
83 |
| - [out oid?] |
84 |
| - [walk revwalk?]) |
85 |
| - integer?]{ |
86 |
| - Get the next commit from the revision walk. |
| 73 | +@defproc[(git_revwalk_next [walk revwalk?]) |
| 74 | + (or/c oid? #f)]{ |
| 75 | + Pops the next commit from @racket[walk], or, there are no |
| 76 | + more commits, returns @racket[#f] |
87 | 77 |
|
88 |
| - The initial call to this method is not blocking when iterating through a repo with a time-sorting mode. |
| 78 | + The initial call to this method is not blocking when |
| 79 | + iterating through a repo with a time-sorting mode. |
89 | 80 |
|
90 |
| - Iterating with Topological or inverted modes makes the initial call blocking to preprocess the commit list, but this block should be mostly unnoticeable on most repositories (topological preprocessing times at 0.3s on the git.git repo). |
| 81 | + Iterating with Topological or inverted modes makes the |
| 82 | + initial call blocking to preprocess the commit list, but |
| 83 | + this block should be mostly unnoticeable on most |
| 84 | + repositories (topological preprocessing times at 0.3s on the |
| 85 | + git.git repo). |
91 | 86 |
|
92 | 87 | The revision walker is reset when the walk is over.
|
93 | 88 |
|
94 | 89 | }
|
95 | 90 |
|
96 |
| -@defproc[(git_revwalk_push |
97 |
| - [walk revwalk?] |
98 |
| - [id oid?]) |
| 91 | +@defproc[(git_revwalk_push [walk revwalk?] [id oid?]) |
99 | 92 | integer?]{
|
100 | 93 | Add a new root for the traversal
|
101 | 94 |
|
|
107 | 100 |
|
108 | 101 | }
|
109 | 102 |
|
110 |
| -@defproc[(git_revwalk_push_glob |
111 |
| - [walk revwalk?] |
112 |
| - [glob string?]) |
| 103 | +@defproc[(git_revwalk_push_glob [walk revwalk?] [glob string?]) |
113 | 104 | integer?]{
|
114 | 105 | Push matching references
|
115 | 106 |
|
|
121 | 112 |
|
122 | 113 | }
|
123 | 114 |
|
124 |
| -@defproc[(git_revwalk_push_head |
125 |
| - [walk revwalk?]) |
| 115 | +@defproc[(git_revwalk_push_head [walk revwalk?]) |
126 | 116 | integer?]{
|
127 | 117 | Push the repository's HEAD
|
128 | 118 |
|
129 | 119 | }
|
130 | 120 |
|
131 |
| -@defproc[(git_revwalk_push_range |
132 |
| - [walk revwalk?] |
133 |
| - [range string?]) |
| 121 | +@defproc[(git_revwalk_push_range [walk revwalk?] [range string?]) |
134 | 122 | integer?]{
|
135 | 123 | Push and hide the respective endpoints of the given range.
|
136 | 124 |
|
137 | 125 | The range should be of the form .. where each is in the form accepted by 'git_revparse_single'. The left-hand commit will be hidden and the right-hand commit pushed.
|
138 | 126 |
|
139 | 127 | }
|
140 | 128 |
|
141 |
| -@defproc[(git_revwalk_push_ref |
142 |
| - [walk revwalk?] |
143 |
| - [refname string?]) |
| 129 | +@defproc[(git_revwalk_push_ref [walk revwalk?] [refname string?]) |
144 | 130 | integer?]{
|
145 | 131 | Push the OID pointed to by a reference
|
146 | 132 |
|
147 | 133 | The reference must point to a committish.
|
148 | 134 |
|
149 | 135 | }
|
150 | 136 |
|
151 |
| -@defproc[(git_revwalk_repository |
152 |
| - [walk revwalk?]) |
| 137 | +@defproc[(git_revwalk_repository [walk revwalk?]) |
153 | 138 | repository?]{
|
154 | 139 | Return the repository on which this walker is operating.
|
155 | 140 |
|
156 | 141 | }
|
157 | 142 |
|
158 |
| -@defproc[(git_revwalk_reset |
159 |
| - [walker revwalk?]) |
| 143 | +@defproc[(git_revwalk_reset [walker revwalk?]) |
160 | 144 | void?]{
|
161 | 145 | Reset the revision walker for reuse.
|
162 | 146 |
|
|
166 | 150 |
|
167 | 151 | }
|
168 | 152 |
|
169 |
| -@defproc[(git_revwalk_simplify_first_parent |
170 |
| - [walk revwalk?]) |
| 153 | +@defproc[(git_revwalk_simplify_first_parent [walk revwalk?]) |
171 | 154 | void?]{
|
172 | 155 | Simplify the history by first-parent
|
173 | 156 |
|
174 | 157 | No parents other than the first for each commit will be enqueued.
|
175 | 158 |
|
176 | 159 | }
|
177 | 160 |
|
178 |
| -@defproc[(git_revwalk_sorting |
179 |
| - [walk revwalk?] |
180 |
| - [sort_mode _git_sort_t]) |
181 |
| - void?]{ |
| 161 | +@deftogether[ |
| 162 | + (@defproc[(git_revwalk_sorting [walk revwalk?] [sort_mode git_sort/c]) |
| 163 | + void?] |
| 164 | + @defthing[git_sort/c flat-contract?])]{ |
182 | 165 | Change the sorting mode when iterating through the repository's contents.
|
183 | 166 |
|
184 | 167 | Changing the sorting mode resets the walker.
|
|
0 commit comments