Skip to content

Commit bae6ed6

Browse files
authored
Merge pull request libgit2#4530 from tiennou/fix/docurium-missing-includes
Fix docurium missing includes
2 parents 771dfd1 + 04c48af commit bae6ed6

24 files changed

+275
-168
lines changed

api.docurium

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "libgit2",
33
"github": "libgit2/libgit2",
4-
"input": "include/git2",
4+
"input": "include",
55
"prefix": "git_",
66
"output": "docs",
77
"branch": "gh-pages",

include/git2/attr.h

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,22 @@ GIT_EXTERN(int) git_attr_get_many(
186186
size_t num_attr,
187187
const char **names);
188188

189+
/**
190+
* The callback used with git_attr_foreach.
191+
*
192+
* This callback will be invoked only once per attribute name, even if there
193+
* are multiple rules for a given file. The highest priority rule will be
194+
* used.
195+
*
196+
* @see git_attr_foreach.
197+
*
198+
* @param name The attribute name.
199+
* @param value The attribute value. May be NULL if the attribute is explicitly
200+
* set to UNSPECIFIED using the '!' sign.
201+
* @param payload A user-specified pointer.
202+
* @return 0 to continue looping, non-zero to stop. This value will be returned
203+
* from git_attr_foreach.
204+
*/
189205
typedef int (*git_attr_foreach_cb)(const char *name, const char *value, void *payload);
190206

191207
/**
@@ -196,13 +212,8 @@ typedef int (*git_attr_foreach_cb)(const char *name, const char *value, void *pa
196212
* @param path Path inside the repo to check attributes. This does not have
197213
* to exist, but if it does not, then it will be treated as a
198214
* plain file (i.e. not a directory).
199-
* @param callback Function to invoke on each attribute name and value. The
200-
* value may be NULL is the attribute is explicitly set to
201-
* UNSPECIFIED using the '!' sign. Callback will be invoked
202-
* only once per attribute name, even if there are multiple
203-
* rules for a given file. The highest priority rule will be
204-
* used. Return a non-zero value from this to stop looping.
205-
* The value will be returned from `git_attr_foreach`.
215+
* @param callback Function to invoke on each attribute name and value.
216+
* See git_attr_foreach_cb.
206217
* @param payload Passed on as extra parameter to callback function.
207218
* @return 0 on success, non-zero callback return value, or error code
208219
*/

include/git2/blame.h

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -48,45 +48,52 @@ typedef enum {
4848
/**
4949
* Blame options structure
5050
*
51-
* Use zeros to indicate default settings. It's easiest to use the
52-
* `GIT_BLAME_OPTIONS_INIT` macro:
53-
* git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
51+
* Initialize with `GIT_BLAME_OPTIONS_INIT`. Alternatively, you can
52+
* use `git_blame_init_options`.
5453
*
55-
* - `flags` is a combination of the `git_blame_flag_t` values above.
56-
* - `min_match_characters` is the lower bound on the number of alphanumeric
57-
* characters that must be detected as moving/copying within a file for it to
58-
* associate those lines with the parent commit. The default value is 20.
59-
* This value only takes effect if any of the `GIT_BLAME_TRACK_COPIES_*`
60-
* flags are specified.
61-
* - `newest_commit` is the id of the newest commit to consider. The default
62-
* is HEAD.
63-
* - `oldest_commit` is the id of the oldest commit to consider. The default
64-
* is the first commit encountered with a NULL parent.
65-
* - `min_line` is the first line in the file to blame. The default is 1 (line
66-
* numbers start with 1).
67-
* - `max_line` is the last line in the file to blame. The default is the last
68-
* line of the file.
6954
*/
7055
typedef struct git_blame_options {
7156
unsigned int version;
7257

58+
/** A combination of `git_blame_flag_t` */
7359
uint32_t flags;
60+
/** The lower bound on the number of alphanumeric
61+
* characters that must be detected as moving/copying within a file for it to
62+
* associate those lines with the parent commit. The default value is 20.
63+
* This value only takes effect if any of the `GIT_BLAME_TRACK_COPIES_*`
64+
* flags are specified.
65+
*/
7466
uint16_t min_match_characters;
67+
/** The id of the newest commit to consider. The default is HEAD. */
7568
git_oid newest_commit;
69+
/**
70+
* The id of the oldest commit to consider.
71+
* The default is the first commit encountered with a NULL parent.
72+
*/
7673
git_oid oldest_commit;
74+
/**
75+
* The first line in the file to blame.
76+
* The default is 1 (line numbers start with 1).
77+
*/
7778
size_t min_line;
79+
/**
80+
* The last line in the file to blame.
81+
* The default is the last line of the file.
82+
*/
7883
size_t max_line;
7984
} git_blame_options;
8085

8186
#define GIT_BLAME_OPTIONS_VERSION 1
8287
#define GIT_BLAME_OPTIONS_INIT {GIT_BLAME_OPTIONS_VERSION}
8388

8489
/**
85-
* Initializes a `git_blame_options` with default values. Equivalent to
86-
* creating an instance with GIT_BLAME_OPTIONS_INIT.
90+
* Initialize git_blame_options structure
8791
*
88-
* @param opts The `git_blame_options` struct to initialize
89-
* @param version Version of struct; pass `GIT_BLAME_OPTIONS_VERSION`
92+
* Initializes a `git_blame_options` with default values. Equivalent to creating
93+
* an instance with GIT_BLAME_OPTIONS_INIT.
94+
*
95+
* @param opts The `git_blame_options` struct to initialize.
96+
* @param version The struct version; pass `GIT_BLAME_OPTIONS_VERSION`.
9097
* @return Zero on success; -1 on failure.
9198
*/
9299
GIT_EXTERN(int) git_blame_init_options(
@@ -128,7 +135,7 @@ typedef struct git_blame_hunk {
128135
} git_blame_hunk;
129136

130137

131-
/* Opaque structure to hold blame results */
138+
/** Opaque structure to hold blame results */
132139
typedef struct git_blame git_blame;
133140

134141
/**

include/git2/branch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ GIT_EXTERN(int) git_branch_remote_name(
278278

279279

280280
/**
281-
* Retrieve the name fo the upstream remote of a local branch
281+
* Retrieve the name of the upstream remote of a local branch
282282
*
283283
* @param buf the buffer into which to write the name
284284
* @param repo the repository in which to look

include/git2/checkout.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,9 @@ typedef void (*git_checkout_perfdata_cb)(
243243
/**
244244
* Checkout options structure
245245
*
246-
* Zero out for defaults. Initialize with `GIT_CHECKOUT_OPTIONS_INIT` macro to
247-
* correctly set the `version` field. E.g.
246+
* Initialize with `GIT_CHECKOUT_OPTIONS_INIT`. Alternatively, you can
247+
* use `git_checkout_init_options`.
248248
*
249-
* git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
250249
*/
251250
typedef struct git_checkout_options {
252251
unsigned int version;
@@ -298,13 +297,15 @@ typedef struct git_checkout_options {
298297
#define GIT_CHECKOUT_OPTIONS_INIT {GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE}
299298

300299
/**
301-
* Initializes a `git_checkout_options` with default values. Equivalent to
302-
* creating an instance with GIT_CHECKOUT_OPTIONS_INIT.
303-
*
304-
* @param opts the `git_checkout_options` struct to initialize.
305-
* @param version Version of struct; pass `GIT_CHECKOUT_OPTIONS_VERSION`
306-
* @return Zero on success; -1 on failure.
307-
*/
300+
* Initialize git_checkout_options structure
301+
*
302+
* Initializes a `git_checkout_options` with default values. Equivalent to creating
303+
* an instance with GIT_CHECKOUT_OPTIONS_INIT.
304+
*
305+
* @param opts The `git_checkout_options` struct to initialize.
306+
* @param version The struct version; pass `GIT_CHECKOUT_OPTIONS_VERSION`.
307+
* @return Zero on success; -1 on failure.
308+
*/
308309
GIT_EXTERN(int) git_checkout_init_options(
309310
git_checkout_options *opts,
310311
unsigned int version);

include/git2/cherrypick.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ typedef struct {
3737
#define GIT_CHERRYPICK_OPTIONS_INIT {GIT_CHERRYPICK_OPTIONS_VERSION, 0, GIT_MERGE_OPTIONS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
3838

3939
/**
40-
* Initializes a `git_cherrypick_options` with default values. Equivalent to
41-
* creating an instance with GIT_CHERRYPICK_OPTIONS_INIT.
40+
* Initialize git_cherrypick_options structure
4241
*
43-
* @param opts the `git_cherrypick_options` struct to initialize
44-
* @param version Version of struct; pass `GIT_CHERRYPICK_OPTIONS_VERSION`
42+
* Initializes a `git_cherrypick_options` with default values. Equivalent to creating
43+
* an instance with GIT_CHERRYPICK_OPTIONS_INIT.
44+
*
45+
* @param opts The `git_cherrypick_options` struct to initialize.
46+
* @param version The struct version; pass `GIT_CHERRYPICK_OPTIONS_VERSION`.
4547
* @return Zero on success; -1 on failure.
4648
*/
4749
GIT_EXTERN(int) git_cherrypick_init_options(

include/git2/clone.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ typedef int (*git_repository_create_cb)(
9696
/**
9797
* Clone options structure
9898
*
99-
* Use the GIT_CLONE_OPTIONS_INIT to get the default settings, like this:
99+
* Initialize with `GIT_CLONE_OPTIONS_INIT`. Alternatively, you can
100+
* use `git_clone_init_options`.
100101
*
101-
* git_clone_options opts = GIT_CLONE_OPTIONS_INIT;
102102
*/
103103
typedef struct git_clone_options {
104104
unsigned int version;
@@ -169,11 +169,13 @@ typedef struct git_clone_options {
169169
GIT_FETCH_OPTIONS_INIT }
170170

171171
/**
172-
* Initializes a `git_clone_options` with default values. Equivalent to
173-
* creating an instance with GIT_CLONE_OPTIONS_INIT.
172+
* Initialize git_clone_options structure
174173
*
175-
* @param opts The `git_clone_options` struct to initialize
176-
* @param version Version of struct; pass `GIT_CLONE_OPTIONS_VERSION`
174+
* Initializes a `git_clone_options` with default values. Equivalent to creating
175+
* an instance with GIT_CLONE_OPTIONS_INIT.
176+
*
177+
* @param opts The `git_clone_options` struct to initialize.
178+
* @param version The struct version; pass `GIT_CLONE_OPTIONS_VERSION`.
177179
* @return Zero on success; -1 on failure.
178180
*/
179181
GIT_EXTERN(int) git_clone_init_options(

include/git2/describe.h

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,9 @@ typedef enum {
3636
/**
3737
* Describe options structure
3838
*
39-
* Initialize with `GIT_DESCRIBE_OPTIONS_INIT` macro to correctly set
40-
* the `version` field. E.g.
39+
* Initialize with `GIT_DESCRIBE_OPTIONS_INIT`. Alternatively, you can
40+
* use `git_describe_init_options`.
4141
*
42-
* git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;
4342
*/
4443
typedef struct git_describe_options {
4544
unsigned int version;
@@ -70,10 +69,24 @@ typedef struct git_describe_options {
7069
GIT_DESCRIBE_DEFAULT_MAX_CANDIDATES_TAGS, \
7170
}
7271

72+
/**
73+
* Initialize git_describe_options structure
74+
*
75+
* Initializes a `git_describe_options` with default values. Equivalent to creating
76+
* an instance with GIT_DESCRIBE_OPTIONS_INIT.
77+
*
78+
* @param opts The `git_describe_options` struct to initialize.
79+
* @param version The struct version; pass `GIT_DESCRIBE_OPTIONS_VERSION`.
80+
* @return Zero on success; -1 on failure.
81+
*/
7382
GIT_EXTERN(int) git_describe_init_options(git_describe_options *opts, unsigned int version);
7483

7584
/**
76-
* Options for formatting the describe string
85+
* Describe format options structure
86+
*
87+
* Initialize with `GIT_DESCRIBE_FORMAT_OPTIONS_INIT`. Alternatively, you can
88+
* use `git_describe_format_init_options`.
89+
*
7790
*/
7891
typedef struct {
7992
unsigned int version;
@@ -103,6 +116,16 @@ typedef struct {
103116
GIT_DESCRIBE_DEFAULT_ABBREVIATED_SIZE, \
104117
}
105118

119+
/**
120+
* Initialize git_describe_format_options structure
121+
*
122+
* Initializes a `git_describe_format_options` with default values. Equivalent to creating
123+
* an instance with GIT_DESCRIBE_FORMAT_OPTIONS_INIT.
124+
*
125+
* @param opts The `git_describe_format_options` struct to initialize.
126+
* @param version The struct version; pass `GIT_DESCRIBE_FORMAT_OPTIONS_VERSION`.
127+
* @return Zero on success; -1 on failure.
128+
*/
106129
GIT_EXTERN(int) git_describe_init_format_options(git_describe_format_options *opts, unsigned int version);
107130

108131
/**

include/git2/diff.h

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,13 @@ typedef struct {
437437
{GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, NULL, 3}
438438

439439
/**
440-
* Initializes a `git_diff_options` with default values. Equivalent to
441-
* creating an instance with GIT_DIFF_OPTIONS_INIT.
440+
* Initialize git_diff_options structure
442441
*
443-
* @param opts The `git_diff_options` struct to initialize
444-
* @param version Version of struct; pass `GIT_DIFF_OPTIONS_VERSION`
442+
* Initializes a `git_diff_options` with default values. Equivalent to creating
443+
* an instance with GIT_DIFF_OPTIONS_INIT.
444+
*
445+
* @param opts The `git_diff_options` struct to initialize.
446+
* @param version The struct version; pass `GIT_DIFF_OPTIONS_VERSION`.
445447
* @return Zero on success; -1 on failure.
446448
*/
447449
GIT_EXTERN(int) git_diff_init_options(
@@ -732,11 +734,13 @@ typedef struct {
732734
#define GIT_DIFF_FIND_OPTIONS_INIT {GIT_DIFF_FIND_OPTIONS_VERSION}
733735

734736
/**
735-
* Initializes a `git_diff_find_options` with default values. Equivalent to
736-
* creating an instance with GIT_DIFF_FIND_OPTIONS_INIT.
737+
* Initialize git_diff_find_options structure
738+
*
739+
* Initializes a `git_diff_find_options` with default values. Equivalent to creating
740+
* an instance with GIT_DIFF_FIND_OPTIONS_INIT.
737741
*
738-
* @param opts The `git_diff_find_options` struct to initialize
739-
* @param version Version of struct; pass `GIT_DIFF_FIND_OPTIONS_VERSION`
742+
* @param opts The `git_diff_find_options` struct to initialize.
743+
* @param version The struct version; pass `GIT_DIFF_FIND_OPTIONS_VERSION`.
740744
* @return Zero on success; -1 on failure.
741745
*/
742746
GIT_EXTERN(int) git_diff_find_init_options(
@@ -1394,12 +1398,13 @@ GIT_EXTERN(int) git_diff_commit_as_email(
13941398
const git_diff_options *diff_opts);
13951399

13961400
/**
1397-
* Initializes a `git_diff_format_email_options` with default values.
1401+
* Initialize git_diff_format_email_options structure
13981402
*
1399-
* Equivalent to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
1403+
* Initializes a `git_diff_format_email_options` with default values. Equivalent
1404+
* to creating an instance with GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT.
14001405
*
1401-
* @param opts The `git_diff_format_email_options` struct to initialize
1402-
* @param version Version of struct; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`
1406+
* @param opts The `git_blame_options` struct to initialize.
1407+
* @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
14031408
* @return Zero on success; -1 on failure.
14041409
*/
14051410
GIT_EXTERN(int) git_diff_format_email_init_options(
@@ -1409,8 +1414,9 @@ GIT_EXTERN(int) git_diff_format_email_init_options(
14091414
/**
14101415
* Patch ID options structure
14111416
*
1412-
* Initialize with `GIT_DIFF_PATCHID_OPTIONS_INIT` macro to
1413-
* correctly set the default values and version.
1417+
* Initialize with `GIT_PATCHID_OPTIONS_INIT`. Alternatively, you can
1418+
* use `git_patchid_init_options`.
1419+
*
14141420
*/
14151421
typedef struct git_diff_patchid_options {
14161422
unsigned int version;
@@ -1420,10 +1426,14 @@ typedef struct git_diff_patchid_options {
14201426
#define GIT_DIFF_PATCHID_OPTIONS_INIT { GIT_DIFF_PATCHID_OPTIONS_VERSION }
14211427

14221428
/**
1423-
* Initialize `git_diff_patchid_options` structure.
1429+
* Initialize git_diff_patchid_options structure
14241430
*
1425-
* Initializes the structure with default values. Equivalent to
1431+
* Initializes a `git_diff_patchid_options` with default values. Equivalent to
14261432
* creating an instance with `GIT_DIFF_PATCHID_OPTIONS_INIT`.
1433+
*
1434+
* @param opts The `git_diff_patchid_options` struct to initialize.
1435+
* @param version The struct version; pass `GIT_DIFF_PATCHID_OPTIONS_VERSION`.
1436+
* @return Zero on success; -1 on failure.
14271437
*/
14281438
GIT_EXTERN(int) git_diff_patchid_init_options(
14291439
git_diff_patchid_options *opts,

include/git2/merge.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,13 @@ typedef struct {
203203
#define GIT_MERGE_FILE_OPTIONS_INIT {GIT_MERGE_FILE_OPTIONS_VERSION}
204204

205205
/**
206+
* Initialize git_merge_file_options structure
207+
*
206208
* Initializes a `git_merge_file_options` with default values. Equivalent to
207-
* creating an instance with GIT_MERGE_FILE_OPTIONS_INIT.
209+
* creating an instance with `GIT_MERGE_FILE_OPTIONS_INIT`.
208210
*
209-
* @param opts the `git_merge_file_options` instance to initialize.
210-
* @param version the version of the struct; you should pass
211-
* `GIT_MERGE_FILE_OPTIONS_VERSION` here.
211+
* @param opts The `git_merge_file_options` struct to initialize.
212+
* @param version The struct version; pass `GIT_MERGE_FILE_OPTIONS_VERSION`.
212213
* @return Zero on success; -1 on failure.
213214
*/
214215
GIT_EXTERN(int) git_merge_file_init_options(
@@ -300,12 +301,13 @@ typedef struct {
300301
GIT_MERGE_OPTIONS_VERSION, GIT_MERGE_FIND_RENAMES }
301302

302303
/**
304+
* Initialize git_merge_options structure
305+
*
303306
* Initializes a `git_merge_options` with default values. Equivalent to
304-
* creating an instance with GIT_MERGE_OPTIONS_INIT.
307+
* creating an instance with `GIT_MERGE_OPTIONS_INIT`.
305308
*
306-
* @param opts the `git_merge_options` instance to initialize.
307-
* @param version the version of the struct; you should pass
308-
* `GIT_MERGE_OPTIONS_VERSION` here.
309+
* @param opts The `git_merge_options` struct to initialize.
310+
* @param version The struct version; pass `GIT_MERGE_OPTIONS_VERSION`.
309311
* @return Zero on success; -1 on failure.
310312
*/
311313
GIT_EXTERN(int) git_merge_init_options(

0 commit comments

Comments
 (0)