#[non_exhaustive]pub enum RepoEvent {
HeadMoved {
from: Option<String>,
to: Option<String>,
},
BranchSwitched {
from: Option<String>,
to: Option<String>,
},
BranchCreated {
name: String,
},
BranchDeleted {
name: String,
},
WorkingCopyChanged {
dirty: bool,
change_count: usize,
},
UpstreamChanged {
upstream: Option<String>,
},
AheadBehindChanged {
ahead: Option<usize>,
behind: Option<usize>,
},
OperationChanged {
from: OperationState,
to: OperationState,
},
ConflictChanged {
conflicted: bool,
},
}Expand description
One typed change to a repository’s observable state, derived by diffing two
consecutive RepoSnapshots (plus the branch set).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HeadMoved
The working-copy commit moved (a commit, checkout, reset, jj op, …).
from/to are the full object ids; None on an unborn git repo.
Fields
BranchSwitched
The current branch (git) / bookmark (jj) changed — a switch/checkout, or
going (in)to a detached/unset state (None).
Fields
BranchCreated
A local branch/bookmark appeared.
BranchDeleted
A local branch/bookmark was removed.
WorkingCopyChanged
The working-copy dirtiness or change count changed (an edit was staged, committed, stashed, snapshotted, …).
Fields
UpstreamChanged
The upstream tracking branch changed (git only; always absent on jj).
AheadBehindChanged
The ahead/behind counts versus the upstream changed (git only).
Fields
OperationChanged
The in-progress operation changed — a git merge or rebase started or
finished. A transition to/from OperationState::Conflict (jj’s conflict
marker) is not reported here: vcs-core derives jj’s operation and
conflicted from the same bit, so ConflictChanged
already signals it on both backends. So this event fires only on git, and
from/to are Clear/Merge/Rebase.
Fields
from: OperationStateThe previous operation state.
to: OperationStateThe new operation state.
ConflictChanged
Whether the working copy has an unresolved conflict changed.