Skip to content
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

Merged
merged 8 commits into from
Jul 8, 2017
Merged

Doc the fields of some libgit2 types #22543

merged 8 commits into from
Jul 8, 2017

Conversation

kshyatt
Copy link
Contributor

@kshyatt kshyatt commented Jun 25, 2017

cf #18810

@kshyatt kshyatt added docs This change adds or pertains to documentation libgit2 The libgit2 library or the LibGit2 stdlib module labels Jun 25, 2017
@kshyatt kshyatt requested a review from ararslan June 25, 2017 23:01
* `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, if the [`workdir`](@ref) is dirty this will be appended to the description string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reorder this? if set, this will be appended ... if the workdir is dirty

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combined how?

* `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.
* `mode`: the [`stat`](@ref) mode for the item.
* `id_abbrev`: only present in versions newer than or equal to `0.25.0`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

libgit2 versions

@kshyatt
Copy link
Contributor Author

kshyatt commented Jun 26, 2017

Got everything?


The fields represent:
* `version`: version of the struct in use, in case this changes later. For now, always `1`.
* `proxytype`: the type of proxy to use. Default is to auto-detect it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could maybe use a xref to the enum that the values should come from

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's also a Julia enum, right?

@kshyatt
Copy link
Contributor Author

kshyatt commented Jun 26, 2017

Again checked make check-whitespace locally.

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).
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - look ok?

Copy link
Contributor Author

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 locally

Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example added!

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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is GIT_OID_HEXSZ a C name or the Julia enum name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For us it's OID_HEXSZ. I'll update.

@tkelman
Copy link
Contributor

tkelman commented Jun 28, 2017

doc build is failing here, one of the ref's might not be getting resolved?

@kshyatt
Copy link
Contributor Author

kshyatt commented Jun 28, 2017

Yeah, it was the link to GitProxy. I removed it because we have a description of all the options inline anyways.

@@ -351,6 +351,13 @@ These are used to select which global option to set or get and are used in `git_
SET_SSL_CERT_LOCATIONS = 12)


"""
Option flags for `GitProxy`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm this file is indented kind of strangely

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sure is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could fix it if you or someone else is feeling charitable, doesn't have to be in this pr tho

@kshyatt
Copy link
Contributor Author

kshyatt commented Jun 29, 2017

Anything else I should do?

- `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
Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, credential_cb::Ptr{Void}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need to do something with cfunction then to pass a julia function to it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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 base/libgit2/callbacks.jl

@kshyatt
Copy link
Contributor Author

kshyatt commented Jul 6, 2017

Anything else I should change?

Copy link
Member

@Sacha0 Sacha0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

superficially lgtm! :)

@kshyatt kshyatt merged commit 5851a26 into master Jul 8, 2017
@kshyatt kshyatt deleted the ksh/docgittypes branch July 8, 2017 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation libgit2 The libgit2 library or the LibGit2 stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants