-
-
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 missing rebase methods #22556
Doc missing rebase methods #22556
Changes from 3 commits
7fd56fa
5910553
7529e69
587ed4d
611e56b
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 |
---|---|---|
|
@@ -16,6 +16,14 @@ function Base.count(rb::GitRebase) | |
return ccall((:git_rebase_operation_entrycount, :libgit2), Csize_t, (Ptr{Void},), rb.ptr) | ||
end | ||
|
||
""" | ||
current(rb::GitRebase) -> Csize_t | ||
|
||
Return the index of the current [`RebaseOperation`](@ref). If no operation has | ||
yet been applied (because the [`GitRebase`](@ref) has been constructed but `next` | ||
has not yet been called or iteration over `rb` has not yet begun), return | ||
`GIT_REBASE_NO_OPERATION`, which is equal to `SIZE_MAX` of `Csize_t`. | ||
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 someone who knows julia but not C, SIZE_MAX isn't very meaningful - even if you do know C, it's the kind of thing I'd need to look up every time 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. Should we make it 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. typemax, if that's the same value |
||
""" | ||
function current(rb::GitRebase) | ||
return ccall((:git_rebase_operation_current, :libgit2), Csize_t, (Ptr{Void},), rb.ptr) | ||
end | ||
|
@@ -69,11 +77,27 @@ function commit(rb::GitRebase, sig::GitSignature) | |
return oid_ptr[] | ||
end | ||
|
||
""" | ||
abort(rb::GitRebase) -> Csize_t | ||
|
||
Cancels the in-progress rebase, undoing all changes made so far and returning | ||
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. "Cancel," perhaps? |
||
the parent repository of `rb` and its working directory to their state before | ||
the rebase was initiated. Returns `0` if the abort is successful, `GIT_ENOTFOUND` | ||
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 this under one of the julia side enums? 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.
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. if the julia enum name has a different prefix, should use that |
||
if no rebase is in progress (for example, if the rebase had completed), and `-1` | ||
for other errors. | ||
""" | ||
function abort(rb::GitRebase) | ||
return ccall((:git_rebase_abort, :libgit2), Csize_t, | ||
(Ptr{Void},), rb.ptr) | ||
end | ||
|
||
""" | ||
finish(rb::GitRebase, sig::GitSignature) -> Csize_t | ||
|
||
Complete the rebase described by `rb`. `sig` is a [`GitSignature`](@ref) | ||
to specify the identity of the user finishing the rebase. Returns `0` if the | ||
rebase finishes successfully, `-1` if there is an error. | ||
""" | ||
function finish(rb::GitRebase, sig::GitSignature) | ||
return ccall((:git_rebase_finish, :libgit2), Csize_t, | ||
(Ptr{Void}, Ptr{SignatureStruct}), | ||
|
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.
is that the same as the julia
typemax(Csize_t)
?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.
Should be, but doesn't this vary by system?
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.
Csize_t
is pointer-sized in Julia, but not sure what widthGIT_REBASE_NO_OPERATION
is on the libgit2 sideThere 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.
https://github.com/libgit2/libgit2/blob/HEAD/include/git2/rebase.h#L122
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.
I think it's really cool that this is documented