pub enum Command {
Show 31 variants Amend { move_options: MoveOptions, }, BugReport, Gc, Hide { revsets: Vec<Revset>, resolve_revset_options: ResolveRevsetOptions, delete_branches: bool, recursive: bool, }, HookDetectEmptyCommit { old_commit_oid: String, }, HookPreAutoGc, HookPostCheckout { previous_commit: String, current_commit: String, is_branch_checkout: isize, }, HookPostCommit, HookPostMerge { is_squash_merge: isize, }, HookPostRewrite { rewrite_type: String, }, HookReferenceTransaction { transaction_state: String, }, HookRegisterExtraPostRewriteHook, HookSkipUpstreamAppliedCommit { commit_oid: String, }, Init { uninstall: bool, main_branch_name: Option<String>, }, Move { source: Vec<Revset>, base: Vec<Revset>, exact: Vec<Revset>, dest: Option<Revset>, resolve_revset_options: ResolveRevsetOptions, move_options: MoveOptions, insert: bool, }, Next { traverse_commits_options: TraverseCommitsOptions, }, Prev { traverse_commits_options: TraverseCommitsOptions, }, Query { revset: Revset, resolve_revset_options: ResolveRevsetOptions, show_branches: bool, raw: bool, }, Repair { dry_run: bool, }, Restack { revsets: Vec<Revset>, resolve_revset_options: ResolveRevsetOptions, move_options: MoveOptions, }, Record { message: Option<String>, interactive: bool, detach: bool, }, Reword { revsets: Vec<Revset>, resolve_revset_options: ResolveRevsetOptions, force_rewrite_public_commits: bool, messages: Vec<String>, discard: bool, commit_to_fixup: Option<Revset>, }, Smartlog { event_id: Option<isize>, revset: Option<Revset>, resolve_revset_options: ResolveRevsetOptions, }, Snapshot { subcommand: SnapshotSubcommand, }, Submit { create: bool, revset: Revset, resolve_revset_options: ResolveRevsetOptions, }, Switch { switch_options: SwitchOptions, }, Sync { pull: bool, move_options: MoveOptions, revsets: Vec<Revset>, resolve_revset_options: ResolveRevsetOptions, }, Test { subcommand: TestSubcommand, }, Undo { interactive: bool, yes: bool, }, Unhide { revsets: Vec<Revset>, resolve_revset_options: ResolveRevsetOptions, recursive: bool, }, Wrap { git_executable: Option<PathBuf>, command: WrappedCommand, },
}
Expand description

FIXME: write man-page text

Variants

Amend

Fields

move_options: MoveOptions

Options for moving commits.

Amend the current HEAD commit.

BugReport

Gather information about recent operations to upload as part of a bug report.

Gc

Run internal garbage collection.

Hide

Fields

revsets: Vec<Revset>

Zero or more commits to hide.

resolve_revset_options: ResolveRevsetOptions

Options for resolving revset expressions.

delete_branches: bool

Also delete any branches that are abandoned as a result of this hide.

recursive: bool

Also recursively hide all visible children commits of the provided commits.

Hide the provided commits from the smartlog.

HookDetectEmptyCommit

Fields

old_commit_oid: String

The OID of the commit currently being applied, to be checked for emptiness.

Internal use.

HookPreAutoGc

Internal use.

HookPostCheckout

Fields

previous_commit: String

The previous commit OID.

current_commit: String

The current commit OID.

is_branch_checkout: isize

Whether or not this was a branch checkout (versus a file checkout).

Internal use.

HookPostCommit

Internal use.

HookPostMerge

Fields

is_squash_merge: isize

Whether or not this is a squash merge. See githooks(5).

Internal use.

HookPostRewrite

Fields

rewrite_type: String

One of amend or rebase.

Internal use.

HookReferenceTransaction

Fields

transaction_state: String

One of prepared, committed, or aborted. See githooks(5).

Internal use.

HookRegisterExtraPostRewriteHook

Internal use.

HookSkipUpstreamAppliedCommit

Fields

commit_oid: String

The OID of the commit that was skipped.

Internal use.

Init

Fields

uninstall: bool

Uninstall the branchless workflow instead of initializing it.

main_branch_name: Option<String>

Use the provided name as the name of the main branch.

If not set, it will be auto-detected. If it can’t be auto-detected, then you will be prompted to enter a value for the main branch name.

Initialize the branchless workflow for this repository.

Move

Fields

source: Vec<Revset>

The source commit to move. This commit, and all of its descendants, will be moved.

base: Vec<Revset>

A commit inside a subtree to move. The entire subtree, starting from the main branch, will be moved, not just the commits descending from this commit.

exact: Vec<Revset>

A set of specific commits to move. These will be removed from their current locations and any unmoved children will be moved to their nearest unmoved ancestor.

dest: Option<Revset>

The destination commit to move all source commits onto. If not provided, defaults to the current commit.

resolve_revset_options: ResolveRevsetOptions

Options for resolving revset expressions.

move_options: MoveOptions

Options for moving commits.

insert: bool

Insert the subtree between the destination and it’s children, if any. Only supported if the moved subtree has a single head.

Move a subtree of commits from one location to another.

By default, git move tries to move the entire current stack if you don’t pass a --source or --base option (equivalent to writing --base HEAD).

By default, git move attempts to rebase all commits in-memory. If you want to force an on-disk rebase, pass the --on-disk flag. Note that post-commit hooks are not called during in-memory rebases.

Next

Fields

traverse_commits_options: TraverseCommitsOptions

Options for traversing commits.

Move to a later commit in the current stack.

Prev

Fields

traverse_commits_options: TraverseCommitsOptions

Options for traversing commits.

Move to an earlier commit in the current stack.

Query

Fields

revset: Revset

The query to execute.

resolve_revset_options: ResolveRevsetOptions

Options for resolving revset expressions.

show_branches: bool

Print the branches attached to the resulting commits, rather than the commits themselves.

raw: bool

Print the OID of each matching commit, one per line. This output is stable for use in scripts.

Query the commit graph using the “revset” language and print matching commits.

See https://github.com/arxanas/git-branchless/wiki/Reference:-Revsets to learn more about revsets.

The outputted commits are guaranteed to be topologically sorted, with ancestor commits appearing first.

Repair

Fields

dry_run: bool

Apply changes.

Restore internal invariants by reconciling the internal operation log with the state of the Git repository.

Restack

Fields

revsets: Vec<Revset>

The IDs of the abandoned commits whose descendants should be restacked. If not provided, all abandoned commits are restacked.

resolve_revset_options: ResolveRevsetOptions

Options for resolving revset expressions.

move_options: MoveOptions

Options for moving commits.

Fix up commits abandoned by a previous rewrite operation.

Record

Fields

message: Option<String>

The commit message to use. If not provided, will be prompted to provide a commit message interactively.

interactive: bool

Select changes to include interactively, rather than using the current staged/unstaged changes.

detach: bool

Detach the current branch before committing.

Create a commit by interactively selecting which changes to include.

Reword

Fields

revsets: Vec<Revset>

Zero or more commits to reword. If not provided, defaults to “HEAD”.

resolve_revset_options: ResolveRevsetOptions

Options for resolving revset expressions.

force_rewrite_public_commits: bool

Force rewording public commits, even though other people may have access to those commits.

messages: Vec<String>

Message to apply to commits. Multiple messages will be combined as separate paragraphs, similar to git commit.

discard: bool

Throw away the original commit messages.

If commit.template is set, then the editor is pre-populated with that; otherwise, the editor starts empty.

commit_to_fixup: Option<Revset>

A commit to “fix up”. The reworded commits will become fixup! commits (suitable for use with git rebase --autosquash) targeting the supplied commit.

Reword commits.

Smartlog

Fields

event_id: Option<isize>

The point in time at which to show the smartlog. If not provided, renders the smartlog as of the current time. If negative, is treated as an offset from the current event.

revset: Option<Revset>

The commits to render. These commits, plus any related commits, will be rendered.

resolve_revset_options: ResolveRevsetOptions

Options for resolving revset expressions.

Display a nice graph of the commits you’ve recently worked on.

Snapshot

Fields

subcommand: SnapshotSubcommand

The subcommand to run.

Manage working copy snapshots.

Submit

Fields

create: bool

If there is no remote branch for a given local branch, create the remote branch by pushing the local branch to the default push remote.

You can configure the default push remote with git config remote.pushDefault <remote>.

revset: Revset

The commits to push. All branches attached to those commits will be pushed.

resolve_revset_options: ResolveRevsetOptions

Options for resolving revset expressions.

Push commits to a remote.

Switch

Fields

switch_options: SwitchOptions

Options for switching.

Switch to the provided branch or commit.

Sync

Fields

pull: bool

Run git fetch to update remote references before carrying out the sync.

move_options: MoveOptions

Options for moving commits.

revsets: Vec<Revset>

The commits whose stacks will be moved on top of the main branch. If no commits are provided, all draft commits will be synced.

resolve_revset_options: ResolveRevsetOptions

Options for resolving revset expressions.

Move any local commit stacks on top of the main branch.

Test

Fields

subcommand: TestSubcommand

The subcommand to run.

Run a command on each commit in a given set and aggregate the results.

Undo

Fields

interactive: bool

Interactively browse through previous states of the repository before selecting one to return to.

yes: bool

Skip confirmation and apply changes immediately.

Browse or return to a previous state of the repository.

Unhide

Fields

revsets: Vec<Revset>

Zero or more commits to unhide.

resolve_revset_options: ResolveRevsetOptions

Options for resolving revset expressions.

recursive: bool

Also recursively unhide all children commits of the provided commits.

Unhide previously-hidden commits from the smartlog.

Wrap

Fields

git_executable: Option<PathBuf>

The git executable to invoke.

command: WrappedCommand

The arguments to pass to git.

Wrap a Git command inside a branchless transaction.

Trait Implementations

Build a Command that can instantiate Self. Read more
Build a Command that can update self. Read more
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Assign values from ArgMatches to self.
Assign values from ArgMatches to self.
Parse from std::env::args_os(), exit on error
Parse from std::env::args_os(), return Err on error.
Parse from iterator, exit on error
Parse from iterator, return Err on error.
Update from iterator, exit on error
Update from iterator, return Err on error.
Append to Command so it can instantiate Self. Read more
Append to Command so it can update self. Read more
Test whether Self can parse a specific subcommand

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Set the foreground color generically Read more
Set the background color generically. Read more
Change the foreground color to black
Change the background color to black
Change the foreground color to red
Change the background color to red
Change the foreground color to green
Change the background color to green
Change the foreground color to yellow
Change the background color to yellow
Change the foreground color to blue
Change the background color to blue
Change the foreground color to magenta
Change the background color to magenta
Change the foreground color to purple
Change the background color to purple
Change the foreground color to cyan
Change the background color to cyan
Change the foreground color to white
Change the background color to white
Change the foreground color to the terminal default
Change the background color to the terminal default
Change the foreground color to bright black
Change the background color to bright black
Change the foreground color to bright red
Change the background color to bright red
Change the foreground color to bright green
Change the background color to bright green
Change the foreground color to bright yellow
Change the background color to bright yellow
Change the foreground color to bright blue
Change the background color to bright blue
Change the foreground color to bright magenta
Change the background color to bright magenta
Change the foreground color to bright purple
Change the background color to bright purple
Change the foreground color to bright cyan
Change the background color to bright cyan
Change the foreground color to bright white
Change the background color to bright white
Make the text bold
Make the text dim
Make the text italicized
Make the text italicized
Make the text blink
Make the text blink (but fast!)
Swap the foreground and background colors
Hide the text
Cross out the text
Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Set the foreground color to a specific RGB value.
Set the background color to a specific RGB value.
Sets the foreground color to an RGB value.
Sets the background color to an RGB value.
Apply a runtime-determined style
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Calls the given closure and return the result. Read more
Calls the given closure on self.
Calls the given closure on self.
Calls the given closure if condition == true.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more