Skip to content

Commit f82fc0f

Browse files
authored
Doc rebase stuff (#23432)
* Doc rebase stuff * fix version stuff picked "newer than or equal to" for consistency with existing docstrings
1 parent d9b7850 commit f82fc0f

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

base/libgit2/consts.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,20 @@ module Consts
176176
const RESET_MIXED = Cint(2) # SOFT plus reset index to the commit
177177
const RESET_HARD = Cint(3) # MIXED plus changes in working tree discarded
178178

179-
#rebase
179+
# rebase
180+
""" Options for what rebase operation is currently being performed on a commit.
181+
* `REBASE_OPERATION_PICK`: cherry-pick the commit in question.
182+
* `REBASE_OPERATION_REWORD`: cherry-pick the commit in question, but rewrite its
183+
message using the prompt.
184+
* `REBASE_OPERATION_EDIT`: cherry-pick the commit in question, but allow the user
185+
to edit the commit's contents and its message.
186+
* `REBASE_OPERATION_SQUASH`: squash the commit in question into the previous commit.
187+
The commit messages of the two commits will be merged.
188+
* `REBASE_OPERATION_FIXUP`: squash the commit in question into the previous commit.
189+
Only the commit message of the previous commit will be used.
190+
* `REBASE_OPERATION_EXEC`: do not cherry-pick a commit. Run a command and continue if
191+
the command exits successfully.
192+
"""
180193
@enum(GIT_REBASE_OPERATION, REBASE_OPERATION_PICK = Cint(0),
181194
REBASE_OPERATION_REWORD = Cint(1),
182195
REBASE_OPERATION_EDIT = Cint(2),

base/libgit2/types.jl

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,9 @@ The fields represent:
275275
* `download_tags`: whether to download tags present at the remote or not. The default
276276
is to request the tags for objects which are being downloaded anyway from the server.
277277
* `proxy_opts`: options for connecting to the remote through a proxy. See [`ProxyOptions`](@ref).
278-
Only present on libgit2 versions newer than 0.25.
278+
Only present on libgit2 versions newer than or equal to 0.25.0.
279279
* `custom_headers`: any extra headers needed for the fetch. Only present on libgit2 versions
280-
newer than 0.24.
280+
newer than or equal to 0.24.0.
281281
"""
282282
@kwdef struct FetchOptions
283283
version::Cuint = 1
@@ -576,6 +576,20 @@ Base.show(io::IO, ie::IndexEntry) = print(io, "IndexEntry($(string(ie.id)))")
576576
LibGit2.RebaseOptions
577577
578578
Matches the `git_rebase_options` struct.
579+
580+
The fields represent:
581+
* `version`: version of the struct in use, in case this changes later. For now, always `1`.
582+
* `quiet`: inform other git clients helping with/working on the rebase that the rebase
583+
should be done "quietly". Used for interoperability. The default is `1`.
584+
* `inmemory`: start an in-memory rebase. Callers working on the rebase can go through its
585+
steps and commit any changes, but cannot rewind HEAD or update the repository. The
586+
[`workdir`](@ref) will not be modified. Only present on libgit2 versions newer than or equal to 0.24.0.
587+
* `rewrite_notes_ref`: name of the reference to notes to use to rewrite the commit notes as
588+
the rebase is finished.
589+
* `merge_opts`: merge options controlling how the trees will be merged at each rebase step.
590+
Only present on libgit2 versions newer than or equal to 0.24.0.
591+
* `checkout_opts`: checkout options for writing files when initializing the rebase, stepping
592+
through it, and aborting it. See [`CheckoutOptions`](@ref) for more information.
579593
"""
580594
@kwdef struct RebaseOptions
581595
version::Cuint = 1
@@ -595,6 +609,23 @@ end
595609
596610
Describes a single instruction/operation to be performed during the rebase.
597611
Matches the [`git_rebase_operation`](https://libgit2.github.com/libgit2/#HEAD/type/git_rebase_operation_t) struct.
612+
613+
The fields represent:
614+
* `optype`: the type of rebase operation currently being performed. The options are:
615+
- `REBASE_OPERATION_PICK`: cherry-pick the commit in question.
616+
- `REBASE_OPERATION_REWORD`: cherry-pick the commit in question, but rewrite its
617+
message using the prompt.
618+
- `REBASE_OPERATION_EDIT`: cherry-pick the commit in question, but allow the user
619+
to edit the commit's contents and its message.
620+
- `REBASE_OPERATION_SQUASH`: squash the commit in question into the previous commit.
621+
The commit messages of the two commits will be merged.
622+
- `REBASE_OPERATION_FIXUP`: squash the commit in question into the previous commit.
623+
Only the commit message of the previous commit will be used.
624+
- `REBASE_OPERATION_EXEC`: do not cherry-pick a commit. Run a command and continue if
625+
the command exits successfully.
626+
* `id`: the [`GitHash`](@ref) of the commit being worked on during this rebase step.
627+
* `exec`: in case `REBASE_OPERATION_EXEC` is used, the command to run during this step
628+
(for instance, running the test suite after each commit).
598629
"""
599630
struct RebaseOperation
600631
optype::Cint

0 commit comments

Comments
 (0)