Skip to main content

WorktreeCommand

Enum WorktreeCommand 

Source
pub enum WorktreeCommand {
Show 17 variants Status, List, Topology, Root, Path { branch: String, }, Inspect { branch: String, }, Create { branch: Option<String>, base: Option<String>, issue: Option<String>, }, Ensure { branch: String, base: Option<String>, }, Migrate { plan: bool, dry_run: bool, allow_copy: bool, only: Vec<String>, include_ephemeral: bool, }, Validate, Doctor, Guard { quiet: bool, }, Repair { dry_run: bool, }, Remove { selector: String, force: bool, }, Cleanup { remove: bool, }, Uncommitted { older_than: Option<String>, }, Branches { without_worktree: bool, },
}
Expand description

The subcommands of majordomus worktree.

Variants§

§

Status

Where this call is — branch, worktree, canonical or not, uncommitted work — and how many errors the whole topology carries; exit 10 when this worktree is out of place

§

List

Every registered worktree with its standing, one line each; exit 10 when the topology has an error

§

Topology

The whole topology: repository, container, trunk, every worktree, every branch without a worktree, every diagnostic; exit 10 when it has an error

§

Root

Print the container every linked worktree belongs under, and nothing else: cd "$(majordomus worktree root)"

§

Path

Print the canonical path of a branch, and nothing else: cd "$(majordomus worktree path feature/x)". Derived from the name; the branch need not exist

Fields

§branch: String

The branch, full name

§

Inspect

One branch: its canonical path, whether it exists, what occupies the path, the worktree holding it, and what stands in the way

Fields

§branch: String

The branch, full name

§

Create

Create the canonical worktree of a branch. A branch that does not exist here is fetched from the trunk’s remote and taken up when the remote has it; otherwise it is created from –base, else from the remote’s trunk fetched now (the local trunk only when the remote cannot be read, and then said, with how far behind). The path is derived; none may be given

Fields

§branch: Option<String>

The branch, full name (feature/improve-cli)

§base: Option<String>

Start a new branch from this ref. Never fetched: it must resolve locally

§issue: Option<String>

Name the branch after this issue of .ai/repo/project/issues: feature/<id>-<slug>, the form the topology reads the issue back from

§

Ensure

The canonical worktree of a branch: created when absent, answered when present, refused when the branch is checked out somewhere else

Fields

§branch: String

The branch, full name

§base: Option<String>

Start a new branch from this ref (default: the trunk)

§

Migrate

Bring every misplaced worktree to its canonical path, dirty state included, with a fingerprint taken before and after each move; –plan shows the steps and changes nothing

Fields

§plan: bool

Show the plan and change nothing

§dry_run: bool

The same as –plan

§allow_copy: bool

When a move crosses filesystems, copy the tree, repair git’s link, verify the copy against a manifest of every entry, and only then remove the original

§only: Vec<String>

Only these branches

§include_ephemeral: bool

Also move the scratch checkouts of sessions (under the temporary directory or .claude/worktrees), which are otherwise reported and left alone

§

Validate

Every error of the topology, and nothing else; exit 10 when there is one

§

Doctor

Every diagnostic of the topology, errors, warnings and facts, each with its code and remedy; exit 10 when there is an error

§

Guard

May a mutation proceed from here? Exit 0 in a canonical worktree, in the primary checkout on the trunk, or detached; exit 10 with the reason otherwise. What the pre-commit hook asks

Fields

§quiet: bool

Print nothing on success

§

Repair

Drop git’s registrations of worktrees whose directories are gone, and repair the administrative links of the ones that exist. Deletes no directory

Fields

§dry_run: bool

Report what would be dropped and change nothing

§

Remove

Remove one linked worktree by branch or path. Never the primary checkout, never a branch, never uncommitted work without –force

Fields

§selector: String

An exact branch name or an exact path

§force: bool

Remove it even though it holds uncommitted work or is locked

§

Cleanup

The branches merged into the trunk whose worktree is clean or absent: what could be removed. Removes nothing without –remove

Fields

§remove: bool

Remove the worktrees listed, each re-measured immediately before it goes: a branch ahead of its remote, uncommitted work, or a process working inside is refused and named. Branches are never deleted; the listing still says how.

§

Uncommitted

Every linked worktree holding uncommitted work: how many paths, how old the oldest change, what holds it (an active task, an open episode, a process inside) and whether it is abandoned, with the command that would put it on a remote ref. Reads every worktree and writes none

Fields

§older_than: Option<String>

Judge against this age instead of the policy’s session.stranded_after (90s, 30m, 12h, 1d)

§

Branches

Every local branch, one per line, for a shell completion that wants the live set

Fields

§without_worktree: bool

Only branches with no worktree

Trait Implementations§

Source§

impl Debug for WorktreeCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for WorktreeCommand

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for WorktreeCommand

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more