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
force: boolRecords 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.
leave_secrets: boolCommits the rest where a secret file’s change waits for the secrets, as on a device that does not hold them.
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.
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
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
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
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
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
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.
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
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
Trait Implementations§
Source§impl Debug for TreeCommand
impl Debug for TreeCommand
Source§impl FromArgMatches for TreeCommand
impl FromArgMatches for TreeCommand
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut<'b>(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Subcommand for TreeCommand
impl Subcommand for TreeCommand
Source§fn augment_subcommands<'b>(__clap_app: Command) -> Command
fn augment_subcommands<'b>(__clap_app: Command) -> Command
Source§fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§fn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Self can parse a specific subcommandAuto Trait Implementations§
impl Forget for TreeCommand
impl Freeze for TreeCommand
impl Move for TreeCommand
impl RefUnwindSafe for TreeCommand
impl Send for TreeCommand
impl Sync for TreeCommand
impl Unpin for TreeCommand
impl UnsafeUnpin for TreeCommand
impl UnwindSafe for TreeCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.