-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doc the fields of some libgit2 types #22543
Changes from 6 commits
293bb5e
943fd2b
c0b45c0
5df68f3
4e29e74
801321c
67ebfcd
7f03f70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,6 +193,33 @@ end | |
Options for connecting through a proxy. | ||
|
||
Matches the [`git_proxy_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_proxy_options) struct. | ||
|
||
The fields represent: | ||
* `version`: version of the struct in use, in case this changes later. For now, always `1`. | ||
* `proxytype`: an `enum` for the type of proxy to use. | ||
Defined in [`git_proxy_t`](https://libgit2.github.com/libgit2/#HEAD/type/git_proxy_t). | ||
The corresponding Julia enum is [`GIT_PROXY`](@ref) and has values: | ||
- `PROXY_NONE`: do not attempt the connection through a proxy. | ||
- `PROXY_AUTO`: attempt to figure out the proxy configuration from the git configuration. | ||
- `PROXY_SPECIFIED`: connect using the URL given in the `url` field of this struct. | ||
Default is to auto-detect the proxy type. | ||
* `url`: the URL of the proxy. | ||
* `credential_cb`: a pointer to a callback function which will be called if the remote | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on the julia side this is just a function input, not a pointer right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nope, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do you need to do something with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think you have to do something much like the stuff in |
||
requires authentication to connect. | ||
* `certificate_cb`: a pointer to a callback function which will be called if certificate | ||
verification fails. This lets the user decide whether or not to keep connecting. If | ||
the function returns `1`, connecting will be allowed. If it returns `0`, the connection | ||
will not be allowed. A negative value can be used to return errors. | ||
* `payload`: the payload to be provided to the two callback functions. | ||
|
||
# Examples | ||
```julia-repl | ||
julia> fo = LibGit2.FetchOptions(); | ||
|
||
julia> fo.proxy_opts = LibGit2.ProxyOptions(url=Cstring("https://my_proxy_url.com")) | ||
|
||
julia> fetch(remote, "master", options=fo) | ||
``` | ||
""" | ||
@kwdef struct ProxyOptions | ||
version::Cuint = 1 | ||
|
@@ -287,6 +314,12 @@ end | |
LibGit2.DescribeFormatOptions | ||
|
||
Matches the [`git_describe_format_options`](https://libgit2.github.com/libgit2/#HEAD/type/git_describe_format_options) struct. | ||
|
||
The fields represent: | ||
* `version`: version of the struct in use, in case this changes later. For now, always `1`. | ||
* `abbreviated_size`: lower bound on the size of the abbreviated `GitHash` to use, defaulting to `7`. | ||
* `always_use_long_format`: set to `1` to use the long format for strings even if a short format can be used. | ||
* `dirty_suffix`: if set, this will be appended to the end of the description string if the [`workdir`](@ref) is dirty. | ||
""" | ||
@kwdef struct DescribeFormatOptions | ||
version::Cuint = 1 | ||
|
@@ -300,6 +333,18 @@ end | |
|
||
Description of one side of a delta. | ||
Matches the [`git_diff_file`](https://libgit2.github.com/libgit2/#HEAD/type/git_diff_file) struct. | ||
|
||
The fields represent: | ||
* `id`: the [`GitHash`](@ref) of the item in the diff. If the item is empty on this | ||
side of the diff (for instance, if the diff is of the removal of a file), this will | ||
be `GitHash(0)`. | ||
* `path`: a `NULL` terminated path to the item relative to the working directory of the repository. | ||
* `size`: the size of the item in bytes. | ||
* `flags`: a combination of the [`git_diff_flag_t`](https://libgit2.github.com/libgit2/#HEAD/type/git_diff_flag_t) | ||
flags. The `i`th bit of this integer sets the `i`th flag. | ||
* `mode`: the [`stat`](@ref) mode for the item. | ||
* `id_abbrev`: only present in LibGit2 versions newer than or equal to `0.25.0`. | ||
The length of the `id` field when converted using [`hex`](@ref). Usually equal to `GIT_OID_HEXSZ`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is GIT_OID_HEXSZ a C name or the Julia enum name? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For us it's |
||
""" | ||
struct DiffFile | ||
id::GitHash | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the Julia enum use the same spellings? worth spelling out the qualified Julia-side enum name those would be specified as
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done - look ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make check-whitespace
passed again locallyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great, though if it's not exported, maybe qualify it with the module name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're willing to wait, I hope to do another PR later tonight with examples that would show that it's not exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example added!