pub struct CommitLedger { /* private fields */ }Expand description
Lists the commits a subagent holding a commit grant made, and brings them into the main repository.
The main repository’s refs, and so the listing, change only in the import
that Self::since runs; it reads nothing a subagent wrote, and the
subagent’s own git runs only inside the subagent’s sandbox.
Implementations§
Source§impl CommitLedger
impl CommitLedger
Sourcepub async fn mark(&self) -> Result<CommitMark, CommitLedgerError>
pub async fn mark(&self) -> Result<CommitMark, CommitLedgerError>
Starts a run: refreshes each worktree’s view of the main repository’s refs inside the subagent’s sandbox, imports what its repository already holds, then records where every worktree stands. A branch not yet born simply has no tip.
What the subagent’s repository does or holds never keeps a run from
starting. A repository that cannot be refreshed or imported (a stalled
or refused one) is left as it is, the run starts from what the main
repository holds, and the failure is in CommitMark::setbacks for the
run’s report; its commits stay in that repository, which the error
names. The mark’s tips are always the main repository’s, so a later
import that succeeds lists the commits an earlier holder left too,
never dropping them.
§Errors
Fails when git cannot list the main repository’s refs.
Sourcepub async fn since(
&self,
mark: &CommitMark,
) -> Result<Vec<SubagentCommit>, CommitLedgerError>
pub async fn since( &self, mark: &CommitMark, ) -> Result<Vec<SubagentCommit>, CommitLedgerError>
The commits made since mark, oldest first per worktree: everything
the worktree’s branch namespace or detached head reaches now and did
not reach then, whatever the subagent did with HEAD in between.
The subagent’s commits are imported into the main repository first. Every worktree’s import runs to its end before an error is returned.
§Errors
Fails when a subagent’s commits cannot be imported or git cannot list a worktree’s refs or commits.
Trait Implementations§
Source§impl Clone for CommitLedger
impl Clone for CommitLedger
Auto Trait Implementations§
impl !RefUnwindSafe for CommitLedger
impl !UnwindSafe for CommitLedger
impl Forget for CommitLedger
impl Freeze for CommitLedger
impl Move for CommitLedger
impl Send for CommitLedger
impl Sync for CommitLedger
impl Unpin for CommitLedger
impl UnsafeUnpin for CommitLedger
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more