pub struct UncommittedWorktree {Show 14 fields
pub path: String,
pub branch: Option<String>,
pub label: String,
pub work: DirtyState,
pub paths: usize,
pub oldest_change: Option<String>,
pub age_seconds: Option<u64>,
pub age: Option<String>,
pub task: Option<String>,
pub episodes: Vec<OpenEpisode>,
pub process_inside: Option<bool>,
pub held_by: Vec<String>,
pub standing: WorkStanding,
pub remedy: String,
}Expand description
One linked work tree holding uncommitted work: how much, how old, what holds it, the verdict, and the command that would preserve it. A listing is in canonical order — abandoned first, then recent, then held, the oldest first inside each.
use majordomus_cli::worktree::{DirtyState, UncommittedWorktree, WorkStanding};
let entry = |path: &str, standing: WorkStanding, age: u64| UncommittedWorktree {
path: path.into(),
branch: None,
label: path.into(),
work: DirtyState { staged: 1, ..DirtyState::default() },
paths: 1,
oldest_change: None,
age_seconds: Some(age),
age: None,
task: None,
episodes: Vec::new(),
process_inside: None,
held_by: Vec::new(),
standing,
remedy: String::new(),
};
let mut listing = vec![
entry("/wt/held-old", WorkStanding::Held, 900_000),
entry("/wt/young", WorkStanding::Abandoned, 50_000),
entry("/wt/older", WorkStanding::Abandoned, 90_000),
];
majordomus_cli::order::canonical(&mut listing);
let paths: Vec<&str> = listing.iter().map(|w| w.path.as_str()).collect();
assert_eq!(paths, ["/wt/older", "/wt/young", "/wt/held-old"]);Fields§
§path: StringAbsolute, as git holds it.
branch: Option<String>The branch checked out there. Absent when detached.
label: StringThe branch, or detached/<short commit>.
work: DirtyStateThe counts, as worktree status gives them.
paths: usizeEvery changed path: staged, unstaged, untracked and conflicted together.
oldest_change: Option<String>When the oldest change was made: the earliest modification time among the changed paths, the index file’s standing in for a path that no longer exists. RFC 3339.
age_seconds: Option<u64>Seconds since then.
age: Option<String>The same, for a person (3d, 5h, 40m).
task: Option<String>The active task recorded there.
episodes: Vec<OpenEpisode>The episodes open there.
process_inside: Option<bool>A process has its working directory inside it. Absent when that could not be read.
held_by: Vec<String>What holds it, in words; empty when nothing does.
standing: WorkStandingThe verdict.
remedy: StringThe command that would put this work on a remote ref. Suggested, never run.
Trait Implementations§
Source§impl Clone for UncommittedWorktree
impl Clone for UncommittedWorktree
Source§fn clone(&self) -> UncommittedWorktree
fn clone(&self) -> UncommittedWorktree
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UncommittedWorktree
impl Debug for UncommittedWorktree
Source§impl<'de> Deserialize<'de> for UncommittedWorktree
impl<'de> Deserialize<'de> for UncommittedWorktree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for UncommittedWorktree
Source§impl JsonSchema for UncommittedWorktree
impl JsonSchema for UncommittedWorktree
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ordered for UncommittedWorktree
Abandoned work first, then recent, then held; inside each, the oldest first; the path
breaks a tie, so two readings of one disk list it in one order.
impl Ordered for UncommittedWorktree
Abandoned work first, then recent, then held; inside each, the oldest first; the path breaks a tie, so two readings of one disk list it in one order.
Source§impl PartialEq for UncommittedWorktree
impl PartialEq for UncommittedWorktree
Source§fn eq(&self, other: &UncommittedWorktree) -> bool
fn eq(&self, other: &UncommittedWorktree) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for UncommittedWorktree
impl Serialize for UncommittedWorktree
impl StructuralPartialEq for UncommittedWorktree
Auto Trait Implementations§
impl Freeze for UncommittedWorktree
impl RefUnwindSafe for UncommittedWorktree
impl Send for UncommittedWorktree
impl Sync for UncommittedWorktree
impl Unpin for UncommittedWorktree
impl UnsafeUnpin for UncommittedWorktree
impl UnwindSafe for UncommittedWorktree
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.