Skip to main content

TreeCommand

Enum TreeCommand 

Source
pub enum TreeCommand {
    Commit {
        paths: Vec<PathBuf>,
        all: bool,
        message: Option<String>,
        force: bool,
        secret: Vec<PathBuf>,
        ordinary: Vec<PathBuf>,
        leave_secrets: bool,
        pin: Option<PathBuf>,
        unpin: Option<PathBuf>,
    },
    Mv {
        from: PathBuf,
        to: PathBuf,
    },
    Rm {
        paths: Vec<PathBuf>,
        recursive: bool,
        force: bool,
    },
    Log {
        path: Option<PathBuf>,
        tree: Option<String>,
    },
    Diff {
        from: Option<String>,
        to: Option<String>,
        since: Option<String>,
        until: Option<String>,
        tree: Option<String>,
        secrets: bool,
    },
    Blame {
        path: PathBuf,
        tree: Option<String>,
        secrets: bool,
    },
    Restore {
        path: PathBuf,
        at: Option<String>,
        as_of: Option<Moment>,
    },
    Revert {
        revision: String,
    },
    Update {
        partial: bool,
        clone: bool,
        no_clone: bool,
    },
    Clone {
        tree: String,
        folder: Option<PathBuf>,
        at: Option<String>,
        as_of: Option<Moment>,
        clone: bool,
        no_clone: bool,
    },
}
Expand description

The commands of trees, named as Git, Mercurial, Subversion, Fossil and Jujutsu name theirs, so that whoever knows one of them knows these: each works in the tree whose folder holds the current folder, unless it names one.

Variants§

§

Commit

Records what changed in the tree’s copy here as one revision.

It records what changed, or what changed at the paths given, with a message or without: new files, new versions, moves, deletions and executable bits; and the Git repositories in it, as your Git describes them: their remotes, with no credential, branch, and commit if pinned. New files need no adding first, and a file gone from one path and found with the same content at another moved. Every version is kept. What changed elsewhere since the copy was written is refused, unless –force records it on top. A new file is secret if its name is one such as .env or a private key’s, or a .nibsecret file names it, in Git’s syntax for .gitignore: it is sealed for the secrets, whose passphrase this asks for, and stays secret for good. With –pin or –unpin, it records only that.

Fields

§paths: Vec<PathBuf>

The files and folders to commit; without them, everything that changed.

§all: bool

Commits everything that changed, as without paths: Git’s -a.

§message: Option<String>

The revision’s message.

§force: bool

Records on top what changed elsewhere since the copy was written, which history keeps, and copies edited from a version this device does not know.

§secret: Vec<PathBuf>

Takes in this new file as a secret file, though no name or .nibsecret makes it one; or makes this committed file secret: a new secret file, and its old versions purged everywhere once you agree.

§ordinary: Vec<PathBuf>

Takes in this new file as an ordinary file, though it would be secret.

§leave_secrets: bool

Commits the rest where a secret file’s change waits for the secrets, as on a device that does not hold them.

§pin: Option<PathBuf>

Pins the Git repository in this folder at the commit it has checked out, as a revision of its own: writing the tree elsewhere then clones it at that commit, and commits keep it as Git says it is.

§unpin: Option<PathBuf>

Takes away the pin of the Git repository in this folder, as a revision of its own: clones then take the branch as its remote has it.

§

Mv

Moves a file or a folder, on the disk and in the tree at once.

A folder moves with everything in it, as a revision of its own: its history follows it. Nothing is moved onto what is there, out of the tree, or into .nib or a .git.

Fields

§from: PathBuf

Where it is.

§to: PathBuf

Where it goes.

§

Rm

Deletes copies of the tree’s files here, for the next commit.

It deletes the copies at the paths given, or in the folders given, and the folders they leave empty: the next commit records them as deleted. A copy with edits not committed stays, unless –force, and so do files that the tree does not hold. It records nothing.

Fields

§paths: Vec<PathBuf>

The files and folders.

§recursive: bool

Takes folders, as Git’s -r; they are taken without it too.

§force: bool

Deletes copies with edits not committed too, which are then lost.

§

Log

Lists the changes to the tree, or to one file, newest first.

The changes to the file at the path given are followed across its moves: when each was made, by whom, and its revision’s message. A change made otherwise, such as with nib edit, is listed without one.

Fields

§path: Option<PathBuf>

The file or link, as the tree names it now.

§tree: Option<String>

The tree, by its name or ID, instead of the one here; paths are then the tree’s.

§

Diff

Shows how the copy here differs from the tree, or two revisions.

It shows what a commit would record, with the lines of text that changed. With a revision, how the tree differs from it to the tree now; with two, from the first to the second, as their authors had the tree. A secret file shows only that it changed, unless –secrets asks for its lines. What one revision changed, nib show shows.

Fields

§from: Option<String>

The revision to compare from.

§to: Option<String>

The revision to compare to.

§since: Option<String>

The revision to compare from, as Mercurial, Fossil and Jujutsu name it.

§until: Option<String>

The revision to compare to, with –from.

§tree: Option<String>

The tree, by its name or ID, instead of the one here.

§secrets: bool

Shows the lines of secret files too, asking for the secrets’ passphrase.

§

Blame

Names the revision and author that last changed each line.

For each line of the file at the path given, it follows every version the file had, wherever it was then.

Fields

§path: PathBuf

The file, as the tree names it now.

§tree: Option<String>

The tree, by its name or ID, instead of the one here; the path is then the tree’s.

§secrets: bool

Blames a secret file too, asking for the secrets’ passphrase.

§

Restore

Writes a file into the copy here as it was, or as the tree has it.

It writes the file at the path given, or what is in the folder, as it was at a revision or as of a moment; without either, as the tree has it, a file deleted from the tree too. A copy with edits not committed is moved beside it first, as NAME.orig, so that its edits are kept. It records nothing: commit what it wrote once you checked it.

Fields

§path: PathBuf

The file or folder, as the tree named it then.

§at: Option<String>

The revision whose author’s tree to take it from.

§as_of: Option<Moment>

The moment as of which the library recorded it: a day, which means its end, or a moment, such as 2026-10-10T20:00, in local time unless it gives its offset.

§

Revert

Writes into the copy here what undoes a revision.

It writes that only, as Git’s revert and Mercurial’s backout do: each file it changed goes back to its version before it, merged three ways with what later revisions changed; files it moved go back, files it deleted come back, and files it added go. Where later edits clash, text gets Git’s conflict markers, and other files the version from before beside them. It records nothing: commit what it wrote once you checked it.

Fields

§revision: String

The revision, by its ID or the start of it.

§

Update

Brings the copy here to the tree as your other devices left it.

It brings what has reached this device: writes new versions, moves, additions and deletions, and merges your edits with newer versions. Where versions compete, as when two devices committed one file apart, text is merged three ways, with Git’s conflict markers where edits clash, and anything else stays as it is, with the other version beside it as NAME.conflict-DEVICE. A file edited here and deleted elsewhere stays. Nothing is recorded: committing what it wrote settles what competed. A commit in several parts waits until all its parts have arrived. The Git repositories that this copy lacks are listed, with where they come from, and cloned with your Git once you agree. Secret files are written with the secrets unlocked, readable only by you; a secret file moved elsewhere, and a .nibsecret that lost lines, are written once you agree. nib pull syncs first.

Fields

§partial: bool

Writes what parts have arrived of a commit whose other parts have not.

§clone: bool

Clones the Git repositories added elsewhere without asking.

§no_clone: bool

Clones no Git repository, and lists those it would.

§

Clone

Writes a tree into a folder, as it is or as it was.

The folder is empty or new, by default one named after the tree in the current folder: as it is, which becomes this device’s copy of it, as on a device that joined the library, with its Git repositories cloned once you agree; or with –at or –as-of, a picture of the past, which is no copy to commit from.

Fields

§tree: String

The tree, by its name or ID.

§folder: Option<PathBuf>

The folder.

§at: Option<String>

The revision whose author’s tree to write.

§as_of: Option<Moment>

The moment as of which the library recorded the tree to write.

§clone: bool

Clones the tree’s Git repositories without asking.

§no_clone: bool

Clones no Git repository, and lists those it would.

Trait Implementations§

Source§

impl Debug for TreeCommand

Source§

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

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

impl FromArgMatches for TreeCommand

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 TreeCommand

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
Source§

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

Source§

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

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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